Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ describe("provider identifiers", () => {
providerIdentifiers.poe,
providerIdentifiers.deepseek,
providerIdentifiers.moonshot,
providerIdentifiers.mimo,
providerIdentifiers.opencodeGo,
providerIdentifiers.kenari,
providerIdentifiers.nanogpt,
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/provider-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const dynamicProviders = [
providerIdentifiers.poe,
providerIdentifiers.deepseek,
providerIdentifiers.moonshot,
providerIdentifiers.mimo,
providerIdentifiers.opencodeGo,
providerIdentifiers.kenari,
providerIdentifiers.nanogpt,
Expand Down
81 changes: 55 additions & 26 deletions packages/types/src/providers/mimo.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import type { ModelInfo } from "../model.js"

// https://developer.puter.com/ai/xiaomi/mimo-v2.5-pro/
// https://developer.puter.com/ai/xiaomi/mimo-v2.5/
// https://platform.xiaomimimo.com/docs/en-US/quick-start/model-hyperparameters
// https://mimo.mi.com/docs/en-US/quick-start/model-hyperparameters
// https://mimo.mi.com/docs/en-US/quick-start/usage-guide/text-generation/deep-thinking
// https://mimo.mi.com/docs/en-US/price/pay-as-you-go
//
// mimo-v2.5-pro and mimo-v2.5 are deprecated on 2026-10-21 10:00 (GMT+8) and
// their model names will stop working. They stay in the catalog as a fallback
// until the EOL date passes; mimo-v2.6-* entries carry the V2.6 series.
//
// NOTE: mimo-v2-flash is not included here. Its thinking mode defaults to
// disabled and it doesn't reliably handle reasoning_content passthrough
Expand All @@ -12,48 +16,73 @@ import type { ModelInfo } from "../model.js"
// an agentic provider, and flash just can't do that yet.
export type MimoModelId = keyof typeof mimoModels

export const mimoDefaultModelId: MimoModelId = "mimo-v2.5-pro"
export const mimoDefaultModelId: MimoModelId = "mimo-v2.6-pro"

export const mimoModels = {
"mimo-v2.6-pro": {
maxTokens: 131_072,
contextWindow: 1_048_576,
supportsImages: true, // V2.6 series is full-modality (text, image, audio, video)
supportsPromptCache: false,
preserveReasoning: true,
inputPrice: 0.435, // $0.435/1M tokens (cache miss)
outputPrice: 0.87, // $0.87/1M tokens
cacheReadsPrice: 0.0036, // $0.0036/1M tokens (cache hit)
cacheWritesPrice: 0, // Free for limited time
description:
"MiMo V2.6 Pro - Xiaomi's flagship omni-modal reasoning model with 1M context, deep thinking, tool calling, and structured output.",
},
"mimo-v2.6-flash": {
maxTokens: 131_072,
contextWindow: 1_048_576,
supportsImages: true, // Full-modality: text, image, audio, video input
supportsPromptCache: false,
preserveReasoning: true,
inputPrice: 0.14, // $0.14/1M tokens (cache miss)
outputPrice: 0.28, // $0.28/1M tokens
cacheReadsPrice: 0.0028, // $0.0028/1M tokens (cache hit)
cacheWritesPrice: 0, // Free for limited time
description:
"MiMo V2.6 Flash - Full-modality, low-cost reasoning model for high-frequency calls and large-scale tasks.",
},
"mimo-v2.6-pro-ultraspeed": {
maxTokens: 131_072,
contextWindow: 1_048_576,
supportsImages: true, // Full-modality like the rest of the V2.6 series
supportsPromptCache: false,
preserveReasoning: true,
inputPrice: 4.35, // $4.35/1M tokens (cache miss)
outputPrice: 8.7, // $8.70/1M tokens
cacheReadsPrice: 0.036, // $0.036/1M tokens (cache hit)
cacheWritesPrice: 0, // Free for limited time
description:
"MiMo V2.6 Pro Ultraspeed - V2.6-Pro performance at up to 20x speed for real-time, latency-sensitive workloads.",
},
"mimo-v2.5-pro": {
maxTokens: 131_072,
contextWindow: 1_048_576,
supportsImages: false, // Pro series is text-only
supportsPromptCache: false,
preserveReasoning: true,
inputPrice: 1.0, // $1.00/1M tokens (cache miss, ≤256K)
outputPrice: 3.0, // $3.00/1M tokens (≤256K)
cacheReadsPrice: 0.2, // $0.20/1M tokens (cache hit, ≤256K)
inputPrice: 0.435, // $0.435/1M tokens (cache miss)
outputPrice: 0.87, // $0.87/1M tokens
cacheReadsPrice: 0.0036, // $0.0036/1M tokens (cache hit)
cacheWritesPrice: 0, // Free for limited time
// MiMo charges 2x above 256K context
longContextPricing: {
thresholdTokens: 256_000,
inputPriceMultiplier: 2,
outputPriceMultiplier: 2,
cacheReadsPriceMultiplier: 2,
},
description:
"MiMo V2.5 Pro - Xiaomi's flagship reasoning model with 1M context, deep thinking, tool calling, and structured output.",
"MiMo V2.5 Pro - Deprecated on 2026-10-21. Xiaomi's flagship reasoning model with 1M context, deep thinking, tool calling, and structured output.",
},
"mimo-v2.5": {
maxTokens: 131_072,
contextWindow: 1_048_576,
supportsImages: true, // Full-modal: text, image, audio, video input
supportsPromptCache: false,
preserveReasoning: true,
inputPrice: 0.4, // $0.40/1M tokens (cache miss, ≤256K)
outputPrice: 2.0, // $2.00/1M tokens (≤256K)
cacheReadsPrice: 0.08, // $0.08/1M tokens (cache hit, ≤256K)
inputPrice: 0.14, // $0.14/1M tokens (cache miss)
outputPrice: 0.28, // $0.28/1M tokens
cacheReadsPrice: 0.0028, // $0.0028/1M tokens (cache hit)
cacheWritesPrice: 0, // Free for limited time
// MiMo charges 2x above 256K context
longContextPricing: {
thresholdTokens: 256_000,
inputPriceMultiplier: 2,
outputPriceMultiplier: 2,
cacheReadsPriceMultiplier: 2,
},
description:
"MiMo V2.5 - Full-modal understanding model (text, image, audio, video) with 1M context, deep thinking, tool calling, and structured output.",
"MiMo V2.5 - Deprecated on 2026-10-21. Full-modal understanding model (text, image, audio, video) with 1M context, deep thinking, tool calling, and structured output.",
},
} as const satisfies Record<string, ModelInfo>

Expand Down
45 changes: 40 additions & 5 deletions src/api/providers/__tests__/mimo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,58 @@ describe("MimoHandler", () => {
expect(model.id).toBe("mimo-v2.5-pro")
expect(model.info.contextWindow).toBe(1_048_576)
expect(model.info.maxTokens).toBe(131_072)
expect(model.info.inputPrice).toBe(1.0)
expect(model.info.outputPrice).toBe(3.0)
expect(model.info.inputPrice).toBe(0.435)
expect(model.info.outputPrice).toBe(0.87)
})

it("should return correct model info for mimo-v2.5", () => {
const h = new MimoHandler({ ...mockOptions, apiModelId: "mimo-v2.5" })
const model = h.getModel()
expect(model.id).toBe("mimo-v2.5")
expect(model.info.inputPrice).toBe(0.4)
expect(model.info.outputPrice).toBe(2.0)
expect(model.info.inputPrice).toBe(0.14)
expect(model.info.outputPrice).toBe(0.28)
})

it("should return correct model info for mimo-v2.6-pro", () => {
const h = new MimoHandler({ ...mockOptions, apiModelId: "mimo-v2.6-pro" })
const model = h.getModel()
expect(model.id).toBe("mimo-v2.6-pro")
expect(model.info.contextWindow).toBe(1_048_576)
expect(model.info.maxTokens).toBe(131_072)
expect(model.info.inputPrice).toBe(0.435)
expect(model.info.outputPrice).toBe(0.87)
expect(model.info.cacheReadsPrice).toBe(0.0036)
})

it("should return correct model info for mimo-v2.6-flash", () => {
const h = new MimoHandler({ ...mockOptions, apiModelId: "mimo-v2.6-flash" })
const model = h.getModel()
expect(model.id).toBe("mimo-v2.6-flash")
expect(model.info.supportsImages).toBe(true)
expect(model.info.inputPrice).toBe(0.14)
expect(model.info.outputPrice).toBe(0.28)
})

it("should return correct model info for mimo-v2.6-pro-ultraspeed", () => {
const h = new MimoHandler({ ...mockOptions, apiModelId: "mimo-v2.6-pro-ultraspeed" })
const model = h.getModel()
expect(model.id).toBe("mimo-v2.6-pro-ultraspeed")
expect(model.info.inputPrice).toBe(4.35)
expect(model.info.outputPrice).toBe(8.7)
})

it("should default to mimo-v2.6-pro", () => {
const h = new MimoHandler({ ...mockOptions, apiModelId: undefined })
const model = h.getModel()
expect(model.id).toBe(mimoDefaultModelId)
expect(model.info).toBe(mimoModels["mimo-v2.6-pro"])
})

it("should fallback to default model for unknown model ID", () => {
const h = new MimoHandler({ ...mockOptions, apiModelId: "unknown-model" })
const model = h.getModel()
expect(model.id).toBe("unknown-model")
expect(model.info).toBe(mimoModels["mimo-v2.5-pro"])
expect(model.info).toBe(mimoModels[mimoDefaultModelId])
})
})

Expand Down
Loading
Loading