←新闻详情

Ollama Blog更新于 10月14日 12:28

Ollama 支持 OpenAI Codex CLI 调用开源模型

OpenAI Codex with Ollama · Ollama Blog

AI 导读

Ollama 宣布 OpenAI 的 Codex CLI 可通过 Ollama 使用开源模型,Codex 能借助 gpt-oss:20b、gpt-oss:120b 等开放权重模型读取、修改并执行工作目录中的代码。安装 Codex CLI 后用 --oss 标志启动,默认使用本地 gpt-oss:20b,也可通过 -m 标志切换模型,Ollama Cloud 上的所有模型均可用。官方提示 Codex 需要较大上下文窗口,建议至少 32K tokens。

推荐理由

AI 评分 52

Ollama 官方给出 Codex CLI 接入开源模型的完整配置路径,读者可据此把编码智能体切到本地或云端开源权重。

主题

标签

正文

当前显示原文,中文全文译文尚未就绪。

January 15, 2026

Open models can be used with OpenAI’s Codex CLI through Ollama. Codex can read, modify, and execute code in your working directory using models such as gpt-oss:20b, gpt-oss:120b, or other open-weight alternatives.

Install Codex CLI:

Start Codex with the --oss flag:

By default, Codex will use the local gpt-oss:20b model.

Note: Codex requires a large context window. We recommend at least 32K tokens. See the documentation for how to adjust context length in Ollama.

Changing models

You can switch to a different model using the -m flag:

Cloud models

All models on Ollama Cloud work with Codex.

Learn more

For more detailed setup instructions and configuration options, see the Codex integration guide.

来源

Ollama Blog