AI Explore.Source.Templates

One HTML document for Search, AI answers, and browser agents.

Switch to Simplified Chinese

本地大模型(Ollama / Qwen / Llama)对接 OpenCode 教程

  • 高森 模型产品
  • 齐岚 开发者体验

Published September 22, 2026

本地对接顺序:安装 Ollama(或 vLLM)→ 拉取许可允许的 Qwen / Llama 量化 → 确认 localhost 的 OpenAI 兼容接口能列出模型 → OpenCode 自定义供应商指向该地址 → 设为默认后再开写代码会话。7B/14B 适合补全和短重构,长代理仍可能不够。显存不够就降量化,不要强上 70B。商用看模型许可。更泛的“兼容网关”见 Atomic Chat 专页。

  • Ollama / vLLM 运行时
  • Qwen / Llama 权重
  • localhost 兼容口 接口

Windows 要注意 GPU 驱动与 WSL 路径,模型文件不要放同步盘。

怎么选权重#

  • 代码:看 Qwen-Coder 或同类代码微调。
  • 通用:Llama 指令档。
  • 上下文要长:看该量化是否真支持长窗。

要点#

  • 先列表接口,再写 OpenCode。
  • 按显存选量化。
  • 许可过了再商用。

Was this helpful?

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. Figures are original to this site.

Last updated 2026-09-22.