feat(ai): add Fireworks provider support closes #3519

This commit is contained in:
Mario Zechner
2026-04-22 01:08:57 +02:00
parent 92b08abd3b
commit 0bb0a58466
12 changed files with 400 additions and 0 deletions

View File

@@ -468,6 +468,33 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
}
}
// Process Fireworks models
if (data["fireworks-ai"]?.models) {
for (const [modelId, model] of Object.entries(data["fireworks-ai"].models)) {
const m = model as ModelsDevModel;
if (m.tool_call !== true) continue;
models.push({
id: modelId,
name: m.name || modelId,
api: "anthropic-messages",
provider: "fireworks",
// Fireworks Anthropic-compatible API - SDK appends /v1/messages
baseUrl: "https://api.fireworks.ai/inference",
reasoning: m.reasoning === true,
input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],
cost: {
input: m.cost?.input || 0,
output: m.cost?.output || 0,
cacheRead: m.cost?.cache_read || 0,
cacheWrite: m.cost?.cache_write || 0,
},
contextWindow: m.limit?.context || 4096,
maxTokens: m.limit?.output || 4096,
});
}
}
// Process OpenCode models (Zen and Go)
// API mapping based on provider.npm field:
// - @ai-sdk/openai → openai-responses