3,702 prompts from top AI collections
← Back to Market
[UNTESTED] [Zephyr236/claude-llama-proxy] 1 endpoint(s)
ChatGPT API Proxy/ChatGPT
2,129 characters
Status: [UNTESTED] Endpoints found: http://127.0.0.1:8000/v1/messages Source: https://github.com/Zephyr236/claude-llama-proxy # claude-llama-proxy [![CI](https://github.com/Zephyr236/claude-llama-proxy/actions/workflows/ci.yml/badge.svg)](https://github.com/Zephyr236/claude-llama-proxy/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/) Run **Claude Code** against a local model served by **llama.cpp** — or by any other server that speaks the OpenAI Chat Completions API. [中文说明](README.zh-CN.md) Claude Code only speaks the Anthropic Messages API (`POST /v1/messages`, SSE streaming). llama.cpp only serves OpenAI Chat Completions (`POST /v1/chat/completions`). This proxy sits in between and translates both directions, including streaming events and tool calls: ``` Claude Code --Anthropic Messages--> proxy --OpenAI Chat Completions--> llama.cpp <--Anthropic SSE-------- <--OpenAI SSE-------------- ``` The default upstream is `http://127.0.0.1:8080` and no API key is required. ## Quick start ```bash uv sync cp .env.example .env # then edit LLAMA_BASE_URL if needed uv run claude-llama-proxy ``` The proxy listens on `http://127.0.0.1:8000`. Sanity check it with: ```bash curl http://127.0.0.1:8000/health ``` ## Point Claude Code at the proxy Put this in `~/.claude/settings.json`. **The port must match the proxy's `PROXY_PORT`** — when Claude Code reads `ANTHROPIC_BASE_URL` from that file, its `env` block wins over shell variables, so change both if you move the port. ```json { "env": { "ANTHROPIC_BASE_URL": "http://127.0.0.1:8000", "ANTHROPIC_AUTH_TOKEN": "local", "ANTHROPIC_MODEL": "local-model", "ANTHROPIC_SMALL_FAST_MODEL": "local-model", "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1", "CLAUDE_CODE_MAX_CONTEXT_TOKENS": "32768", "API_TIMEOUT_MS": "600000" } } ``` Or export the same values for one shell session: ```bash export ANTHROPIC_BASE_URL=http://1
Download .txt