Codex 启用 GPT-5.6 Sol 百万 token 上下文窗口配置方法
Here is how to enable a 1M-token context window in Codex for GPT-5.6 Sol.
Here is how to enable a 1M-token context window in Codex for GPT-5.6 Sol.
以下是如何在Codex中为GPT-5.6 Sol启用100万令牌上下文窗口的方法。
Even though we have tuned the context limit in Codex to be set optimally when it comes to performance and cost, this is a common ask, so here it is documented.
尽管我们在Codex中调整了上下文限制,以在性能和成本之间达到最优,但这是一个常见的需求,因此在此记录。
A larger context window lets Codex retain more code, tool output, and conversation history before summarizing older material. You need a model that supports it. And GPT-5.6 Sol, for example, has a documented 1,050,000-token window.
更大的上下文窗口让Codex在总结旧材料之前,能保留更多代码、工具输出和对话历史。你需要一个支持它的模型。例如,GPT-5.6 Sol有文档记载的1,050,000令牌窗口。
Open ~/.codex/config.toml and add or update these settings at the top level, before any [section] headers:
打开~/.codex/config.toml,并在任何[section]标题之前,在顶层添加或更新这些设置:
model = "gpt-5.6-sol"
model_context_window = 1000000
model_auto_compact_token_limit = 900000model = "gpt-5.6-sol"
model_context_window = 1000000
model_auto_compact_token_limit = 900000The first setting selects the model. The second tells Codex to use a one-million-token context budget. The third starts automatic history compaction around 900,000 tokens, leaving some headroom. Restart Codex client and start a new session after saving.
第一个设置选择模型。第二个告诉Codex使用一百万个令牌的上下文预算。第三个在约900,000令牌时启动自动历史压缩,留出一些余量。保存后重启Codex客户端并开始新会话。
To try the configuration for a single CLI session without changing your defaults:
要尝试单个CLI会话的配置而不更改默认设置:
codex -m gpt-5.6-sol \
-c model_context_window=1000000 \
-c model_auto_compact_token_limit=900000codex -m gpt-5.6-sol \
-c model_context_window=1000000 \
-c model_auto_compact_token_limit=900000Have fun, but also know that we tuned the default carefully!
尽情享受,但也要知道我们精心调整了默认设置!
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力