Run Claude Code using FreeLLMAPI + LiteLLM with Anthropic-compatible routing, model translation, troubleshooting guides, and Windows setup instructions.
Quick Start | Architecture | Troubleshooting | Validation | Setup Showcase
Claude Code expects Anthropic-style behavior and request semantics.
FreeLLMAPI is OpenAI-compatible, so it cannot be used directly without translation.
LiteLLM acts as the translation layer between the Anthropic-style client and the OpenAI-compatible gateway.
This repository documents the exact working bridge so the full setup can be reproduced reliably instead of guessed from a generic setup guide.
This repository provides a complete guide for setting up Claude Code with FreeLLMAPI and LiteLLM as a compatibility bridge. It solves compatibility issues between Claude Code and different providers by implementing a gateway architecture.
Visual overview:
graph TD
A[Claude Code] -->|HTTP Requests| B[LiteLLM]
B -->|Translated Requests| C[FreeLLMAPI]
C -->|Provider Pool| D[Local Models]
C -->|Provider Pool| E[Remote Models]
The architecture consists of:
- Claude Code: The main application that interacts with the user
- LiteLLM: Acts as a compatibility bridge, translating requests from Claude Code to a format that FreeLLMAPI can understand
- FreeLLMAPI: Provides an OpenAI-style chat completions API, forwarding requests to a pool of providers
- Provider Pool: A collection of local and remote models that can be used to fulfill requests
-
Install Prerequisites:
- Python 3.8+
- Node.js 16+
- Git
-
Clone the Repository:
git clone https://github.com/shashankpandya/claude-code-freellmapi.git cd claude-code-freellmapi
-
Start Services:
.\examples\combined-startup.ps1 -
Run Test Prompts:
.\examples\test-prompts.ps1
For detailed instructions, see the Full Installation Guide.
-
Install Prerequisites:
- Install Python and Node.js
- Install Git
-
Clone the Repository:
git clone https://github.com/shashankpandya/claude-code-freellmapi.git cd claude-code-freellmapi
-
Install Component Dependencies:
Install dependencies per component rather than from the repository root. Examples:
- FreeLLMAPI (if running locally):
cd /path/to/freellmapi && npm install - LiteLLM (if running locally):
cd /path/to/litellm && pip install -r requirements.txt
See the component guides for details: FREELLMAPI_CONFIG.md, LITELLM_CONFIG.md
- FreeLLMAPI (if running locally):
-
Start FreeLLMAPI:
.\examples\start-freellmapi.ps1 -
Start LiteLLM:
.\examples\start-litellm.ps1 -
Start Claude Code:
.\examples\start-claude.ps1
For more details, see the Installation Guide.
To validate that everything is working correctly, run the provided test prompts and observe the logs.
For more details, see the Validation Guide.
If you encounter issues, see the Troubleshooting Guide.
For frequently asked questions, see the FAQ.
For security guidelines, see the Security Guide.
For contribution guidelines, see the Contributing Guide.
For community support, see the Community Guide.
For credits and references, see the Credits Guide.
