OllamaFrom the builder
OpenAI Codex with Ollama
Through Ollama, OpenAI's Codex CLI can use open-weight models such as gpt-oss:20b and gpt-oss:120b to read, modify and run code in the working directory. Launching with the --oss flag uses the local gpt-oss:20b by default, the -m flag switches models, and every model on Ollama Cloud also works. Ollama recommends a context window of at least 32K tokens.
By default, Codex will use the local gpt-oss:20b model.
Saved . A shortened excerpt from the official blog; the original publisher retains authorship.