文档
中文文档
模型

模型

OpenCode 通过 AI SDK 和 Models.dev 集成 75+ 个 LLM Provider

选择模型

在界面中使用 /models 命令。

推荐模型

  • GPT 5.2
  • GPT 5.1 Codex
  • Claude Opus 4.5
  • Claude Sonnet 4.5
  • Minimax M2.1
  • Gemini 3 Pro

设置默认模型

{
  "model": "lmstudio/google/gemma-3n-e4b"
}

格式:provider_id/model_id

全局模型配置

{
  "provider": {
    "openai": {
      "models": {
        "gpt-5": {
          "options": {
            "reasoningEffort": "high"
          }
        }
      }
    }
  }
}

变体

内置变体

  • Anthropichigh(默认)、max
  • OpenAInoneminimallowmediumhighxhigh
  • Googlelowhigh

自定义变体

{
  "provider": {
    "openai": {
      "models": {
        "gpt-5": {
          "variants": {
            "thinking": {
              "reasoningEffort": "high"
            }
          }
        }
      }
    }
  }
}

模型加载优先级

  1. 命令行参数(--model
  2. 配置文件 model 设置
  3. 上次使用的模型
  4. 按优先级的第一个模型