loren-code
v0.3.10
Published
Terminal UI and local bridge for Ollama Cloud and Claude Code with model switching and API key rotation
Maintainers
Readme
loren-code
loren-code installs the loren CLI and terminal UI for working with a local Ollama Cloud bridge.
It is built to rotate multiple Ollama Cloud API keys, including the common setup where users configure more than one free-tier key for longer uninterrupted bridge usage.
If you configure more than one key, Loren sends requests in round-robin order across the configured keys.
Loren manages rotation and failover, but it does not bypass upstream limits or service terms.
Why Use Loren
Loren is useful if you want Claude Code ready quickly without repeating the same setup in every project.
A common workflow looks like this:
- create one or more Ollama accounts
- collect the available API keys, including free-tier keys
- add them to Loren once
- let Loren rotate requests across those keys in round-robin mode
That helps reduce rate-limit friction and keeps Claude Code sessions usable for longer.
Loren is installed globally, so once setup is done it stays ready across projects without manually redoing the same Claude Code bridge configuration every time.
Install
npm install -g loren-codeVerify:
lorenFirst Run
Loren stores user config in %USERPROFILE%\.lorencode.
On first run it creates:
C:\Users\<you>\.lorencode\.env.localYou must add valid OLLAMA_API_KEYS before the bridge can make upstream requests.
If you configure multiple keys, Loren rotates them automatically.
For most users, the easiest path is:
lorenThat opens Loren's terminal UI and guided setup.
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"}Main Commands
loren
loren help
loren config:show
loren status
loren start
loren stop
loren model:list
loren model:set gpt-oss:20b
loren model:current
loren model:refresh
loren keys:list
loren keys:add sk-your-new-key
loren keys:remove 0
loren keys:rotateStart The Bridge
loren startThe local bridge runs on:
http://127.0.0.1:8788Claude Code Integration
On Windows:
powershell -ExecutionPolicy Bypass -File "$(npm prefix -g)\node_modules\loren-code\scripts\install-claude-ollama.ps1"On Linux:
sh "$(npm prefix -g)/node_modules/loren-code/scripts/install-claude-ollama.sh"The installer:
- configures VS Code to use the local bridge
- updates your user
.claudesettings - backs up existing global
claudeshims - installs Loren-backed
claude,claude.cmd, andclaude.ps1wrappers
To restore the original claude command:
powershell -ExecutionPolicy Bypass -File "$(npm prefix -g)\node_modules\loren-code\scripts\uninstall-claude-ollama.ps1"On Linux:
sh "$(npm prefix -g)/node_modules/loren-code/scripts/uninstall-claude-ollama.sh"Troubleshooting
loren not found
Make sure the package was installed globally:
npm install -g loren-codenpm blocked in PowerShell
Use:
npm.cmd install -g loren-codeMissing API keys
Populate OLLAMA_API_KEYS in %USERPROFILE%\.lorencode\.env.local.
Port already in use
Change BRIDGE_PORT in %USERPROFILE%\.lorencode\.env.local.
Repository
Source code and project documentation:
https://github.com/lorenzune/loren-code
