kimi: add low,high to k3 and remove k2p7 references

This commit is contained in:
David Brailovsky
2026-07-20 09:00:15 +00:00
parent 85f89db9bc
commit 8b93737078
16 changed files with 24 additions and 26 deletions
+2 -3
View File
@@ -245,9 +245,9 @@ const DEEPSEEK_V4_THINKING_LEVEL_MAP = {
const KIMI_K3_THINKING_LEVEL_MAP = {
off: null,
minimal: null,
low: null,
low: "low",
medium: null,
high: null,
high: "high",
xhigh: null,
max: "max",
} as const;
@@ -261,7 +261,6 @@ const KIMI_K3_COST = {
// Kimi Coding is subscription-backed, so models.dev reports zero cost. Use the
// equivalent Moonshot API rates to estimate the value of subscription usage.
const KIMI_CODING_IMPLIED_COSTS: Record<string, Model<Api>["cost"]> = {
k2p7: { input: 0.95, output: 4, cacheRead: 0.19, cacheWrite: 0 },
k3: KIMI_K3_COST,
"kimi-for-coding": { input: 0.95, output: 4, cacheRead: 0.19, cacheWrite: 0 },
"kimi-for-coding-highspeed": { input: 1.9, output: 8, cacheRead: 0.38, cacheWrite: 0 },
@@ -5,14 +5,14 @@ import values from "./data/kimi-coding.json" with { type: "json" };
import type { Model } from "../types.ts";
export const KIMI_CODING_MODELS = values as {
"k2p7": Model<"anthropic-messages"> & {
id: "k2p7";
provider: "kimi-coding";
};
"k3": Model<"anthropic-messages"> & {
id: "k3";
provider: "kimi-coding";
};
"kimi-for-coding": Model<"anthropic-messages"> & {
id: "kimi-for-coding";
provider: "kimi-coding";
};
"kimi-for-coding-highspeed": Model<"anthropic-messages"> & {
id: "kimi-for-coding-highspeed";
provider: "kimi-coding";
+1 -1
View File
@@ -250,7 +250,7 @@ describe("AI Providers Abort Tests", () => {
});
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider Abort", () => {
const llm = getModel("kimi-coding", "k2p7");
const llm = getModel("kimi-coding", "kimi-for-coding");
it("should abort mid-stream", { retry: 3 }, async () => {
await testAbortSignal(llm);
@@ -7,7 +7,7 @@ const EXPECTED_CURRENT_ADAPTIVE_THINKING_MODELS = [
"anthropic/claude-opus-4-8",
"anthropic/claude-sonnet-5",
"cloudflare-ai-gateway/claude-fable-5",
"kimi-coding/k2p7",
"kimi-coding/kimi-for-coding",
"kimi-coding/k3",
"kimi-coding/kimi-for-coding-highspeed",
"opencode/claude-opus-4-8",
@@ -90,7 +90,7 @@ describe("Anthropic forceAdaptiveThinking compat override", () => {
});
it.each([
["k2p7", "medium", "medium"],
["kimi-for-coding", "medium", "medium"],
["k3", "max", "max"],
["kimi-for-coding-highspeed", "medium", "medium"],
] as const)(
+2 -2
View File
@@ -471,8 +471,8 @@ describe("Context overflow error handling", () => {
// =============================================================================
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding", () => {
it("k2p7 - should detect overflow via isContextOverflow", async () => {
const model = getModel("kimi-coding", "k2p7");
it("kimi-for-coding - should detect overflow via isContextOverflow", async () => {
const model = getModel("kimi-coding", "kimi-for-coding");
const result = await testContextOverflow(model, process.env.KIMI_API_KEY!);
logResult(result);
@@ -109,7 +109,7 @@ const PROVIDER_MODEL_PAIRS: ProviderModelPair[] = [
// Together AI
{ provider: "together", model: "moonshotai/Kimi-K2.6", label: "together-kimi-k2.6" },
// Kimi For Coding
{ provider: "kimi-coding", model: "k2p7", label: "kimi-coding-k2p7" },
{ provider: "kimi-coding", model: "kimi-for-coding", label: "kimi-for-coding" },
// Mistral
{ provider: "mistral", model: "devstral-medium-latest", label: "mistral-devstral-medium" },
// MiniMax
+1 -1
View File
@@ -536,7 +536,7 @@ describe("AI Providers Empty Message Tests", () => {
);
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider Empty Messages", () => {
const llm = getModel("kimi-coding", "k2p7");
const llm = getModel("kimi-coding", "kimi-for-coding");
it("should handle empty content array", { retry: 3, timeout: 30000 }, async () => {
await testEmptyMessage(llm);
+2 -2
View File
@@ -381,8 +381,8 @@ describe("Tool Results with Images", () => {
},
);
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider (k2p7)", () => {
const llm = getModel("kimi-coding", "k2p7");
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider (kimi-for-coding)", () => {
const llm = getModel("kimi-coding", "kimi-for-coding");
it("should handle tool result with only image", { retry: 3, timeout: 30000 }, async () => {
await handleToolWithImageResult(llm);
-1
View File
@@ -59,7 +59,6 @@ describe("builtin providers", () => {
it("uses API-equivalent implied pricing for Kimi Coding subscription models", () => {
const models = builtinModels();
const expectedCosts = {
k2p7: { input: 0.95, output: 4, cacheRead: 0.19, cacheWrite: 0 },
k3: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 0 },
"kimi-for-coding-highspeed": { input: 1.9, output: 8, cacheRead: 0.38, cacheWrite: 0 },
};
+2 -2
View File
@@ -1017,8 +1017,8 @@ describe("Generate E2E Tests", () => {
});
});
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider (k2p7 via Anthropic Messages)", () => {
const llm = getModel("kimi-coding", "k2p7");
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider (kimi-for-coding via Anthropic Messages)", () => {
const llm = getModel("kimi-coding", "kimi-for-coding");
it("should complete basic text generation", { retry: 3 }, async () => {
await basicTextGeneration(llm);
+2 -2
View File
@@ -110,10 +110,10 @@ describe("getSupportedThinkingLevels", () => {
}
});
it("includes only max for Kimi Coding K3", () => {
it("includes only low, high, max for Kimi Coding K3", () => {
const model = getModel("kimi-coding", "k3");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toEqual(["max"]);
expect(getSupportedThinkingLevels(model!)).toEqual(["low", "high", "max"]);
});
it("includes only high for OpenCode Grok Build", () => {
+1 -1
View File
@@ -218,7 +218,7 @@ describe("Token Statistics on Abort", () => {
});
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider", () => {
const llm = getModel("kimi-coding", "k2p7");
const llm = getModel("kimi-coding", "kimi-for-coding");
it("should include token stats when aborted mid-stream", { retry: 3, timeout: 30000 }, async () => {
await testTokensOnAbort(llm);
@@ -255,7 +255,7 @@ describe("Tool Call Without Result Tests", () => {
});
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider", () => {
const model = getModel("kimi-coding", "k2p7");
const model = getModel("kimi-coding", "kimi-for-coding");
it("should filter out tool calls without corresponding tool results", { retry: 3, timeout: 30000 }, async () => {
await testToolCallWithoutResult(model);
+2 -2
View File
@@ -567,8 +567,8 @@ describe("totalTokens field", () => {
// =========================================================================
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding", () => {
it("k2p7 - should return totalTokens equal to sum of components", { retry: 3, timeout: 60000 }, async () => {
const llm = getModel("kimi-coding", "k2p7");
it("kimi-for-coding - should return totalTokens equal to sum of components", { retry: 3, timeout: 60000 }, async () => {
const llm = getModel("kimi-coding", "kimi-for-coding");
console.log(`\nKimi For Coding / ${llm.id}:`);
const { first, second } = await testTotalTokensWithCache(llm, { apiKey: process.env.KIMI_API_KEY });
+1 -1
View File
@@ -696,7 +696,7 @@ describe("AI Providers Unicode Surrogate Pair Tests", () => {
);
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider Unicode Handling", () => {
const llm = getModel("kimi-coding", "k2p7");
const llm = getModel("kimi-coding", "kimi-for-coding");
it("should handle emoji in tool results", { retry: 3, timeout: 30000 }, async () => {
await testEmojiInToolResults(llm);