diff --git a/packages/types/src/providers/fireworks.ts b/packages/types/src/providers/fireworks.ts index 80858f624e..79c1d314cf 100644 --- a/packages/types/src/providers/fireworks.ts +++ b/packages/types/src/providers/fireworks.ts @@ -6,6 +6,10 @@ export type FireworksModelId = | "accounts/fireworks/models/qwen3-coder-480b-a35b-instruct" | "accounts/fireworks/models/deepseek-r1-0528" | "accounts/fireworks/models/deepseek-v3" + | "accounts/fireworks/models/glm-4p5" + | "accounts/fireworks/models/glm-4p5-air" + | "accounts/fireworks/models/gpt-oss-20b" + | "accounts/fireworks/models/gpt-oss-120b" export const fireworksDefaultModelId: FireworksModelId = "accounts/fireworks/models/kimi-k2-instruct" @@ -58,4 +62,44 @@ export const fireworksModels = { description: "A strong Mixture-of-Experts (MoE) language model with 671B total parameters with 37B activated for each token from Deepseek. Note that fine-tuning for this model is only available through contacting fireworks at https://fireworks.ai/company/contact-us.", }, + "accounts/fireworks/models/glm-4p5": { + maxTokens: 16384, + contextWindow: 128000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.55, + outputPrice: 2.19, + description: + "Z.ai GLM-4.5 with 355B total parameters and 32B active parameters. Features unified reasoning, coding, and intelligent agent capabilities.", + }, + "accounts/fireworks/models/glm-4p5-air": { + maxTokens: 16384, + contextWindow: 128000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.55, + outputPrice: 2.19, + description: + "Z.ai GLM-4.5-Air with 106B total parameters and 12B active parameters. Features unified reasoning, coding, and intelligent agent capabilities.", + }, + "accounts/fireworks/models/gpt-oss-20b": { + maxTokens: 16384, + contextWindow: 128000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.07, + outputPrice: 0.3, + description: + "OpenAI gpt-oss-20b: Compact model for local/edge deployments. Optimized for low-latency and resource-constrained environments with chain-of-thought output, adjustable reasoning, and agentic workflows.", + }, + "accounts/fireworks/models/gpt-oss-120b": { + maxTokens: 16384, + contextWindow: 128000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.15, + outputPrice: 0.6, + description: + "OpenAI gpt-oss-120b: Production-grade, general-purpose model that fits on a single H100 GPU. Features complex reasoning, configurable effort, full chain-of-thought transparency, and supports function calling, tool use, and structured outputs.", + }, } as const satisfies Record diff --git a/src/api/providers/__tests__/fireworks.spec.ts b/src/api/providers/__tests__/fireworks.spec.ts index 21a88e80ba..cfab672c08 100644 --- a/src/api/providers/__tests__/fireworks.spec.ts +++ b/src/api/providers/__tests__/fireworks.spec.ts @@ -179,6 +179,90 @@ describe("FireworksHandler", () => { ) }) + it("should return GLM-4.5 model with correct configuration", () => { + const testModelId: FireworksModelId = "accounts/fireworks/models/glm-4p5" + const handlerWithModel = new FireworksHandler({ + apiModelId: testModelId, + fireworksApiKey: "test-fireworks-api-key", + }) + const model = handlerWithModel.getModel() + expect(model.id).toBe(testModelId) + expect(model.info).toEqual( + expect.objectContaining({ + maxTokens: 16384, + contextWindow: 128000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.55, + outputPrice: 2.19, + description: expect.stringContaining("Z.ai GLM-4.5 with 355B total parameters"), + }), + ) + }) + + it("should return GLM-4.5-Air model with correct configuration", () => { + const testModelId: FireworksModelId = "accounts/fireworks/models/glm-4p5-air" + const handlerWithModel = new FireworksHandler({ + apiModelId: testModelId, + fireworksApiKey: "test-fireworks-api-key", + }) + const model = handlerWithModel.getModel() + expect(model.id).toBe(testModelId) + expect(model.info).toEqual( + expect.objectContaining({ + maxTokens: 16384, + contextWindow: 128000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.55, + outputPrice: 2.19, + description: expect.stringContaining("Z.ai GLM-4.5-Air with 106B total parameters"), + }), + ) + }) + + it("should return gpt-oss-20b model with correct configuration", () => { + const testModelId: FireworksModelId = "accounts/fireworks/models/gpt-oss-20b" + const handlerWithModel = new FireworksHandler({ + apiModelId: testModelId, + fireworksApiKey: "test-fireworks-api-key", + }) + const model = handlerWithModel.getModel() + expect(model.id).toBe(testModelId) + expect(model.info).toEqual( + expect.objectContaining({ + maxTokens: 16384, + contextWindow: 128000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.07, + outputPrice: 0.3, + description: expect.stringContaining("OpenAI gpt-oss-20b: Compact model for local/edge deployments"), + }), + ) + }) + + it("should return gpt-oss-120b model with correct configuration", () => { + const testModelId: FireworksModelId = "accounts/fireworks/models/gpt-oss-120b" + const handlerWithModel = new FireworksHandler({ + apiModelId: testModelId, + fireworksApiKey: "test-fireworks-api-key", + }) + const model = handlerWithModel.getModel() + expect(model.id).toBe(testModelId) + expect(model.info).toEqual( + expect.objectContaining({ + maxTokens: 16384, + contextWindow: 128000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.15, + outputPrice: 0.6, + description: expect.stringContaining("OpenAI gpt-oss-120b: Production-grade, general-purpose model"), + }), + ) + }) + it("completePrompt method should return text from Fireworks API", async () => { const expectedResponse = "This is a test response from Fireworks" mockCreate.mockResolvedValueOnce({ choices: [{ message: { content: expectedResponse } }] })