Skip to content

Lorenzune/loren-code

LOREN CODE

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.

Recommended Install

For normal usage:

npm install -g loren-code
loren

For development only:

git clone https://github.com/lorenzune/loren-code.git
cd loren-code
npm install
node scripts/loren.js

What Loren Does

  • 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

API Keys And Rotation

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.

Why People Use Loren

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.

Local Setup

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"}

Common Development Commands

node scripts/loren.js
node scripts/loren.js help
node scripts/loren.js config:show
node scripts/loren.js model:list
npm test

If you installed the npm package globally, use loren instead of node scripts/loren.js.

Claude Code Integration

Loren includes helper scripts for wiring Claude Code to the local bridge:

  • scripts/install-claude-ollama.ps1
  • scripts/install-claude-ollama.sh
  • scripts/uninstall-claude-ollama.ps1
  • scripts/uninstall-claude-ollama.sh
  • scripts/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.

Project Structure

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

License

MIT

About

Terminal UI and local bridge for Ollama Cloud and Claude Code with model switching and API key rotation

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors