Skip to content

Commit feb3386

Browse files
PierrunoYTampagent
andauthored
fix(opencode-go): add DeepSeek V4.1 Flash metadata (#1659)
* fix(opencode-go): add DeepSeek V4.1 Flash metadata Amp-Thread-ID: https://ampcode.com/threads/T-01a0aa02-b6de-7763-97b8-1650ea4b46da * fix(opencode-go): enable DeepSeek Flash vision * test(api): pin DeepSeek V4.1 metadata --------- Co-authored-by: Amp <amp@ampcode.com>
1 parent be2de34 commit feb3386

3 files changed

Lines changed: 45 additions & 0 deletions

File tree

‎packages/types/src/__tests__/opencode-go.test.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ describe("opencode-go registry", () => {
3333
"mimo-v2.5-pro",
3434
"deepseek-v4-pro",
3535
"deepseek-v4-flash",
36+
"deepseek-v4.1-flash",
3637
"omen-alpha",
3738
"grok-4.5",
3839
]
@@ -224,6 +225,19 @@ describe("opencode-go registry", () => {
224225
cacheReadsPrice: 0.19,
225226
},
226227
},
228+
{
229+
id: "deepseek-v4.1-flash",
230+
expected: {
231+
maxTokens: 384_000,
232+
contextWindow: 1_000_000,
233+
supportsImages: true,
234+
supportsPromptCache: true,
235+
supportsMaxTokens: true,
236+
inputPrice: 0.3,
237+
outputPrice: 1.2,
238+
cacheReadsPrice: 0.006,
239+
},
240+
},
227241
{
228242
id: "longcat-2.0",
229243
expected: {
@@ -444,6 +458,7 @@ describe("opencode-go registry", () => {
444458
it("DeepSeek entries expose supportsMaxTokens so the max-output slider is available", () => {
445459
expect(getOpencodeGoModelInfo("deepseek-v4-pro")?.supportsMaxTokens).toBe(true)
446460
expect(getOpencodeGoModelInfo("deepseek-v4-flash")?.supportsMaxTokens).toBe(true)
461+
expect(getOpencodeGoModelInfo("deepseek-v4.1-flash")?.supportsMaxTokens).toBe(true)
447462
})
448463
})
449464

‎packages/types/src/providers/opencode-go.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,22 @@ export const opencodeGoModels: Record<string, ModelInfo> = {
465465
description:
466466
"DeepSeek-V4-Flash is DeepSeek's fast, cost-efficient V4 model supporting thinking and non-thinking modes. Available via the Opencode Go plan.",
467467
},
468+
"deepseek-v4.1-flash": {
469+
maxTokens: 384_000,
470+
contextWindow: 1_000_000,
471+
supportsImages: true,
472+
supportsPromptCache: true,
473+
supportsMaxTokens: true,
474+
supportsReasoningEffort: ["disable", "low", "medium", "high", "xhigh"],
475+
preserveReasoning: true,
476+
reasoningEffort: "high",
477+
// Go has weekday peak/off-peak pricing; use peak rates until ModelInfo can express schedules.
478+
inputPrice: 0.3,
479+
outputPrice: 1.2,
480+
cacheReadsPrice: 0.006,
481+
description:
482+
"DeepSeek V4.1 Flash is a fast, cost-efficient reasoning model with a 1M context window. Available via the Opencode Go plan.",
483+
},
468484
"deepseek-v4-flash-vision-exp": {
469485
maxTokens: 384_000,
470486
contextWindow: 1_000_000,

‎src/api/providers/fetchers/__tests__/opencode-go.spec.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ describe("Opencode Go Fetchers", () => {
197197
"glm-5",
198198
"deepseek-v4-pro",
199199
"deepseek-v4-flash",
200+
"deepseek-v4.1-flash",
200201
"deepseek-v4-flash-vision-exp",
201202
"qwen3.7-max",
202203
"qwen3.8-max",
@@ -257,6 +258,19 @@ describe("Opencode Go Fetchers", () => {
257258
expect(info.supportsReasoningEffort).toEqual(["disable", "low", "medium", "high", "xhigh"])
258259
})
259260

261+
it("resolves DeepSeek V4.1 Flash to its 1M context when live metadata is absent", () => {
262+
const info = parseOpencodeGoModel({ id: "deepseek-v4.1-flash" })
263+
expect(info.contextWindow).toBe(1_000_000)
264+
expect(info.maxTokens).toBe(384_000)
265+
expect(info.supportsPromptCache).toBe(true)
266+
expect(info.supportsMaxTokens).toBe(true)
267+
expect(info.supportsReasoningEffort).toEqual(["disable", "low", "medium", "high", "xhigh"])
268+
expect(info.supportsImages).toBe(true)
269+
expect(info.inputPrice).toBe(0.3)
270+
expect(info.outputPrice).toBe(1.2)
271+
expect(info.cacheReadsPrice).toBe(0.006)
272+
})
273+
260274
it("resolves GLM-5.2 with its 1M context and High/Max reasoning effort", () => {
261275
const info = parseOpencodeGoModel({ id: "glm-5.2" })
262276
expect(info.contextWindow).toBe(1_000_000)

0 commit comments

Comments
 (0)