by hkqr
Open-source multi-provider AI gateway for Claude Code and other coding agents, with model routing, streaming, tools, reasoning, fallbacks, and local model support
# Add to your Claude Code skills
git clone https://github.com/hkqr/my-free-codemy-free-code is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by hkqr. Open-source multi-provider AI gateway for Claude Code and other coding agents, with model routing, streaming, tools, reasoning, fallbacks, and local model support. It has 96 GitHub stars.
my-free-code's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/hkqr/my-free-code" and add it to your Claude Code skills directory (see the Installation section above).
my-free-code is primarily written in Python. It is open-source under hkqr on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh my-free-code against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
A multi-provider gateway for Claude Code and other coding agents.
It is an independent implementation. It is not affiliated with Anthropic.
/v1/messages/v1/messages/count_tokens/v1/responses/v1/models/health/admin/api/admin/*The catalog contains the broad provider set used by the project:
NVIDIA NIM, OpenRouter, Groq, OpenAI, xAI, QwenCloud, Together, DeepInfra, SiliconFlow, Nebius, Chutes, Featherless, ZenMux, W&B Inference, Azure OpenAI, Google AI Studio, Google Vertex, DeepSeek, Mistral, Codestral, OpenCode Zen, OpenCode Go, Vercel AI Gateway, Amazon Bedrock, Hugging Face, Cohere, GitHub Models, Wafer, Kimi, Kimi Code, MiniMax, Cerebras, SambaNova, Kilo, Fireworks, Novita, Cloudflare Workers AI, Z.ai, TokenRouter, NaraRoute, Poolside, LLM7, Ollama Cloud, LM Studio, llama.cpp and Ollama.
Provider entries are not fake claims of universal support: providers with unusual authentication/protocols require a dedicated adapter. The common OpenAI-compatible providers use the shared transport.
The architecture has launcher adapters for:
A launcher simply prepares the local proxy environment and delegates arguments to the installed client.
Coding Agents / IDEs
|
+-----------+-----------+
| |
Anthropic Messages OpenAI Responses
| |
+-----------+-----------+
|
FastAPI Gateway
|
Model Router
|
+-----------+-----------+
| |
Primary Fallbacks
| |
+-----------+-----------+
|
Provider Runtime
|
+--------------+--------------+
| | |
OpenAI-compatible Specialized Local
adapter adapter runtime
| | |
APIs provider API Ollama/LM Studio
The architecture deliberately separates wire protocols from routing and provider code. This mirrors the important architectural boundary in the current reference project: HTTP adapters, application routing/execution, provider runtime, CLI adapters and optional messaging are separate concerns. citeturn0search0
Python 3.10+.
python -m venv .venv
Windows:
.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
copy .env.example .env
macOS/Linux:
source .venv/bin/activate
python -m pip install -r requirements.txt
cp .env.example .env
Start:
python -m my_free_code
Default address:
http://127.0.0.1:8082
Example:
MODEL=open_router/openrouter/free
MODEL_SONNET=deepseek/deepseek-chat
MODEL_HAIKU=groq/llama-3.3-70b-versatile
MODEL_OPUS=nvidia_nim/meta/llama-3.3-70b-instruct
FALLBACK_MODELS=deepseek/deepseek-chat,ollama/llama3.1
Then set the corresponding API keys in .env.
The public model identity stays as the gateway model even when a request is routed to another upstream provider.
$env:ANTHROPIC_BASE_URL="http://127.0.0.1:8082"
$env:ANTHROPIC_AUTH_TOKEN="local"
$env:CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY="1"
claude
Or:
python -m my_free_code.cli.mfc claude
The launcher abstraction supports:
python -m my_free_code.cli.mfc codex
python -m my_free_code.cli.mfc pi
python -m my_free_code.cli.mfc opencode
python -m my_free_code.cli.mfc cline
python -m my_free_code.cli.mfc hermes
python -m my_free_code.cli.mfc deepseek-harness
python -m my_free_code.cli.mfc grok
python -m my_free_code.cli.mfc muse
The installed client must already exist on PATH.
For:
MODEL_SONNET=deepseek/deepseek-chat
FALLBACK_MODELS=groq/llama-3.3-70b-versatile,ollama/llama3.1
a Sonnet request follows:
Claude Code
|
v
deepseek/deepseek-chat
|
| failure before output
v
groq/llama-3.3-70b-versatile
|
| failure before output
v
ollama/llama3.1
Once a streaming response has committed output, the gateway does not silently switch providers and duplicate the turn.
The gateway accepts Claude-style thinking intent and keeps it separate from provider-specific request translation.
Supported normalized modes:
auto
on
off
and optional effort:
low
medium
high
Provider adapters can map the normalized reasoning policy to their documented upstream fields.
Open:
http://127.0.0.1:8082/admin
Authenticated JSON endpoints:
GET /api/admin/status
GET /api/admin/models
GET /api/admin/providers
Ollama:
OLLAMA_BASE_URL=http://127.0.0.1:11434/v1
MODEL=ollama/llama3.1
LM Studio:
LM_STUDIO_BASE_URL=http://127.0.0.1:1234/v1
MODEL=lmstudio/qwen3.5-coder
llama.cpp:
LLAMACPP_BASE_URL=http://127.0.0.1:8080/v1
MODEL=llamacpp/my-model
This is intended for local use.
HOST=127.0.0.1PROXY_AUTH_TOKEN.envpytest -q
The repository includes deterministic tests for routing, protocol conversion, auth, reasoning, model catalog and streaming primitives.
my-free-code/
├── my_free_code/
│ ├── api/
│ │ ├── routes.py
│ │ └── admin_routes.py
│ ├── cli/
│ │ ├── claude.py
│ │ ├── launchers.py
│ │ └── mfc.py
│ ├── core/
│ │ ├── anthropic.py
│ │ ├── responses.py
│ │ ├── reasoning.py
│ │ ├── failures.py
│ │ ├── streaming.py
│ │ └── model_catalog.py
│ └── providers/
│ ├── catalog.py
│ ├── adapters.py
│ ├── specialized.py
│ └── runtime.py
├── tests/
├── ARCHITECTURE.md
├── .env.example
├── requirements.txt
├── pyproject.toml
└── README.md
MIT.