From 38c6c7a101a8552a422ccc881dddee91031c99a5 Mon Sep 17 00:00:00 2001 From: "roomote[bot]" <219738659+roomote[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 22:23:51 -0400 Subject: [PATCH] feat: add zai-org/GLM-4.5-FP8 model to Chutes AI provider (#6441) Co-authored-by: Roo Code --- packages/types/src/providers/chutes.ts | 11 +++++++++++ src/api/providers/__tests__/chutes.spec.ts | 23 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/packages/types/src/providers/chutes.ts b/packages/types/src/providers/chutes.ts index 98a2f4f360..95946122a3 100644 --- a/packages/types/src/providers/chutes.ts +++ b/packages/types/src/providers/chutes.ts @@ -26,6 +26,7 @@ export type ChutesModelId = | "microsoft/MAI-DS-R1-FP8" | "tngtech/DeepSeek-R1T-Chimera" | "zai-org/GLM-4.5-Air" + | "zai-org/GLM-4.5-FP8" export const chutesDefaultModelId: ChutesModelId = "deepseek-ai/DeepSeek-R1-0528" @@ -247,4 +248,14 @@ export const chutesModels = { description: "GLM-4.5-Air model with 151,329 token context window and 106B total parameters with 12B activated.", }, + "zai-org/GLM-4.5-FP8": { + maxTokens: 32768, + contextWindow: 131072, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0, + outputPrice: 0, + description: + "GLM-4.5-FP8 model with 128k token context window, optimized for agent-based applications with MoE architecture.", + }, } as const satisfies Record diff --git a/src/api/providers/__tests__/chutes.spec.ts b/src/api/providers/__tests__/chutes.spec.ts index 35cb183dae..911c848b12 100644 --- a/src/api/providers/__tests__/chutes.spec.ts +++ b/src/api/providers/__tests__/chutes.spec.ts @@ -208,6 +208,29 @@ describe("ChutesHandler", () => { ) }) + it("should return zai-org/GLM-4.5-FP8 model with correct configuration", () => { + const testModelId: ChutesModelId = "zai-org/GLM-4.5-FP8" + 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: 0, + outputPrice: 0, + description: + "GLM-4.5-FP8 model with 128k token context window, optimized for agent-based applications with MoE architecture.", + 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 } }] })