⚡PURE PYTHON • ZERO DEPENDENCIES
Use Codex with
any model backend.
Route Codex IDE / CLI traffic to Ollama, NVIDIA Build, OpenRouter, vLLM, SGLang, LM Studio, DeepSeek, or any OpenAI-compatible API through one lightweight proxy.
Near-zero overhead
Native Responses API
Cross-platform
codex-proxy
How it works
Codex IDE / CLI
Your local tools
Responses API
Standard format
Codex Proxy
Route & manage
Upstreams
Chat / Completions
Supported Providers
Works with local and remote providers. All speak OpenAI-compatible APIs. Codex Proxy can route to one or many.
BUILT FOR RELIABILITY
Enterprise-grade Pool Mode
Pool Mode adds intelligent routing with failover, multi-key rotation, cooldowns, and curated logical profiles. Ship resilient AI workflows without managing complexity.
Available Profiles
codex-fast
Low latency. Optimized for speed and completions.
codex-balanced
Best overall quality, cost, and latency. Default.
codex-strong
Max quality for complex architectural tasks.
Live Routing VisualizationACTIVE PATH
Request
Target: codex-balanced
↓
1. NVIDIA Build (Primary)
Weight: 3 • Healthy
↓
2. OpenRouter (Fallback)
Weight: 1 • Cooldown (45s)
pool.yaml
pools:
codex-fast:
strategy: priority
cooldown: 60
retries: 2
providers:
- openrouter: { api_key: ${KEY}, priority: 1 }
- deepseek: { api_key: ${KEY}, priority: 2 }
codex-balanced:
strategy: weighted
providers:
- nvidia: { api_key: ${KEY}, weight: 3 }
- openrouter: { api_key: ${KEY}, weight: 1 }
codex-strong:
strategy: priority
providers:
- nvidia: { best_effort: true, priority: 1 }
- openrouter: { api_key: ${KEY}, priority: 2 }Why Pool Mode?
Higher uptime (failover)
Smarter cost routing
Multi-key rotation
Curated profiles
Quick Start
Get up and running in less than 60 seconds.
1. Clone & Enter
$git clone https://github.com/kyoo-147/codex_proxy_for_all_models.git
cd codex_proxy_for_all_models
cd codex_proxy_for_all_models
2. Configure
$export CODEX_PROXY_UPSTREAM_BASE_URL=http://127.0.0.1:11434/v1
export CODEX_PROXY_UPSTREAM_MODEL=llama3.1:70b
export CODEX_PROXY_UPSTREAM_MODEL=llama3.1:70b
3. Run Proxy
$python -m codex_proxy_for_all_models
~/.codex/config.toml
model = "llama3.1:70b"
model_provider = "local_model_proxy"
[model_providers.local_model_proxy]
name = "Local Model Proxy"
base_url = "http://127.0.0.1:8787"
wire_api = "responses"
env_key = "DUMMY_API_KEY"No FastAPI. No Flask. No Node. No database. No container required.
Pure Python
Single File
Tiny Footprint
Any Env
Build the future, your way.
One proxy. Any model. Infinite possibilities.