Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion packages/ai/scripts/generate-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ const KIMI_K3_THINKING_LEVEL_MAP = {
xhigh: null,
max: "max",
} as const;
const KIMI_CODING_K3_THINKING_LEVEL_MAP = {
off: null,
minimal: null,
low: "low",
medium: null,
high: "high",
xhigh: null,
max: "max",
} as const;
const KIMI_K3_MAX_TOKENS = 131072;
const KIMI_K3_COST = {
input: 3,
Expand Down Expand Up @@ -1702,7 +1711,7 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
forceAdaptiveThinking: true,
},
reasoning: isKimiK3 || m.reasoning === true,
...(isKimiK3 ? { thinkingLevelMap: KIMI_K3_THINKING_LEVEL_MAP } : {}),
...(isKimiK3 ? { thinkingLevelMap: KIMI_CODING_K3_THINKING_LEVEL_MAP } : {}),
input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],
cost: {
input: m.cost?.input || impliedCost?.input || 0,
Expand Down
8 changes: 7 additions & 1 deletion packages/ai/test/supports-xhigh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,15 @@ describe("getSupportedThinkingLevels", () => {
}
});

it("includes only max for Kimi Coding K3", () => {
it("includes low, high, and max for Kimi Coding K3", () => {
const model = getModel("kimi-coding", "k3");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toEqual(["low", "high", "max"]);
});

it.each(["moonshotai", "moonshotai-cn"] as const)("includes only max for %s Kimi K3", (provider) => {
const model = getModel(provider, "kimi-k3");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toEqual(["max"]);
});

Expand Down
Loading