From 676a54ec7b6e11a5f80ba8c3a008039908bab70b Mon Sep 17 00:00:00 2001 From: root Date: Thu, 2 Apr 2026 13:59:34 -0400 Subject: [PATCH] Fix: add LiteLLM proxy so Claude Code can use qwen2.5-coder:32b --- docker-compose.yml | 25 +++++++++++++++++++++---- litellm-config.yaml | 8 ++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 litellm-config.yaml diff --git a/docker-compose.yml b/docker-compose.yml index ae930ea..2d70674 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,22 +22,37 @@ services: - OLLAMA_HOST=0.0.0.0 - OLLAMA_KEEP_ALIVE=24h + litellm: + image: ghcr.io/berriai/litellm:main-latest + container_name: litellm + restart: unless-stopped + depends_on: + - ollama + ports: + - "4000:4000" + volumes: + - ./litellm-config.yaml:/app/config.yaml + command: ["--config", "/app/config.yaml", "--port", "4000"] + claude-code: image: node:20-slim container_name: claude-code restart: unless-stopped depends_on: - - ollama + - litellm environment: - - ANTHROPIC_BASE_URL=http://ollama:11434/v1 + # Point Claude Code at LiteLLM which fully speaks the Anthropic API + - ANTHROPIC_BASE_URL=http://litellm:4000 - ANTHROPIC_API_KEY=ollama - - CLAUDE_CODE_DEFAULT_MODEL=qwen2.5-coder:32b volumes: - workspace:/workspace + - claude_config:/root/.claude working_dir: /workspace command: > sh -c "npm install -g @anthropic-ai/claude-code && - echo 'Claude Code installed. Run: claude' && + mkdir -p /root/.claude && + echo '{\"model\": \"qwen2.5-coder:32b\"}' > /root/.claude/settings.json && + echo 'Claude Code ready. Run: claude' && tail -f /dev/null" stdin_open: true tty: true @@ -47,3 +62,5 @@ volumes: driver: local workspace: driver: local + claude_config: + driver: local diff --git a/litellm-config.yaml b/litellm-config.yaml new file mode 100644 index 0000000..53b22eb --- /dev/null +++ b/litellm-config.yaml @@ -0,0 +1,8 @@ +model_list: + - model_name: qwen2.5-coder:32b + litellm_params: + model: ollama/qwen2.5-coder:32b + api_base: http://ollama:11434 + +general_settings: + master_key: ollama