Loren Code is a local bridge and terminal UI for Ollama Cloud and Claude Code.
If you just want to use Loren, install it from npm. It is much more convenient.
This repository is best treated as the development version:
- source code
- scripts
- release prep
- local development and debugging
The published npm package has its own README focused on installation and first use.
For normal usage:
npm install -g loren-code
lorenFor development only:
git clone https://github.com/lorenzune/loren-code.git
cd loren-code
npm install
node scripts/loren.js- runs a local bridge on port
8788 - provides a terminal UI through
loren - manages Ollama Cloud model aliases
- stores config and runtime state under
%USERPROFILE%\.lorencode - includes helper scripts for Claude Code integration on Windows and Linux
Loren is designed for setups with multiple Ollama Cloud API keys.
If you configure more than one key, requests are rotated in round-robin order across the configured keys. Loren also supports manual key rotation and basic failover behavior.
That includes the common setup where users add multiple free-tier keys to reduce interruptions and keep the bridge usable for longer sessions.
Loren does not bypass Ollama Cloud limits or service terms.
Loren is built around a simple workflow:
- create one or more Ollama accounts
- collect the available API keys, including free-tier keys
- add them to Loren once
- let Loren serve Claude Code through those keys in round-robin mode
That helps reduce rate-limit friction and makes longer Claude Code sessions more practical.
In other words, Loren is useful when you want Claude Code and its tools available through Ollama Cloud without depending on an Anthropic Pro or Max subscription.
Because Loren is installed globally and keeps its own user-level setup, you do not need to rewire Claude Code from scratch in every new project.
On first run Loren creates user config under:
C:\Users\<you>\.lorencode\
Main files:
C:\Users\<you>\.lorencode\.env.local
C:\Users\<you>\.lorencode\runtime\
Example .env.local:
BRIDGE_HOST=127.0.0.1
BRIDGE_PORT=8788
OLLAMA_API_KEYS=sk-key1,sk-key2
OLLAMA_UPSTREAM_BASE_URL=https://ollama.com
DEFAULT_MODEL_ALIAS=gpt-oss:20b
OLLAMA_MODEL_ALIASES={"ollama-free-auto":"gpt-oss:20b","ollama-free-fast":"gemma3:12b"}node scripts/loren.js
node scripts/loren.js help
node scripts/loren.js config:show
node scripts/loren.js model:list
npm testIf you installed the npm package globally, use loren instead of node scripts/loren.js.
Loren includes helper scripts for wiring Claude Code to the local bridge:
scripts/install-claude-ollama.ps1scripts/install-claude-ollama.shscripts/uninstall-claude-ollama.ps1scripts/uninstall-claude-ollama.shscripts/claude-wrapper.js
These scripts can also take over the global claude command by backing up the existing shim or script and replacing it with a Loren-backed wrapper.
loren-code/
|- scripts/
| |- loren.js
| |- claude-wrapper.js
| `- install-claude-ollama.ps1
|- src/
| |- bootstrap.js
| |- server.js
| |- config.js
| |- key-manager.js
| `- ...
|- docs/
| |- README.github.md
| `- README.npm.md
|- .env.example
|- package.json
`- README.md
MIT