On June 17, 2026, Tibo Sottiaux (@thsottiaux, OpenAI Codex) posted a reminder that surprised developers who still treat Codex as GPT-only:
Reminder that you can use the Codex App, CLI and SDK with any open source model, not just with OpenAI models.
The post hit 1.6M+ views within a day—because it reframes Codex from "OpenAI's coding agent" to a portable agent harness that can point at local weights, Chinese frontier models, or your own vLLM endpoint.
Ollama immediately showed what that looks like in practice: ollama launch codex and ollama launch codex-app with GLM-5.2 and Kimi-K2.7-Code—the same open models many teams adopted during the Fable 5 suspension.
This guide covers official OSS mode, Ollama integration, what works today, and what the community says is still broken.
Creates ~/.codex/ollama-launch.config.toml (profile v2 — separate from base config)
Keeps [model_providers.ollama-launch] in ~/.codex/config.toml
Invokes Codex with --profile ollama-launch
Configure without launching:
bash
ollama launch codex --config
Remove Ollama-managed profile:
bash
ollama launch codex --restore
Profile v2 migration (Codex 0.134+)
If you see:
snippet
--profile ollama-launch cannot be used while config.toml contains legacy
[profiles.ollama-launch] or profile = "ollama-launch"
Fix: Update Ollama to v0.30+. Older ollama launch codex wrote legacy [profiles.*] tables Codex no longer accepts. Profile settings now belong in ~/.codex/ollama-launch.config.toml, not nested under [profiles] in the main config.
Path B: Manual --oss Flag
For ad-hoc sessions without Ollama's launcher:
bash
# Default OSS provider (oss_provider in config.toml, usually ollama)
codex --oss
# Specific model
codex --oss -m gpt-oss:120b
# Ollama cloud-hosted variant
codex --oss -m gpt-oss:120b-cloud
Set default provider in ~/.codex/config.toml:
toml
# Default local provider used with `--oss`oss_provider = "ollama"# or "lmstudio"
Ensure Ollama is running (ollama serve) and the model is pulled before launching.
Path C: Persistent Profile Config (Power Users)
For teams that switch between GPT for planning and OSS for execution across sessions.
Critical:wire_api = "responses". Codex uses OpenAI's Responses API, not legacy Chat Completions. Endpoints that only expose /v1/chat/completions will fail or need a proxy (CC Switch community tool cited by developers).
Profile overlay in ~/.codex/ollama-launch.config.toml
toml
model = "glm-5.2"model_provider = "ollama-launch"model_catalog_json = "/Users/you/.codex/ollama-launch-models.json"
Then:
bash
codex --profile ollama-launch
codex exec --profile ollama-launch "fix the failing test in src/auth"
Profiles (Codex 0.134+): Each profile is a separate TOML file at ~/.codex/<profile-name>.config.toml with top-level keys — not nested [profiles.name] in the base config. Switch with --profile profile-name.
GPT profile for comparison
Create ~/.codex/gpt.config.toml:
toml
model = "gpt-5.5"model_reasoning_effort = "high"approval_policy = "on-request"
Verify model ID:curl http://localhost:8000/v1/models
Reserved IDs you cannot use for custom providers: openai, ollama, lmstudio. Pick a unique name like local_vllm or openrouter_oss.
To route open models through OpenRouter while keeping Codex's harness, define a custom provider pointing at OpenRouter's base URL with your API key — same pattern as Fusion API but with a single OSS model instead of the fusion panel.
Hardware rule of thumb: Coding agents need enough VRAM for the model plus headroom for long context. If the model stutters or truncates mid-task, reduce parallel tool calls or switch to a smaller quant.
What OSS Mode Actually Means
OpenAI's advanced Codex configuration documents OSS mode and local providers: point the Codex App, CLI, or SDK at an OpenAI-compatible or configured third-party base URL instead of default GPT endpoints.
That is structurally different from "run a chat UI on Llama." Codex brings:
Agent loop with tool execution
Repo-aware coding workflows
SDK embedding for custom products
The model underneath becomes pluggable—same harness, different weights.
Skills support (if your OSS model handles tool calls reliably)
What may degrade:
Tool-calling reliability (model-dependent)
Reasoning quality on hard agentic tasks
Features explicitly gated to GPT (below)
First Session Workflow
Once configured, a typical OSS Codex session:
bash
cd your-repo
codex --profile ollama-launch # or: ollama launch codex# Inside Codex TUI:
/init # generate AGENTS.md if missing
/permissions # set sandbox: read-only → workspace-write
/model # confirm local model selected"Fix the auth test in src/login.test.ts using TDD"
Tips for OSS models:
Smaller tasks — vertical slices, not "refactor the entire app"
/compact often — local models hit context limits faster than GPT-5.x
Verify tool output — weaker models may hallucinate file paths or skip tests
Codex App (Desktop) With OSS
@ollama (June 17, 2026) added desktop support:
bash
ollama launch codex-app
Same profile wiring as CLI. Known issue:@trashpandaemoji and others report the Desktop model picker does not list external providers even when config is correct—you may need to launch via Ollama integration or CLI until OpenAI fixes the UI.
No OpenAI API key required for local model inference. You still install the Codex client from OpenAI; only the inference endpoint changes.
Neither replaces the other—they compete as agent harnesses. Codex OSS mode matters if you already standardized on Codex SDK or want one agent client for GPT andGLM/Kimi.
Pragmatic pattern:--profile gpt for planning and architecture reviews; --profile ollama-launch for implementation slices—separate sessions, not one hybrid thread (until Filip Baturan's use case is supported).
Why OpenAI Did This Now
Timing aligns with:
Export-control turbulence around US frontier models (Fable 5 ban)
Developer demand for local-first agents (Headroom, Ollama ecosystem)
Codex without model lock-in is OpenAI's answer to "what if GPT is unavailable or too expensive?"—while keeping the harness proprietary.
Summary
Codex is no longer GPT-only. Official OSS mode plus Ollama's launch codex makes GLM-5.2, Kimi-K2.7-Code, and gpt-oss first-class targets for the same agent loop many teams used only with GPT-5.x.
The June 2026 reality is messier than @thsottiaux's tweet: model picker bugs, GPT-gated browser tools, Responses API requirements, profile v2 migration, and no clean multi-model orchestration in one session. For local coding on open weights today, it works. For full Codex desktop parity, expect friction.