Repository navigation
Replies: 2 comments
|
wow thank you for answering me at the night time.And btw I wanna know whether language you prefer
| |
徐诺
|
|
***@***.***
|
…---- 回复的原邮件 ----
| 发件人 | Prithwish ***@***.***> |
| 日期 | 2026年10月16日 01:38 |
| 收件人 | ***@***.***> |
| 抄送至 | ***@***.***>***@***.***> |
| 主题 | Re: [deepseek-ai/deepseek-harness] [Bug/Feature][llm-pi-ai] 自定义路由无法使用 google-generative-ai,OpenCode Go 的 Gemini 4 Argon Contributor 完全不可用 (Discussion #9752) |
I think supporting the native Google protocol would be a useful addition, especially since the underlying library already seems to support it.
One thing I'd be careful about is how configuration errors are handled. If one custom model has an unsupported API type, it shouldn't make every other provider disappear too.
Maybe each route could be validated independently, with a clear error for the one that failed. That would make debugging config files much easier.
I'd also like to see a test with a normal OpenAI-compatible route and a Google-protocol route in the same config. That would help confirm that adding support for another API doesn't accidentally break the existing providers.
Allowing a model to specify its API type and base URL sounds useful too, as long as the configuration is validated and the right authentication and streaming behavior are used for that protocol.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
0 replies
|
Oh noop I found it in my mail and thought you are a developer of dsh()-_-
| |
徐诺
|
|
***@***.***
|
…---- 回复的原邮件 ----
| 发件人 | Prithwish ***@***.***> |
| 日期 | 2026年10月16日 01:38 |
| 收件人 | ***@***.***> |
| 抄送至 | ***@***.***>***@***.***> |
| 主题 | Re: [deepseek-ai/deepseek-harness] [Bug/Feature][llm-pi-ai] 自定义路由无法使用 google-generative-ai,OpenCode Go 的 Gemini 4 Argon Contributor 完全不可用 (Discussion #9752) |
I think supporting the native Google protocol would be a useful addition, especially since the underlying library already seems to support it.
One thing I'd be careful about is how configuration errors are handled. If one custom model has an unsupported API type, it shouldn't make every other provider disappear too.
Maybe each route could be validated independently, with a clear error for the one that failed. That would make debugging config files much easier.
I'd also like to see a test with a normal OpenAI-compatible route and a Google-protocol route in the same config. That would help confirm that adding support for another API doesn't accidentally break the existing providers.
Allowing a model to specify its API type and base URL sounds useful too, as long as the configuration is validated and the right authentication and streaming behavior are used for that protocol.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
[Bug/Feature][llm-pi-ai] 自定义路由无法使用 google-generative-ai,导致 OpenCode Go 的 Gemini 4 Argon Contributor 在 DSH 中完全不可用
TL;DR (EN).
llm-pi-ai's config layer accepts only three wire protocols (openai-completions/openai-responses/anthropic-messages). Google'sgoogle-generative-aiis already implemented in the bundled pi-ai (the shipped Zen route wrapsgoogleGenerativeAIApi()), but a user-declared route may not name it, model-levelapi/baseURLare ignored byresolveRouteModels, and declaring it on a new route makes the entirellm-pi-aiprovider set disappear. Result: a model that speaks only the Google protocol — OpenCode Go'sgemini-4-argon-contributor— cannot be used from DSH at all, even though the same model answers HTTP 200 with a direct API call.TL;DR (中文). OpenCode Go 的 Gemini 4 Argon Contributor 实测可用(直连它只认 Google 协议),但 DSH 的
llm-pi-ai配置层只允许三种协议,且不接受用户声明google-generative-ai;手写路由还会让整组提供方一起失效。请求:把该协议开放给自定义路由(pi-ai 里已有实现),或允许在模型条目上声明api/baseURL。环境
resources/app-update.yml:provider: generic/url: https://download.deepseek.com/dsh-desk/feeds/win-x64//channel: nightly"generatedAt":"2026-09-22T19:31:44.346Z"(schemaVersion: 3)desktop;配置:$DSH_HOME/profiles/desktop/cordis.patch.yml→llm-pi-ai.config.providersopencode-go(OpenCode Go 订阅,密钥经apiKeyEnv: OPENCODE_API_KEY解析)目标模型(OpenCode Go 官方文档 https://opencode.ai/docs/go/)
gemini-4-argon-contributorhttps://opencode.ai/inference/go/v1/models/gemini-4-argon-contributor@ai-sdk/google(Google 原生协议)实测(2026-10-15,直连 OpenCode Go,密钥取自本机 OpenCode 凭据)
(1)模型确实在账号的 Go 套餐里 —— 两种 API 主机都返回 200 且列表含它:
(2)Google 协议调用正常,
x-goog-api-key与Authorization: Bearer都可用:(3)流式同样正常:
(4)但该模型只讲 Google 协议,其余三种协议在网关上全部被拒(分别用
Authorization: Bearer/x-api-key+anthropic-version试过):POST /inference/go/v1/chat/completions(OpenAI){"type":"error","error":{"type":"ModelProtocolUnsupported","message":"Model does not support this protocol."}}POST /zen/go/v1/chat/completions(OpenAI,对照组kimi-k3正常返回)POST /inference/go/v1/messages(Anthropic)POST /zen/go/v1/messages(Anthropic)model: gemini-4-argon(Zen 按量付费 id){"error":{"type":"server_error","message":"Upstream request failed: Model is unavailable."}}(顺带:
/zen/go/v1/models/<id>:generateContent这类路径会返回官网 SPA 的 HTML —— 只有/inference/go/v1是 Google 协议的 API 路由。)复现
尝试 A:把模型追加到内置
opencode-go路由,并在条目上声明协议结果:设置 → 模型 页报错(原文)
该模型能在设置页
opencode-go卡片里看到,但聊天侧模型选择器里不出现。按提示去设路由级api会把整条跨三种协议的opencode-go一起带偏,不可行。尝试 B:照
opencode-haiku的写法手写一条新路由(路由级api)结果:整组
llm-pi-ai提供方一起失效 ——openrouter、opencode-go、opencode的模型全部从选择器消失,运行中的会话回落到官方账号的deepseek-flash;删掉这段后全部恢复。推测是该路由的api未通过supportedProtocols()的 zod 校验,导致整个 profile 配置被拒,而不是只跳过这一条路由。根因(nightly 包内代码定位)
配置层只认三种协议:
路由级
api用该列表做 schema 校验:api: z.union(supportedProtocols())(860423)→google-generative-ai属非法值。运行时第二道门:
const factory = spec.api === void 0 ? void 0 : PROTOCOLS[spec.api];(860300),未命中即抛模型条目上的
api/baseURL不参与解析,resolveRouteModels只有路由级回退链:→ 目录里没有该模型(
base为 undefined)+opencode-go跨三种协议(routeApi为 undefined)+ 模型级api不读 ⇒ 必然报 "needs an api"。这也解释了「设置页能看到、选择器看不到」。另有一份
const LISTABLE_PROTOCOLS = new Set([ "anthropic-messages", "openai-completions" ])(861543),看起来决定哪些协议下的模型可被列出;openai-responses系的模型(grok-4.6/grok-4.7/muse-spark-1.2/1.3-contributor)若同样在设置页可见却不进选择器,可能同源。能力不存在缺口:pi-ai 已实现该协议,随包的 Zen 路由正是用它跑 Gemini 3.x:
缺的只是配置层把它开放给用户自定义路由(外加
PROTOCOLS/LISTABLE_PROTOCOLS两处名单)。期望(任选其一即可解锁这一类模型)
google-generative-ai加入PROTOCOLS(pi-ai 内实现随包可用),使手写路由能声明它;api/baseURL(models[]/modelOverrides),这样目录外的单个模型可以直接挂到既有路由上,无需新开路由;api只拒绝该条路由并给出可读错误 —— 目前表现为整组提供方一起消失,用户只看到模型凭空没了。临时绕过(供其他用户参考)
api: openai-completions+baseURL: http://127.0.0.1:<port>/v1,桥把 OpenAIchat/completions翻成 Google:streamGenerateContent?alt=sse(带上x-goog-api-key或Authorization: Bearer,以及x-opencode-session),再把 Google SSE 翻回 OpenAI SSE;All reactions