Install
Install the Codex CLI. For the ChatGPT desktop app, see ChatGPT Desktop.Usage with Ollama
Use a context window of at least 64k tokens for Codex.
Quick setup
ollama launch codex, Ollama refreshes the model catalog
and uses a dedicated Codex profile for that session.
To configure without launching:
Manual setup
To usecodex with Ollama, use the --oss flag:
-m flag:
Profile-based setup
For a persistent Codex CLI configuration, create~/.codex/ollama-launch.config.toml:
Web search through local Ollama
Codex web-search requests sent through the Ollama profile are executed by Ollama for both local and cloud models. Sign in withollama signin to use the
web-search service.
To disable web search for a Codex session:

