Codex CLI v0.130.0+ supports local models via --oss --local-provider ollama. However, Ollama's /v1/responses endpoint (used by Codex) does not properly handle tool-calling with local models — all tool calls fail with unsupported call errors.
The same models produce correct tool_calls through Ollama's /v1/chat/completions endpoint. This bridge performs the protocol translation.
1# 1. Start Ollama on port 114332OLLAMA_HOST="127.0.0.1:11433" ollama serve
34# 2. Start the bridge5python3 proxy.py
67# 3. Use Codex with any local model8codex --oss --local-provider ollama -m qwen3:14b
Installation
bash
1# Clone or copy proxy.py2cp proxy.py /usr/local/bin/codex-bridge
3chmod +x /usr/local/bin/codex-bridge
45# Deploy as macOS daemon (auto-start on boot)6cp com.x.codex-bridge.plist ~/Library/LaunchAgents/
7launchctl load -w ~/Library/LaunchAgents/com.x.codex-bridge.plist
89# Or use the control script10./codex-bridge-ctl.sh start