Browse Source

feat: add Kimi K2-0905 model to Chutes provider (#7701)

Co-authored-by: Roo Code <[email protected]>
roomote[bot] 4 months ago
parent
commit
2c8c140551
2 changed files with 32 additions and 0 deletions
  1. 10 0
      packages/types/src/providers/chutes.ts
  2. 22 0
      src/api/providers/__tests__/chutes.spec.ts

+ 10 - 0
packages/types/src/providers/chutes.ts

@@ -30,6 +30,7 @@ export type ChutesModelId =
 	| "zai-org/GLM-4.5-Air"
 	| "zai-org/GLM-4.5-FP8"
 	| "moonshotai/Kimi-K2-Instruct-75k"
+	| "moonshotai/Kimi-K2-Instruct-0905"
 	| "Qwen/Qwen3-235B-A22B-Thinking-2507"
 
 export const chutesDefaultModelId: ChutesModelId = "deepseek-ai/DeepSeek-R1-0528"
@@ -289,6 +290,15 @@ export const chutesModels = {
 		outputPrice: 0.5926,
 		description: "Moonshot AI Kimi K2 Instruct model with 75k context window.",
 	},
+	"moonshotai/Kimi-K2-Instruct-0905": {
+		maxTokens: 32768,
+		contextWindow: 262144,
+		supportsImages: false,
+		supportsPromptCache: false,
+		inputPrice: 0.1999,
+		outputPrice: 0.8001,
+		description: "Moonshot AI Kimi K2 Instruct 0905 model with 256k context window.",
+	},
 	"Qwen/Qwen3-235B-A22B-Thinking-2507": {
 		maxTokens: 32768,
 		contextWindow: 262144,

+ 22 - 0
src/api/providers/__tests__/chutes.spec.ts

@@ -297,6 +297,28 @@ describe("ChutesHandler", () => {
 		)
 	})
 
+	it("should return moonshotai/Kimi-K2-Instruct-0905 model with correct configuration", () => {
+		const testModelId: ChutesModelId = "moonshotai/Kimi-K2-Instruct-0905"
+		const handlerWithModel = new ChutesHandler({
+			apiModelId: testModelId,
+			chutesApiKey: "test-chutes-api-key",
+		})
+		const model = handlerWithModel.getModel()
+		expect(model.id).toBe(testModelId)
+		expect(model.info).toEqual(
+			expect.objectContaining({
+				maxTokens: 32768,
+				contextWindow: 262144,
+				supportsImages: false,
+				supportsPromptCache: false,
+				inputPrice: 0.1999,
+				outputPrice: 0.8001,
+				description: "Moonshot AI Kimi K2 Instruct 0905 model with 256k context window.",
+				temperature: 0.5, // Default temperature for non-DeepSeek models
+			}),
+		)
+	})
+
 	it("completePrompt method should return text from Chutes API", async () => {
 		const expectedResponse = "This is a test response from Chutes"
 		mockCreate.mockResolvedValueOnce({ choices: [{ message: { content: expectedResponse } }] })