Dev & Engineering api-gatewaymodel-routingfallbackollamaopenai-compatiblefastapiself-hosted

My Free Code

A local multi-provider gateway for Claude Code and other coding agents: unified model routing, streaming, tool calls and ordered fallbacks behind one API endpoint.

FollowAgents review · FARS-2.1
Not recommended
54/ 100 5-point scale 2.7 / 5
1 2 3 4 5 6
1Trust13 / 29 · 2.2/5

The evidence shows local-only deployment guidance, a non-trivial PROXY_AUTH_TOKEN requirement, and a minimal dependency list (fastapi/uvicorn/httpx/python-dotenv), supporting 2 for sensitive data handling and dependency security. However, admin endpoint auth, routing and streaming logic are only referenced indirectly via tests; core source is not in evidence, so least privilege, user confirmation and data flow transparency are assertions only, scored 1. Rollback is limited to 'no silent provider switch after streaming commits'; no recovery mechanism shown, scored 1. Attribution is weakened by the '★' placeholder copyright holder and an unidentifiable author, scored 1.

2Reliability8 / 14 · 2.9/5

The README's routing/fallback descriptions match tests/test_router.py (fallback dedup, explicit model passthrough), and install steps cover Windows/macOS/Linux, so self-consistency and dependency availability score 2. Failure-message handling is evidenced only by a failures.py filename with no visible error content or policy, so failure_messages scores 1.

3Adaptability12 / 18 · 3.3/5

The project clearly targets a local multi-provider gateway with tier routing, fallback chains and local model configs (Ollama/LM Studio/llama.cpp), and honestly states that unusual auth/protocols need dedicated adapters; capability boundaries and trigger semantics (tier→model mapping) are clear, scoring 2 across audience, boundaries, trigger precision and environment fit (three-platform install steps).

4Convention9 / 18 · 2.5/5

Structure diagram, layered architecture, install commands and pyproject entry points are present: information architecture and install notes score 2; naming (my-free-code / mfc CLI) is consistent across pyproject and README, scoring 2; MIT LICENSE file exists, scoring 2. But there is no FAQ, no known-limitations section beyond the implicit local-use warning, no changelog (only version 0.8), and the maintainer/update path is unclear (placeholder copyright), so those criteria score 1.

5Effectiveness9 / 13 · 3.5/5

As a gateway aggregating 40+ providers, two wire protocols and local runtimes, the output (OpenAI/Anthropic-compatible endpoints) is directly usable by coding agents, with tests covering protocol conversion; output usability, marginal value and cost benefit each score 2. Performance and streaming stability remain unproven, so 3 is not awarded.

6Verifiability3 / 8 · 1.9/5

Test files map to README claims about routing, protocol conversion and auth, but core module source is not provided, so claims trace only partly to tests and not to implementation: claim_traceability scores 1. The README contains a fabricated-looking citation marker ('citeturn0search0') and an unverifiable 'mirrors the reference project' architecture claim, so cross-source corroboration and fact/inference separation each score 1.

Evidence confidence: Low Reviewed Sep 07, 2026 Reviewed revision 3fea11e1a5c0
Before you use it
  • Publisher identity is unverified and the copyright holder is a placeholder '★'; assess supply-chain trust independently.
  • Core source is not in evidence; admin auth and endpoint protection are documentation/test claims only — audit routes.py/admin_routes.py before deploying.
  • The README contains a leftover 'citeturn0search0' citation marker, suggesting model-generated text not fully cleaned; verify technical claims.
  • No known-limitations section or changelog; v0.8 behavior may change — run pytest and validate in an isolated environment before relying on it.
  • Keep HOST=127.0.0.1, set a strong PROXY_AUTH_TOKEN, and never expose /admin to the public internet.
Review evidence [1][2][3][4][5][6][7]
See the full review method →

What does this agent do, and when should you use it?

My Free Code v0.8 is an independently implemented open-source multi-provider AI gateway for Claude Code and other coding agents (explicitly not affiliated with Anthropic). Built on FastAPI, it implements both the Anthropic Messages wire protocol (/v1/messages, /v1/messages/count_tokens) and the OpenAI Responses protocol (/v1/responses), plus model discovery, health, a local Admin UI, and an authenticated Admin API. Below the protocol layer, a model router provides Claude tier routing (Fable/Opus/Sonnet/Haiku), ordered model fallback, provider health backoff, concurrency and rate-window controls, all while keeping a stable public model identity. The provider catalog spans dozens of cloud services — OpenRouter, Groq, DeepSeek, NVIDIA NIM, Azure OpenAI, Google Vertex, Amazon Bedrock and more — plus local runtimes Ollama, LM Studio and llama.cpp; OpenAI-compatible providers share one transport while unusual protocols get dedicated adapters. Deployment is a local Python process (default http://127.0.0.1:8082) with credentials kept in a local .env, and the README frames it as a local-use tool.

When started, the gateway listens locally and accepts requests in either Anthropic Messages or OpenAI Responses format. It reads MODEL, MODEL_SONNET, MODEL_OPUS, MODEL_HAIKU and FALLBACK_MODELS settings plus per-provider API keys from .env, selects a primary provider via the model router, and on pre-output failure moves down the ordered fallback list (it never silently switches providers mid-stream to duplicate a turn). It supports SSE streaming, tool definitions and tool calls, image inputs, and reasoning/thinking metadata pass-through (auto/on/off with optional low/medium/high effort, mapped to upstream fields by provider adapters). The provider layer calls upstreams via a shared OpenAI-compatible transport or dedicated adapters; local models are reached through OLLAMA_BASE_URL, LM_STUDIO_BASE_URL or LLAMACPP_BASE_URL. The launcher layer (python -m my_free_code.cli.mfc) prepares the local proxy environment for claude, codex, pi, opencode, cline, hermes, deepseek-harness, grok and muse, then delegates to the installed client. The Admin UI (/admin) and /api/admin/status, /api/admin/models, /api/admin/providers expose status. Deterministic pytest tests cover routing, protocol conversion, auth, reasoning, the model catalog and streaming primitives.

  1. A Claude Code user who wants to swap the official Anthropic endpoint for cheaper or free models (DeepSeek, Groq, OpenRouter) by pointing ANTHROPIC_BASE_URL at the local gateway
  2. A developer in an offline or privacy-sensitive environment who routes coding agents entirely to local models via Ollama/LM Studio/llama.cpp
  3. A heavy agent user needing reliability: configure FALLBACK_MODELS so a dead primary model degrades to backups automatically
  4. A team that wants differentiated routing per Claude tier (Sonnet/Opus/Haiku), mapping expensive tiers to designated substitute models
  5. A user running multiple coding clients (Codex, OpenCode, Cline, etc.) who wants one mfc launcher to inject proxy config for all of them
  6. An operator checking gateway status, available models and provider health through the Admin UI and Admin API

What are this agent's strengths and limitations?

Pros
  • Implements both Anthropic Messages and OpenAI Responses wire protocols, so Claude Code and Codex-style clients connect to the same gateway natively
  • Tier routing plus ordered fallback with a clearly defined no-mid-stream-switch guarantee on provider failure
  • Very broad provider catalog (dozens of cloud services plus three local runtimes); OpenAI-compatible providers share one transport, keeping adapter cost low
  • Layered architecture separating protocols, routing, provider runtime and CLI launchers, backed by deterministic tests covering routing, protocol conversion and streaming
Limitations
  • Positioned for local use: the README mandates binding 127.0.0.1 and not exposing Admin endpoints; multi-user or remote deployment is out of scope
  • A catalog entry is not universal support: providers with unusual auth/protocols need dedicated adapters, so coverage varies by provider
  • You must manage all provider API keys and .env config yourself; fallback only covers pre-output failures, not mid-stream interruptions
  • Launchers only prepare the proxy environment and delegate to already-installed clients — Codex, Cline, etc. must be installed separately

How do you install or deploy this agent?

Requires Python 3.10+. Windows: python -m venv .venv; .venv\Scripts\Activate.ps1; python -m pip install -r requirements.txt; copy .env.example .env. macOS/Linux: python -m venv .venv; 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. Then configure models and API keys in .env, e.g. MODEL=open_router/openrouter/free, MODEL_SONNET=deepseek/deepseek-chat, FALLBACK_MODELS=deepseek/deepseek-chat,ollama/llama3.1.

How do you use this agent?

With Claude Code: set ANTHROPIC_BASE_URL=http://127.0.0.1:8082, ANTHROPIC_AUTH_TOKEN=local, CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1, then run claude; or simply run python -m my_free_code.cli.mfc claude. Other clients: python -m my_free_code.cli.mfc followed by codex / pi / opencode / cline / hermes / deepseek-harness / grok / muse (the client must already be on PATH). Local models: e.g. OLLAMA_BASE_URL=http://127.0.0.1:11434/v1 with MODEL=ollama/llama3.1. Administration: open http://127.0.0.1:8082/admin. Security: keep HOST=127.0.0.1, set a non-trivial PROXY_AUTH_TOKEN, never commit .env, never expose Admin endpoints to the internet. Tests: pytest -q.

How does this agent compare with similar options?

The README positions this as an alternative接入 path to the official Anthropic endpoint for Claude Code — an independent implementation, not official and not affiliated with Anthropic; teams already paying for official Claude or needing a hosted multi-tenant gateway may prefer the official endpoint or a commercial gateway.

FAQ

Do I still need an Anthropic API key after connecting Claude Code?
No. The example uses ANTHROPIC_AUTH_TOKEN=local; the real upstream credentials are the per-provider keys you configure in .env (DeepSeek, Groq, OpenRouter, etc.).
What happens when the primary model fails?
The gateway falls back through FALLBACK_MODELS in order (e.g. deepseek → groq → ollama), but only before output begins; once streaming has committed output it will not silently switch providers and replay the turn.
Can I deploy it on a server for a team?
Not recommended. The README targets local use: keep HOST=127.0.0.1, set PROXY_AUTH_TOKEN, and never expose Admin endpoints to the internet; no multi-user or public deployment story is documented.
Can it run fully offline?
Yes, if all models route to local runtimes (Ollama, LM Studio, llama.cpp) with the corresponding MODEL and BASE_URL settings; then no cloud provider keys are needed.
Does it support reasoning/thinking modes?
Yes. The gateway accepts Claude-style thinking intent, normalizes it to auto/on/off with optional low/medium/high effort, and provider adapters map the policy to their documented upstream fields.

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related agents