Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ollama-code

Claude Code's published CLI running through a local Ollama compatibility shim.

This is not a clean-room rewrite. The UI/agent loop still comes from the bundled upstream CLI; this repo mainly redirects Anthropic-style requests to Ollama and changes the local defaults/branding around it.

ollama-code UI

Run

node ./bin/ollama-code.mjs
node ./bin/ollama-code.mjs --help

By default it picks a small installed code model. Set one yourself if you want:

export OLLAMA_HOST=http://127.0.0.1:11434
export OLLAMA_MODEL=qwen2.5-coder:7b

Small models are much faster on CPU, but tool calling gets worse pretty quickly as you go down in size.

How it works

  • .upstream/package/cli.js is the published upstream CLI bundle
  • bin/anthropic-ollama-shim.mjs translates /v1/messages to Ollama /api/chat
  • streamed Ollama output is converted back to Anthropic-style SSE events
  • the launcher patches the visible local branding/defaults

The src/ mirror is incomplete. I keep it around for targeted patching and analysis; it is not a source-complete copy of upstream Claude Code.

More detail on that in docs/MIRROR_GAPS.md.

Check

npm run check

About

Local-first coding CLI that runs the published Claude Code client against Ollama.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages