blog-logo
  • Codefa
  • Codeim
  • Interfacefa
  • Blog
  • About
  • Contact

All rights reserved by Foshati

DitfaTeamtemT.TeljooNeex
codefa: Run Claude Code and Codex CLI on Any AI Provider with a Local Proxy

codefa: Run Claude Code and Codex CLI on Any AI Provider with a Local Proxy

By Simon Sanders•October 29, 2026

AI coding agents like Claude Code and OpenAI Codex CLI are excellent — but each one is wired to its vendor's API. If you want to try Claude Code with DeepSeek, run Codex against a local Ollama model, or switch to whichever provider is fastest this week, you are on your own.

codefa fixes that. It is an open-source (MIT), local-first proxy and control center that connects coding agents to any OpenAI-compatible provider — NVIDIA NIM, OpenRouter, Gemini, DeepSeek, Mistral, Groq, Ollama, LM Studio, Kimi, MiniMax and many more.

How it works

codefa sits on your machine between the agent and the provider:

text
Claude Code  ─┐                         ┌─▶ OpenRouter
              ├─▶  codefa (localhost)  ─┼─▶ DeepSeek / Gemini / Groq …
Codex CLI    ─┘   protocol translation  └─▶ Ollama / LM Studio (local)

The agent speaks its native protocol — the Anthropic Messages API for Claude Code, the OpenAI Responses API for Codex. codefa translates those requests to whatever the downstream provider understands, and routes them to the model you picked. The agent never knows the difference.

Install in one line

macOS / Linux

bash
curl -fsSL https://codefa.foshati.com/install.sh | bash

Windows (PowerShell)

powershell
irm https://codefa.foshati.com/install.ps1 | iex

Running the same command again updates codefa in place.

The interactive launcher

Run codefa and you get a clean arrow-key menu:

  • Claude Code — launches Claude Code already configured to use the proxy
  • Codex CLI — launches Codex with your custom models and routing
  • Server Only — starts the proxy and opens the Admin UI

If you prefer to skip the menu:

bash
codefa claude   # launch Claude Code through codefa
codefa codex    # launch Codex CLI through codefa
codefa server   # start the proxy and open the Admin UI
codefa-init     # create ~/.codefa/.env

You don't need to export environment variables or edit agent config files — codefa injects the right proxy settings when it launches the agent.

The Admin UI

Open http://127.0.0.1:8090/admin and you get a responsive control panel (with dark and light mode) to:

  • add API keys for each provider,
  • choose models, rate limits and proxies,
  • and watch a live log stream of every HTTP request, status code and routing decision.

That last point matters more than it sounds. When an agent "just hangs", the live logs show you immediately whether the provider rate-limited you, rejected the model name, or timed out.

Choosing a provider

Model names follow a simple provider/model pattern:

ProviderExample model
OpenRouteropen_router/auto
DeepSeekdeepseek/deepseek-chat
Geminigemini/gemini-2.5-flash
Groqgroq/llama-3.3-70b-versatile
NVIDIA NIMnvidia_nim/meta/llama-3.3-70b-instruct
Ollama (local)ollama/llama3.3:latest
LM Studio (local)lmstudio/local-model

The full list in the README covers almost 30 providers, including Vertex AI, Amazon Bedrock, Hugging Face, Cohere, GitHub Models, Cerebras, SambaNova, Fireworks, Cloudflare Workers AI, Z.ai and llama.cpp.

Private by design

  • API keys live only in ~/.codefa/.env on your machine.
  • There is zero telemetry.
  • With a local provider such as Ollama, LM Studio or llama.cpp, your code never leaves your computer.

Built for speed

codefa is written in Python 3.14 on FastAPI, with uvloop and Loguru. The goal is that the proxy adds no noticeable latency between keystroke and token, and uses very little memory while it idles in the background.

Why I built it

I wanted to use the best agent UX with whichever model made sense for the task — a cheap fast model for refactors, a strong model for architecture, a local model for private code. Hard-wiring each agent to one vendor made that painful. codefa turns the model into a setting instead of a lock-in.

Get involved

  • ⭐ Star the repo: github.com/Foshati/codefa
  • 🐛 Open an issue if a provider misbehaves — logs from the Admin UI help a lot
  • 🔌 Contributions for new providers are welcome

Comments

Sign in to leave a comment or like this post