Skip to content

Commit b9401a1

Browse files
committed
feat(fireworks): fetch pricing from the API and drop the hardcoded catalog
Fireworks model metadata and pricing now come entirely from the API: - Model list and capabilities: GET /inference/v1/models. - Pricing: GET /v1/accounts/{account_id}/serverlessModels, with the account id resolved via GET /v1/accounts. The RPC has no API reference page, but its pricing field is documented in the Model schema on the List/Get Model docs (serverlessModes[].skuInfos: "only populated by ListServerlessModels"). The default mode prices the model id; fast modes price their usageIdentifier router id; priority tier is skipped. - Pricing is best-effort: on any failure the model list still loads and cost is left unknown. Models without a price are kept. - Embedding/reranker models are filtered by kind, since they report supports_chat: true. Removes the hardcoded fireworksModels catalog and FireworksModelId type. The settings picker shows only API-fetched models (no static fallback), and the handler/useSelectedModel read model info from the fetched list.
1 parent 2a21870 commit b9401a1

12 files changed

Lines changed: 878 additions & 1118 deletions

File tree

‎packages/types/src/__tests__/deepseek-v4-pro.test.ts‎

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { basetenModels, deepSeekModels, fireworksModels, opencodeGoModels } from "../providers/index.js"
1+
import { basetenModels, deepSeekModels, opencodeGoModels } from "../providers/index.js"
22

33
describe("DeepSeek V4 Pro 0813 provider catalogs", () => {
44
it.each([
@@ -55,23 +55,19 @@ describe("DeepSeek V4 Pro 0813 provider catalogs", () => {
5555
})
5656

5757
// Self-hosted providers retain separate IDs for the preview weights and 0813 checkpoint.
58-
it.each([
59-
["Fireworks AI", fireworksModels["accounts/fireworks/models/deepseek-v4-pro"]],
60-
["Baseten", basetenModels["deepseek-ai/DeepSeek-V4-Pro"]],
61-
])("does not apply the API checkpoint label to %s", (_provider, model) => {
62-
expect(model).toBeDefined()
63-
expect("displayName" in model && typeof model.displayName === "string" ? model.displayName : "").not.toContain(
64-
"0813",
65-
)
66-
expect(model?.contextWindow).toBeGreaterThanOrEqual(1_000_000)
67-
})
58+
// (Fireworks models, including pricing, are fetched dynamically from the Fireworks API.)
59+
it.each([["Baseten", basetenModels["deepseek-ai/DeepSeek-V4-Pro"]]])(
60+
"does not apply the API checkpoint label to %s",
61+
(_provider, model) => {
62+
expect(model).toBeDefined()
63+
expect(
64+
"displayName" in model && typeof model.displayName === "string" ? model.displayName : "",
65+
).not.toContain("0813")
66+
expect(model?.contextWindow).toBeGreaterThanOrEqual(1_000_000)
67+
},
68+
)
6869

6970
it.each([
70-
[
71-
"Fireworks AI",
72-
fireworksModels["accounts/fireworks/models/deepseek-v4-pro-0813"],
73-
{ inputPrice: 1.32, outputPrice: 3.96, cacheReadsPrice: 0.044 },
74-
],
7571
[
7672
"Baseten",
7773
basetenModels["deepseek-ai/DeepSeek-V4-Pro-0813"],
@@ -85,11 +81,6 @@ describe("DeepSeek V4 Pro 0813 provider catalogs", () => {
8581
})
8682

8783
it("keeps preview pricing separate and omits unverified cache-write prices", () => {
88-
expect(fireworksModels["accounts/fireworks/models/deepseek-v4-pro"]).toMatchObject({
89-
inputPrice: 1.74,
90-
outputPrice: 3.48,
91-
cacheReadsPrice: 0.145,
92-
})
9384
expect(basetenModels["deepseek-ai/DeepSeek-V4-Pro"]).toMatchObject({
9485
inputPrice: 1.74,
9586
outputPrice: 3.48,

‎packages/types/src/provider-settings.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
basetenModels,
3030
bedrockModels,
3131
deepSeekModels,
32-
fireworksModels,
3332
friendliModels,
3433
geminiModels,
3534
mistralModels,
@@ -449,11 +448,8 @@ export const MODELS_BY_PROVIDER: Record<
449448
label: "DeepSeek",
450449
models: Object.keys(deepSeekModels),
451450
},
452-
[providerIdentifiers.fireworks]: {
453-
id: providerIdentifiers.fireworks,
454-
label: "Fireworks",
455-
models: Object.keys(fireworksModels),
456-
},
451+
// Fireworks models are fetched dynamically from the Fireworks API.
452+
[providerIdentifiers.fireworks]: { id: providerIdentifiers.fireworks, label: "Fireworks", models: [] },
457453
[providerIdentifiers.friendli]: {
458454
id: providerIdentifiers.friendli,
459455
label: "Friendli",

0 commit comments

Comments
 (0)