GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(core): wire Ark provider into aisdk-native and variant system by drpr · Pull Request #63482 · anomalyco/opencode Conversation
|
| baseURL: "https://ark.ap-southeast.bytepluses.com/api/v3", | ||
| env: ["BYTEPLUS_API_KEY"], | ||
| }, | ||
| // MiniMax |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
From here down, the plugin covers providers that have nothing to do with Ark: MiniMax, DeepSeek, Groq, Fireworks, SiliconFlow, Moonshot, Zhipu, Novita, Perplexity, Mistral, NVIDIA and Cerebras. When any of their keys is set, the transform calls evt.add, which replaces that provider's whole models.dev model list with whatever GET /models returns. Catalog models that the endpoint doesn't list disappear. Anything the endpoint does list (Groq's Whisper, TTS and guard models, Ark's embedding, image and video models) shows up as a chat model. This is the generic discovery plugin that #63480 said would be discussed separately. Could it be limited to the Ark IDs, or left out of this PR?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| cost: previous ? previous.cost : [{ input: Money.USDPerMillionTokens.zero, output: Money.USDPerMillionTokens.zero, cache: { read: Money.USDPerMillionTokens.zero, write: Money.USDPerMillionTokens.zero } }], | ||
| status: previous?.status ?? "active", | ||
| enabled: previous?.enabled ?? true, | ||
| limit: previous?.limit ?? { context: 0, output: 0 }, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
A model returned by /models that has no catalog template is added with limit: { context: 0, output: 0 }, zero cost, tools: true and text-only input. A zero context limit will likely break compaction and context accounting, and it will mislead users about cost. A missing template would be better skipped, or at least given defaults that aren't zero.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ["@opencode/ai/providers/azure/messages", () => import("@opencode/ai/providers/azure/messages")], | ||
| ["@opencode/ai/providers/baseten", () => import("@opencode/ai/providers/baseten")], | ||
| ["@opencode/ai/providers/baseten/decisions", () => import("@opencode/ai/providers/baseten/decisions")], | ||
| ["@opencode/ai/providers/ark", () => import("@opencode/ai/providers/ark")], |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@opencode/ai/providers/ark doesn't exist on this branch or on dev, so tsc -b in packages/core fails here with TS2307. This needs #63481 to land first, or the two PRs need to land together.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Register the Ark provider in the core wiring: - aisdk-native.ts: map Ark provider IDs to the AI SDK - ark/models.ts: Ark model definitions - plugin/provider/ark.ts: Ark provider plugin (config, fetch, models) - variant.ts: Ark variant handling - provider.ts: export the Ark provider - ui: BytePlus provider icon and sprite entry
Per review feedback on anomalyco#63482, the generic GET /models discovery plugin (plugin/provider/ark.ts) and its model template helper (ark/models.ts) are out of scope for this PR — they affect 13 providers beyond Ark and should be proposed separately per issue anomalyco#63480. Remove: - plugin/provider/ark.ts: the generic OpenAI-compatible discovery plugin - ark/models.ts: the OpenAICompatibleModels merge helper - plugin/provider.ts: the ArkPlugin import and registration Keep: - aisdk-native.ts: Ark provider ID mappings (volcengine, byteplus, etc.) - variant.ts: Ark variant handling - provider.ts: builtin import for @opencode/ai/providers/ark - ui: BytePlus provider icon and sprite entry
e746ca1 to
c574989
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The new commits address all three earlier points: the generic discovery plugin and ark/models.ts are gone, and @opencode/ai/providers/ark now resolves. tsc -b in packages/core passes, as do the new Ark provider tests (5) and the variant and aisdk-native tests (40). I couldn't send real requests to Ark without credentials.
Public API: this adds the @opencode/ai/providers/ark export and the Ark namespace in @opencode/ai, plus a new byteplus provider icon. volcengine and volcengine-coding-plan models from models.dev are now routed through the Ark package instead of plain openai-compatible, so the request shape gains Ark's thinking switch. It's backwards compatible: nothing existing is removed.
One thing to settle: this branch now contains the #63481 commit as well, so the two PRs overlap. Whichever merges first, the other will need to be rebased or closed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
feat: add BytePlus/Volcengine Ark provider support
There was an error while loading. Please reload this page.