Skip to content

Commit 7f47ec3

Browse files
capitanfeederedelauna
authored andcommitted
Remove dead temperature param, add 2-tier pricing, clarify strict stripping
1 parent d958cf0 commit 7f47ec3

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

packages/types/src/providers/mimo.ts

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { ModelInfo } from "../model.js"
22

33
// https://developer.puter.com/ai/xiaomi/mimo-v2.5-pro/
44
// https://developer.puter.com/ai/xiaomi/mimo-v2.5/
5+
// https://platform.xiaomimimo.com/docs/en-US/quick-start/model-hyperparameters
56
//
67
// NOTE: mimo-v2-flash is not included here. Its thinking mode defaults to
78
// disabled and it doesn't reliably handle reasoning_content passthrough
@@ -21,9 +22,18 @@ export const mimoModels = {
2122
supportsPromptCache: false,
2223
preserveReasoning: true,
2324
inputPrice: 1.0, // $1.00/1M tokens (cache miss, ≤256K)
24-
outputPrice: 3.0, // $3.00/1M tokens
25-
cacheReadsPrice: 0.2, // $0.20/1M tokens (cache hit)
25+
outputPrice: 3.0, // $3.00/1M tokens (≤256K)
26+
cacheReadsPrice: 0.2, // $0.20/1M tokens (cache hit, ≤256K)
2627
cacheWritesPrice: 0, // Free for limited time
28+
// MiMo charges 2x for input >256K context
29+
tiers: [
30+
{
31+
contextWindow: 256_001,
32+
inputPrice: 2.0, // $2.00/1M tokens (>256K)
33+
outputPrice: 6.0, // $6.00/1M tokens (>256K)
34+
cacheReadsPrice: 0.4, // $0.40/1M tokens (>256K)
35+
},
36+
],
2737
description:
2838
"MiMo V2.5 Pro - Xiaomi's flagship reasoning model with 1M context, deep thinking, tool calling, and structured output.",
2939
},
@@ -34,9 +44,18 @@ export const mimoModels = {
3444
supportsPromptCache: false,
3545
preserveReasoning: true,
3646
inputPrice: 0.4, // $0.40/1M tokens (cache miss, ≤256K)
37-
outputPrice: 2.0, // $2.00/1M tokens
38-
cacheReadsPrice: 0.08, // $0.08/1M tokens (cache hit)
47+
outputPrice: 2.0, // $2.00/1M tokens (≤256K)
48+
cacheReadsPrice: 0.08, // $0.08/1M tokens (cache hit, ≤256K)
3949
cacheWritesPrice: 0, // Free for limited time
50+
// MiMo charges 2x for input >256K context
51+
tiers: [
52+
{
53+
contextWindow: 256_001,
54+
inputPrice: 0.8, // $0.80/1M tokens (>256K)
55+
outputPrice: 4.0, // $4.00/1M tokens (>256K)
56+
cacheReadsPrice: 0.16, // $0.16/1M tokens (>256K)
57+
},
58+
],
4059
description:
4160
"MiMo V2.5 - Full-modal understanding model (text, image, audio, video) with 1M context, deep thinking, tool calling, and structured output.",
4261
},

src/api/providers/mimo.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ export class MimoHandler extends OpenAiHandler {
5454
}
5555

5656
/**
57-
* Strip OpenAI-specific extensions that MiMo's proxy rejects:
58-
* - strict: true on tools
59-
* - additionalProperties: false on schemas
57+
* Strip OpenAI-specific extensions that MiMo's Token Plan proxy rejects.
58+
* The official API docs list `strict` as supported (default false), but the
59+
* proxy endpoints have historically returned 400 for it. Kept as a safety
60+
* net until the proxy is confirmed to handle these fields correctly.
6061
*/
6162
protected override convertToolsForOpenAI(tools: any[] | undefined): any[] | undefined {
6263
if (!tools) {
@@ -124,7 +125,7 @@ export class MimoHandler extends OpenAiHandler {
124125
messages: any[],
125126
metadata?: ApiHandlerCreateMessageMetadata,
126127
): ApiStream {
127-
const { id: modelId, info: modelInfo, temperature } = this.getModel()
128+
const { id: modelId, info: modelInfo } = this.getModel()
128129

129130
// Use shared R1-format conversion with tool ID sanitization and text merging
130131
const convertedMessages = convertToR1Format(messages, {
@@ -136,9 +137,10 @@ export class MimoHandler extends OpenAiHandler {
136137

137138
// Build request per MiMo's OpenAI-compatible API
138139
// https://developer.puter.com/ai/xiaomi/mimo-v2.5-pro/
140+
// Note: temperature is omitted because MiMo forces it to 1.0 when thinking mode
141+
// is enabled, regardless of what is passed (see model-hyperparameters docs).
139142
const params: Record<string, any> = {
140143
model: modelId,
141-
temperature,
142144
messages: [{ role: "system", content: systemPrompt }, ...convertedMessages],
143145
stream: true,
144146
stream_options: { include_usage: true },

0 commit comments

Comments
 (0)