MiMo-Code icon indicating copy to clipboard operation
MiMo-Code copied to clipboard

opencode go

Open Lr-m11 opened this issue 5 months ago • 10 comments

Question

目前是不支持接入 opencode go 吗?

Lr-m11 avatar Jun 11 '26 05:06 Lr-m11

可以用,url用”https://opencode.ai/zen/go/v1“

Nemocccc avatar Jun 11 '26 06:06 Nemocccc

不过有点玄学,切一下模型或者/exit在进入试试

Nemocccc avatar Jun 11 '26 06:06 Nemocccc

打算后面再试试看,配置以后model列表不显示;correct也找不到该供应商,deepseek倒是正常

Lr-m11 avatar Jun 11 '26 06:06 Lr-m11

供应商 id 不要写 opencode 或者包含 opencode 的字符串。可以写 oc,然后名字可以写 opencode。他这个过滤了 id 包含 opencode 的供应商。你可以直接打开配置文件把你添加的 opencode 供应商 id 给换掉。~/.config/mimocode/mimocode.jsonc

Lemonbx avatar Jun 11 '26 07:06 Lemonbx

刚刚检查代码看了下,mimo-free.ts 里,在加入 mimo免费模型后,会把opencode 和 opencode-go供应商加入disabled_providers。他的原意是为了屏蔽掉 opencode 里的免费模型,但是把付费供应商也给误杀了

Lemonbx avatar Jun 12 '26 10:06 Lemonbx

I want to try this, but how do I configure it? Can you share an example of the config block?

nisrulz avatar Jun 15 '26 16:06 nisrulz

I want to try this, but how do I configure it? Can you share an example of the config block?

在 mimocode.jsonc 的provider 块中,增加

"oc": {
      "name": "OpenCode GO",
      "npm": "@ai-sdk/openai-compatible",  //如果需要使用MiniMax/Qwen,则把 npm 的值改为 @ai-sdk/anthropic
      "options": {
        "baseURL": "https://opencode.ai/zen/go/v1",
        "apiKey":"<apikey>"
      },
      "models": {
        "kimi-k2.6": {
          "name": "Kimi K2.6"
        },
        "deepseek-v4-flash": {
          "name": "Deepseek V4 Flash"
        }
//若 npm 的值是@ai-sdk/openai-compatible,只能写支持chat/completions接口的opencode模型
//若 npm 的值是@ai-sdk/anthropic,则只能写/v1/messages接口的模型。
//可用模型可以参考文档:https://opencode.ai/docs/go/
      }
    }

Lemonbx avatar Jun 16 '26 01:06 Lemonbx

Thank you @Lemonbx 🚀

Translated version in English (for others like me 😅).:


In the provider block of mimocode.jsonc, add:

"oc": {
  "name": "OpenCode GO",
  "npm": "@ai-sdk/openai-compatible",  // If you need to use MiniMax/Qwen, change the npm value to @ai-sdk/anthropic
  "options": {
    "baseURL": "https://opencode.ai/zen/go/v1",
    "apiKey": "<apikey>"
  },
  "models": {
    "kimi-k2.6": {
      "name": "Kimi K2.6"
    },
    "deepseek-v4-flash": {
      "name": "Deepseek V4 Flash"
    }
    // If npm is @ai-sdk/openai-compatible, you can only list OpenCode models that support the chat/completions API.
    // If npm is @ai-sdk/anthropic, you can only list models that support the /v1/messages API.
    // Available models can be found in the documentation: https://opencode.ai/docs/go/
  }
}

nisrulz avatar Jun 16 '26 08:06 nisrulz

Why the OpenCode free and Go models disabled?

codxt avatar Jun 22 '26 20:06 codxt

这个问题在我的issue已经修复,https://github.com/XiaomiMiMo/MiMo-Code/issues/1216 有时候就得较真,你知道吧?

qitry avatar Jun 27 '26 08:06 qitry