From 5a068d4991ec2b4ef12198320cecfb3241834094 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Thu, 18 Sep 2025 16:55:32 +0000 Subject: [PATCH] feat: add zai-org/GLM-4.5-turbo model to Chutes provider - Added GLM-4.5-turbo to ChutesModelId type definition - Configured model with 128K context window and $1/$3 pricing - Added comprehensive test coverage for the new model - Verified all tests pass and TypeScript compilation succeeds Fixes #8155 --- packages/types/src/providers/chutes.ts | 10 ++++++++++ src/api/providers/__tests__/chutes.spec.ts | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/packages/types/src/providers/chutes.ts b/packages/types/src/providers/chutes.ts index 15dea58263b..d05bd489b1b 100644 --- a/packages/types/src/providers/chutes.ts +++ b/packages/types/src/providers/chutes.ts @@ -29,6 +29,7 @@ export type ChutesModelId = | "tngtech/DeepSeek-R1T-Chimera" | "zai-org/GLM-4.5-Air" | "zai-org/GLM-4.5-FP8" + | "zai-org/GLM-4.5-turbo" | "moonshotai/Kimi-K2-Instruct-75k" | "moonshotai/Kimi-K2-Instruct-0905" | "Qwen/Qwen3-235B-A22B-Thinking-2507" @@ -274,6 +275,15 @@ export const chutesModels = { description: "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": { maxTokens: 32768, contextWindow: 262144, diff --git a/src/api/providers/__tests__/chutes.spec.ts b/src/api/providers/__tests__/chutes.spec.ts index 398f86ce608..70ee06a923c 100644 --- a/src/api/providers/__tests__/chutes.spec.ts +++ b/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", () => { const testModelId: ChutesModelId = "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8" const handlerWithModel = new ChutesHandler({