feat: add GLM-4.5 and OpenAI gpt-oss models to Fireworks provider (#6784)

* feat: add GLM-4.5 and OpenAI gpt-oss models to Fireworks provider

- Added GLM-4.5 (355B/32B active) and GLM-4.5-Air (106B/12B active) models from Z.ai
- Added gpt-oss-20b and gpt-oss-120b models from OpenAI
- All models configured with 128K context window
- Added comprehensive test coverage for all new models

Fixes #6753

* fix: update GLM-4.5 model IDs to use p instead of hyphen

- Changed glm-4-5 to glm-4p5
- Changed glm-4-5-air to glm-4p5-air
- Updated corresponding test cases

---------

Co-authored-by: Roo Code <roomote@roocode.com>
This commit is contained in:
roomote[bot] 2025-08-07 09:42:22 -04:00 committed by GitHub
parent 15b0f50dd9
commit 212297755f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 128 additions and 0 deletions

View file

@ -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<string, ModelInfo>

View file

@ -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 } }] })