Skip to content

Commit b7f77c7

Browse files
committed
feat: Add Kimi K2 0905 model to Groq, Moonshot, and Fireworks providers
- Added Kimi K2 0905 model with 256K context window - Updated default models to use the new version - Added prompt caching support where applicable - Updated tests to reflect new model configurations
1 parent 282a75b commit b7f77c7

File tree

4 files changed

+35
-11
lines changed

4 files changed

+35
-11
lines changed

packages/types/src/providers/fireworks.ts

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

33
export type FireworksModelId =
44
| "accounts/fireworks/models/kimi-k2-instruct"
5+
| "accounts/fireworks/models/kimi-k2-instruct-0905"
56
| "accounts/fireworks/models/qwen3-235b-a22b-instruct-2507"
67
| "accounts/fireworks/models/qwen3-coder-480b-a35b-instruct"
78
| "accounts/fireworks/models/deepseek-r1-0528"
@@ -12,9 +13,20 @@ export type FireworksModelId =
1213
| "accounts/fireworks/models/gpt-oss-20b"
1314
| "accounts/fireworks/models/gpt-oss-120b"
1415

15-
export const fireworksDefaultModelId: FireworksModelId = "accounts/fireworks/models/kimi-k2-instruct"
16+
export const fireworksDefaultModelId: FireworksModelId = "accounts/fireworks/models/kimi-k2-instruct-0905"
1617

1718
export const fireworksModels = {
19+
"accounts/fireworks/models/kimi-k2-instruct-0905": {
20+
maxTokens: 16384,
21+
contextWindow: 262144,
22+
supportsImages: false,
23+
supportsPromptCache: true,
24+
inputPrice: 0.6,
25+
outputPrice: 2.5,
26+
cacheReadsPrice: 0.15,
27+
description:
28+
"Kimi K2 model gets a new version update: Agentic coding: more accurate, better generalization across scaffolds. Frontend coding: improved aesthetics and functionalities on web, 3d, and other tasks. Context length: extended from 128k to 256k, providing better long-horizon support.",
29+
},
1830
"accounts/fireworks/models/kimi-k2-instruct": {
1931
maxTokens: 16384,
2032
contextWindow: 128000,

packages/types/src/providers/groq.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ export type GroqModelId =
1111
| "qwen/qwen3-32b"
1212
| "deepseek-r1-distill-llama-70b"
1313
| "moonshotai/kimi-k2-instruct"
14+
| "moonshotai/kimi-k2-instruct-0905"
1415
| "openai/gpt-oss-120b"
1516
| "openai/gpt-oss-20b"
1617

17-
export const groqDefaultModelId: GroqModelId = "llama-3.3-70b-versatile" // Defaulting to Llama3 70B Versatile
18+
export const groqDefaultModelId: GroqModelId = "moonshotai/kimi-k2-instruct-0905"
1819

1920
export const groqModels = {
2021
// Models based on API response: https://api.groq.com/openai/v1/models
@@ -100,6 +101,17 @@ export const groqModels = {
100101
cacheReadsPrice: 0.5, // 50% discount for cached input tokens
101102
description: "Moonshot AI Kimi K2 Instruct 1T model, 128K context.",
102103
},
104+
"moonshotai/kimi-k2-instruct-0905": {
105+
maxTokens: 16384,
106+
contextWindow: 262144,
107+
supportsImages: false,
108+
supportsPromptCache: true,
109+
inputPrice: 0.6,
110+
outputPrice: 2.5,
111+
cacheReadsPrice: 0.15,
112+
description:
113+
"Kimi K2 model gets a new version update: Agentic coding: more accurate, better generalization across scaffolds. Frontend coding: improved aesthetics and functionalities on web, 3d, and other tasks. Context length: extended from 128k to 256k, providing better long-horizon support.",
114+
},
103115
"openai/gpt-oss-120b": {
104116
maxTokens: 32766,
105117
contextWindow: 131072,

packages/types/src/providers/moonshot.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ export const moonshotModels = {
1818
description: `Kimi K2 is a state-of-the-art mixture-of-experts (MoE) language model with 32 billion activated parameters and 1 trillion total parameters.`,
1919
},
2020
"kimi-k2-0905-preview": {
21-
maxTokens: 32_000,
22-
contextWindow: 262_144,
21+
maxTokens: 16384,
22+
contextWindow: 262144,
2323
supportsImages: false,
2424
supportsPromptCache: true,
25-
inputPrice: 0.6, // $0.60 per million tokens (cache miss)
26-
outputPrice: 2.5, // $2.50 per million tokens
27-
cacheWritesPrice: 0, // $0 per million tokens (cache miss)
28-
cacheReadsPrice: 0.15, // $0.15 per million tokens (cache hit)
29-
description: `Kimi K2 is a state-of-the-art mixture-of-experts (MoE) language model with 32 billion activated parameters and 1 trillion total parameters.`,
25+
inputPrice: 0.6,
26+
outputPrice: 2.5,
27+
cacheReadsPrice: 0.15,
28+
description:
29+
"Kimi K2 model gets a new version update: Agentic coding: more accurate, better generalization across scaffolds. Frontend coding: improved aesthetics and functionalities on web, 3d, and other tasks. Context length: extended from 128k to 256k, providing better long-horizon support.",
3030
},
3131
"kimi-k2-turbo-preview": {
3232
maxTokens: 32_000,

src/api/providers/__tests__/moonshot.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ describe("MoonshotHandler", () => {
148148
const model = handler.getModel()
149149
expect(model.id).toBe(mockOptions.apiModelId)
150150
expect(model.info).toBeDefined()
151-
expect(model.info.maxTokens).toBe(32_000)
152-
expect(model.info.contextWindow).toBe(262_144)
151+
expect(model.info.maxTokens).toBe(16384)
152+
expect(model.info.contextWindow).toBe(262144)
153153
expect(model.info.supportsImages).toBe(false)
154154
expect(model.info.supportsPromptCache).toBe(true) // Should be true now
155155
})

0 commit comments

Comments
 (0)