在Codex中配置使用智谱、Ollama本地模型

编辑config.toml文件:

js 复制代码
# model_provider = "wenwen"
# model = "gpt-5.2"

model_provider = "glm"
model = "glm-4.7"

model_reasoning_effort = "medium"

# 定义 Codex 执行敏感操作(如删除文件、安装包)时是否询问。
approval_policy = "never"
# 沙箱模式。restricted (受限), danger-full-access (允许 AI 完全访问你的本地系统文件和网络)
sandbox_mode = "danger-full-access"
# 隐私保护。开启后,Codex 不会将对话历史和代码上下文存储在本地日志或云端缓存中。
disable_response_storage = true

# --- windows wsl 设置(系统兼容) --- 
windows_wsl_setup_acknowledged = true


[model_providers.glm]
name = "glm"
base_url="https://open.bigmodel.cn/api/coding/paas/v4"
env_key="GLM_API_KEY"
wire_api = "chat"

[model_providers.wenwen]
name = "wenwen"
base_url="https://code.wenwen-ai.com/v1"
wire_api = "responses"
requires_openai_auth = true

[model_providers.ollama]
name = "Ollama"
base_url="http://127.0.0.1:11434/v1"
env_key="ollama"

# --- 属性 ---
[profiles.use-glm]
model = "glm-4.7"
model_provider = "glm"

[profiles.use-wenwen]
model = "gpt-5.2"
model_provider = "wenwen"

[profiles.use-ollama]
model = "deepseek-r1:8b"
model_provider = "ollama"


[notice]
hide_gpt5_1_migration_prompt = true

[features]
# enable_experimental_windows_sandbox = true  # 旧版
experimental_windows_sandbox = true
streamable_shell = true          # enable the streamable exec tool
web_search_request = true        # allow the model to request web searches

切换模型:

使用智谱的模型:

js 复制代码
codex --profile use-glm "你是谁"

使用问问的模型:

js 复制代码
codex --profile use-wenwen "你是谁"
相关推荐
编码生活禅意录4 小时前
一部手机开发安卓 App:让写代码和看效果都舒服起来
vibecoding
Hashan5 天前
Vibe Coding 下前后端怎么对接接口?后端不给力的兜底方案
前端·后端·vibecoding
哈基咪怎么可能是AI7 天前
dsh插件开发踩坑实录(写给正在build dsh插件的ai agent)
deepseek·vibecoding
vibecoding日记7 天前
dsh插件开发踩坑实录(写给正在build dsh插件的ai agent)
编程工具·ai助手·vibecoding
勤劳打代码7 天前
从 Demo 搭建的Flutter 演示项目 —— Forge
flutter·客户端·vibecoding
潘锦9 天前
使用 Vibe Coding 的这6 种后遗症,你有吗?
cto·vibecoding
kisshyshy9 天前
《从屎山到秩序:Vibe Coding 95 驾驭术全公开》
人工智能·代码规范·vibecoding
无责任此方_修行中9 天前
插件+1:MiaoMint —— 类 RayCast 的标签管理工具
前端·javascript·vibecoding
白雾茫茫丶9 天前
VibeCoding 一套 Admin 系统,五种技术栈实现
前端·ai编程·vibecoding
ClouGence9 天前
你 Vibe Coding 完的网站,不会直接上线了吧?
ai编程·测试·vibecoding