Discover and explore top open-source AI tools and projects—updated daily.
Proxy for using Gemini models with Claude Code
Top 86.9% on SourcePulse
This Python server acts as a proxy, enabling users of the Claude Code CLI to leverage Google's Gemini models. It translates API requests and responses between Anthropic's format and Gemini's format via LiteLLM, facilitating seamless integration for developers needing advanced LLM capabilities with their existing Claude Code workflows.
How It Works
The server receives requests from the Claude Code CLI, which are formatted for Anthropic's API. It then translates these requests, including model aliases and tool definitions, into a format compatible with LiteLLM. LiteLLM forwards the request to the specified Gemini model. The Gemini response is then translated back into the Anthropic format before being sent to the Claude Code client. This approach allows for robust tool use and streaming support, with advanced error handling for malformed chunks and API instability.
Quick Start & Requirements
pip install -r requirements.txt
.npm install -g @anthropic-ai/claude-code
).GEMINI_API_KEY
in a .env
file. Model mappings (e.g., BIG_MODEL
, SMALL_MODEL
) can also be customized.python server.py
or uvicorn server:app --host 0.0.0.0 --port 8082 --reload
for development.ANTHROPIC_BASE_URL=http://localhost:8082
when running Claude Code.Highlighted Details
/health
and /test-connection
for troubleshooting.Maintenance & Community
Contributions, issues, and feature requests are welcome on the GitHub repository. The project is inspired by and builds upon the work of @1rgs
.
Licensing & Compatibility
The repository does not explicitly state a license in the README. Compatibility for commercial use or closed-source linking would require clarification of the license.
Limitations & Caveats
The README notes that the CLAUDE.MD
file is "crucial" for optimal performance and that Gemini might "fuck up" without it, suggesting potential fragility in Gemini's understanding of Claude Code's directives. The license is not specified, which could be a barrier for some users.
2 months ago
Inactive