ARTICLE · INTELLIGENCE

战地情报 · 详情页

来自尧图项目组的一线实战观察与深度解析

opencode调用本地模型一

opencode调用本地模型一 在备安装机器本地文件夹安装目录opencode下新建有config配置目录、workspace工作目录config目录下的配置文件opencode.json内容如下因为本地安装有千问模型固配置千问模型{ $schema: https://opencode.ai/config.json, provider: { ollama: { npm: ai-sdk/openai-compatible, name: Ollama (192.168.11.136), options: { baseURL: http://192.168.11.136:11434/v1 }, models: { qwen3-vl:32b: { name: Qwen3-VL 32B, tool_call: true, attachment: true, temperature: true, limit: { context: 65536, output: 40960 } }, qwen3.5:9b: { name: Qwen3.5 9B, tool_call: true, attachment: true, temperature: true, limit: { context: 65536, output: 40960 } }, qwen3-vl:8b: { name: Qwen3-VL 8B, tool_call: true, attachment: true, temperature: true, limit: { context: 65536, output: 40960 } }, deepseek-r1:8b: { name: DeepSeek R1 8B, tool_call: true, attachment: true, temperature: true, limit: { context: 65536, output: 40960 } } } } }, model: ollama/qwen3-vl:32b }因国内网络问题直接下周可能会很慢于是在docker容器添加源https://docker.xuanyuan.me, https://docker.1ms.run, https://docker.m.daocloud.io, https://registry-1.docker.io运行容器docker run -d --name opencode --restart unless-stopped -e TZAsia/Shanghai -p 4096:4096 -v E:\vm\opencode\config:/home/opencode/.config/opencode -v E:\vm\opencode\workspace:/home/opencode/workspace -w /home/opencode/workspace sprisa/opencode:latest进入 TUI操作界面docker exec -it opencode opencode运行部署后容器内找不到ollama安装的本地模型/models找不到容器模型原因是没有正确加载到本地模型重新调整配置文件后重启后TUI界面如下
RELATED READING

延伸阅读

更多一线实战笔记与深度复盘,助您持续精进