Codex接入本地QWen3.8模型
如何将Codex接入本地QWen3.8模型首先使用llama.cpp建立QWen3.8-27B的服务器笔者的API地址为http://192.168.3.13:8080然后在~/.codex目录下新建local-llama.config.toml文件写入以下配置modelQwen3.8-27B-UD-Q4_K_XL.gguf# 模型标识名llama.cpp 不校验但建议写真实名model_providerllama_cppmodel_context_window128000# 跟 llama-server 的 -c 一致model_auto_compact_token_limit100000model_reasoning_effortlowmodel_reasoning_summarydetailed# 显示详细推理摘要auto/detailed/concise/hiddenhide_agent_reasoningfalse# 不隐藏 agent 的推理过程show_raw_agent_reasoningtrue# 显示原始推理内容thinking blocksmodel_supports_reasoning_summariestrue# 声明模型支持推理摘要approval_policynever# 或 suggest看你信任程度sandbox_modeworkspace-write# 允许 Codex 写文件web_searchdisabled# 本地模型一般不支持联网搜索[features]appsfalsepluginsfalse[model_providers.llama_cpp]namellama.cpp Localbase_urlhttp://192.168.3.13:8080/v1#env_key LLAMA_API_KEY # 从环境变量读取 API Key不写死wire_apiresponses# 必须Codex 2026 年初已移除 chat 支持request_max_retries2stream_max_retries5stream_idle_timeout_ms300000[sandbox_workspace_write]network_accesstrue[tui]status_line[model-with-reasoning,context-remaining,current-dir,git-branch]下次启动codex的时候不要直接运行codex而是运行codex--profilelocal-llama