mirror of
http://10.0.2.1:3031/sauer/claude-code.git
synced 2026-06-30 11:36:57 +10:00
add local model support: Ollama, LM Studio, OpenAI via litellm proxy
This commit is contained in:
parent
1fff29dfdb
commit
b48c66b480
27
README.md
27
README.md
@ -49,7 +49,32 @@ export ANTHROPIC_API_KEY=your-key
|
||||
node cli.js
|
||||
```
|
||||
|
||||
> **Note:** Claude Code uses the Anthropic Messages API format. It does not support OpenAI-compatible endpoints (Ollama, LM Studio, etc.) directly — you would need an API format translator proxy like [litellm](https://github.com/BerriAI/litellm) in front.
|
||||
### With Local Models (Ollama, LM Studio)
|
||||
|
||||
Claude Code uses the Anthropic Messages API format. To use local models, run [litellm](https://github.com/BerriAI/litellm) as a translation proxy:
|
||||
|
||||
```bash
|
||||
# Terminal 1: Start litellm proxy
|
||||
pip install litellm
|
||||
litellm --model ollama/llama3.1:8b --port 8080
|
||||
|
||||
# Terminal 2: Point Claude Code at the proxy
|
||||
export ANTHROPIC_BASE_URL=http://localhost:8080
|
||||
export ANTHROPIC_API_KEY=not-needed
|
||||
node cli.js
|
||||
```
|
||||
|
||||
Works with any model Ollama supports — llama3.1, codellama, deepseek-coder, mistral, etc.
|
||||
|
||||
### With OpenAI / GPT Models
|
||||
|
||||
```bash
|
||||
# Via litellm proxy
|
||||
litellm --model openai/gpt-4o --port 8080
|
||||
|
||||
# Or any OpenAI-compatible endpoint (Codex, GPT-5.4, etc.)
|
||||
litellm --model openai/o3 --port 8080
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user