Skip to main content

Install

Install the Codex CLI. For the desktop app, see Codex App.

Usage with Ollama

Codex requires a larger context window. It is recommended to use a context window of at least 64k tokens.

Quick setup

When launched through ollama launch codex, Ollama refreshes the model catalog and uses a dedicated Codex profile for that session. To configure without launching:
To remove the Ollama launch profile and generated model catalog:

Manual setup

To use codex with Ollama, use the --oss flag:
To use a specific model, pass the -m flag:
To use a cloud model:

Profile-based setup

For a persistent Codex CLI configuration, create ~/.codex/ollama-launch.config.toml:
Then run: