Przeglądaj źródła

feat: add zai-org/GLM-4.5-turbo model to Chutes provider (#8157)

Co-authored-by: Roo Code <[email protected]>
roomote[bot] 3 miesięcy temu
rodzic
commit
382ab63ea1

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

@@ -29,6 +29,7 @@ export type ChutesModelId =
 	| "tngtech/DeepSeek-R1T-Chimera"
 	| "tngtech/DeepSeek-R1T-Chimera"
 	| "zai-org/GLM-4.5-Air"
 	| "zai-org/GLM-4.5-Air"
 	| "zai-org/GLM-4.5-FP8"
 	| "zai-org/GLM-4.5-FP8"
+	| "zai-org/GLM-4.5-turbo"
 	| "moonshotai/Kimi-K2-Instruct-75k"
 	| "moonshotai/Kimi-K2-Instruct-75k"
 	| "moonshotai/Kimi-K2-Instruct-0905"
 	| "moonshotai/Kimi-K2-Instruct-0905"
 	| "Qwen/Qwen3-235B-A22B-Thinking-2507"
 	| "Qwen/Qwen3-235B-A22B-Thinking-2507"
@@ -274,6 +275,15 @@ export const chutesModels = {
 		description:
 		description:
 			"GLM-4.5-FP8 model with 128k token context window, optimized for agent-based applications with MoE architecture.",
 			"GLM-4.5-FP8 model with 128k token context window, optimized for agent-based applications with MoE architecture.",
 	},
 	},
+	"zai-org/GLM-4.5-turbo": {
+		maxTokens: 32768,
+		contextWindow: 131072,
+		supportsImages: false,
+		supportsPromptCache: false,
+		inputPrice: 1,
+		outputPrice: 3,
+		description: "GLM-4.5-turbo model with 128K token context window, optimized for fast inference.",
+	},
 	"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": {
 	"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": {
 		maxTokens: 32768,
 		maxTokens: 32768,
 		contextWindow: 262144,
 		contextWindow: 262144,

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

@@ -253,6 +253,28 @@ describe("ChutesHandler", () => {
 		)
 		)
 	})
 	})
 
 
+	it("should return zai-org/GLM-4.5-turbo model with correct configuration", () => {
+		const testModelId: ChutesModelId = "zai-org/GLM-4.5-turbo"
+		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: 131072,
+				supportsImages: false,
+				supportsPromptCache: false,
+				inputPrice: 1,
+				outputPrice: 3,
+				description: "GLM-4.5-turbo model with 128K token context window, optimized for fast inference.",
+				temperature: 0.5, // Default temperature for non-DeepSeek models
+			}),
+		)
+	})
+
 	it("should return Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8 model with correct configuration", () => {
 	it("should return Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8 model with correct configuration", () => {
 		const testModelId: ChutesModelId = "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8"
 		const testModelId: ChutesModelId = "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8"
 		const handlerWithModel = new ChutesHandler({
 		const handlerWithModel = new ChutesHandler({