Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/types/src/provider-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const providerNames = [
"huggingface",
"cerebras",
"sambanova",
"fireworks",
] as const

export const providerNamesSchema = z.enum(providerNames)
Expand Down Expand Up @@ -257,6 +258,10 @@ const sambaNovaSchema = apiModelIdProviderModelSchema.extend({
sambaNovaApiKey: z.string().optional(),
})

const fireworksSchema = apiModelIdProviderModelSchema.extend({
fireworksApiKey: z.string().optional(),
})

const defaultSchema = z.object({
apiProvider: z.undefined(),
})
Expand Down Expand Up @@ -290,6 +295,7 @@ export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProv
litellmSchema.merge(z.object({ apiProvider: z.literal("litellm") })),
cerebrasSchema.merge(z.object({ apiProvider: z.literal("cerebras") })),
sambaNovaSchema.merge(z.object({ apiProvider: z.literal("sambanova") })),
fireworksSchema.merge(z.object({ apiProvider: z.literal("fireworks") })),
defaultSchema,
])

Expand Down Expand Up @@ -323,6 +329,7 @@ export const providerSettingsSchema = z.object({
...litellmSchema.shape,
...cerebrasSchema.shape,
...sambaNovaSchema.shape,
...fireworksSchema.shape,
...codebaseIndexProviderSchema.shape,
})

Expand Down
162 changes: 162 additions & 0 deletions packages/types/src/providers/fireworks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
import type { ModelInfo } from "../model.js"

// https://docs.fireworks.ai/models/overview
export type FireworksModelId =
| "accounts/fireworks/models/llama-v3p3-70b-instruct"
| "accounts/fireworks/models/llama-v3p2-11b-vision-instruct"
| "accounts/fireworks/models/llama-v3p2-90b-vision-instruct"
| "accounts/fireworks/models/llama-v3p1-405b-instruct"
| "accounts/fireworks/models/llama-v3p1-70b-instruct"
| "accounts/fireworks/models/llama-v3p1-8b-instruct"
| "accounts/fireworks/models/qwen2p5-72b-instruct"
| "accounts/fireworks/models/qwen2p5-32b-instruct"
| "accounts/fireworks/models/qwen2p5-14b-instruct"
| "accounts/fireworks/models/qwen2p5-7b-instruct"
| "accounts/fireworks/models/qwen2p5-3b-instruct"
| "accounts/fireworks/models/qwen2p5-1p5b-instruct"
| "accounts/fireworks/models/qwen2p5-0p5b-instruct"
| "accounts/fireworks/models/qwen2p5-coder-32b-instruct"
| "accounts/moonshot/models/moonshot-v1-auto"

export const fireworksDefaultModelId: FireworksModelId = "accounts/fireworks/models/llama-v3p3-70b-instruct"

export const fireworksModels = {
// Llama models
"accounts/fireworks/models/llama-v3p3-70b-instruct": {
maxTokens: 16384,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.9,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice several models have identical pricing (0.9/0.9 for input/output). Is this accurate according to Fireworks AI's pricing page? It might be worth double-checking these values to ensure users get accurate cost estimates. For example:

  • llama-v3p3-70b-instruct: 0.9/0.9
  • llama-v3p1-70b-instruct: 0.9/0.9
  • qwen2p5-72b-instruct: 0.9/0.9
  • qwen2p5-32b-instruct: 0.9/0.9

outputPrice: 0.9,
description: "Meta Llama 3.3 70B Instruct model with 128K context window",
},
"accounts/fireworks/models/llama-v3p2-11b-vision-instruct": {
maxTokens: 16384,
contextWindow: 131072,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0.2,
outputPrice: 0.2,
description: "Meta Llama 3.2 11B Vision Instruct model with multimodal capabilities",
},
"accounts/fireworks/models/llama-v3p2-90b-vision-instruct": {
maxTokens: 16384,
contextWindow: 131072,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 3.0,
outputPrice: 3.0,
description: "Meta Llama 3.2 90B Vision Instruct model with multimodal capabilities",
},
"accounts/fireworks/models/llama-v3p1-405b-instruct": {
maxTokens: 16384,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 3.0,
outputPrice: 3.0,
description: "Meta Llama 3.1 405B Instruct model, largest Llama model",
},
"accounts/fireworks/models/llama-v3p1-70b-instruct": {
maxTokens: 16384,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.9,
outputPrice: 0.9,
description: "Meta Llama 3.1 70B Instruct model with 128K context window",
},
"accounts/fireworks/models/llama-v3p1-8b-instruct": {
maxTokens: 16384,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.2,
outputPrice: 0.2,
description: "Meta Llama 3.1 8B Instruct model, efficient and fast",
},
// Qwen models
"accounts/fireworks/models/qwen2p5-72b-instruct": {
maxTokens: 32768,
contextWindow: 32768,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.9,
outputPrice: 0.9,
description: "Alibaba Qwen 2.5 72B Instruct model",
},
"accounts/fireworks/models/qwen2p5-32b-instruct": {
maxTokens: 32768,
contextWindow: 32768,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.9,
outputPrice: 0.9,
description: "Alibaba Qwen 2.5 32B Instruct model",
},
"accounts/fireworks/models/qwen2p5-14b-instruct": {
maxTokens: 32768,
contextWindow: 32768,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.2,
outputPrice: 0.2,
description: "Alibaba Qwen 2.5 14B Instruct model",
},
"accounts/fireworks/models/qwen2p5-7b-instruct": {
maxTokens: 32768,
contextWindow: 32768,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.2,
outputPrice: 0.2,
description: "Alibaba Qwen 2.5 7B Instruct model",
},
"accounts/fireworks/models/qwen2p5-3b-instruct": {
maxTokens: 32768,
contextWindow: 32768,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.1,
outputPrice: 0.1,
description: "Alibaba Qwen 2.5 3B Instruct model",
},
"accounts/fireworks/models/qwen2p5-1p5b-instruct": {
maxTokens: 32768,
contextWindow: 32768,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.1,
outputPrice: 0.1,
description: "Alibaba Qwen 2.5 1.5B Instruct model",
},
"accounts/fireworks/models/qwen2p5-0p5b-instruct": {
maxTokens: 32768,
contextWindow: 32768,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.1,
outputPrice: 0.1,
description: "Alibaba Qwen 2.5 0.5B Instruct model, smallest Qwen model",
},
"accounts/fireworks/models/qwen2p5-coder-32b-instruct": {
maxTokens: 32768,
contextWindow: 32768,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.9,
outputPrice: 0.9,
description: "Alibaba Qwen 2.5 Coder 32B Instruct model, optimized for code generation",
},
// Moonshot models
"accounts/moonshot/models/moonshot-v1-auto": {
maxTokens: 65536,
contextWindow: 1000000,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 1.0,
outputPrice: 1.0,
description: "Moonshot Kimi model with up to 1M context window",
},
} as const satisfies Record<string, ModelInfo>
3 changes: 2 additions & 1 deletion packages/types/src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export * from "./cerebras.js"
export * from "./chutes.js"
export * from "./claude-code.js"
export * from "./deepseek.js"
export * from "./doubao.js"
export * from "./fireworks.js"
export * from "./gemini.js"
export * from "./glama.js"
export * from "./groq.js"
Expand All @@ -21,4 +23,3 @@ export * from "./unbound.js"
export * from "./vertex.js"
export * from "./vscode-llm.js"
export * from "./xai.js"
export * from "./doubao.js"
3 changes: 3 additions & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
ClaudeCodeHandler,
SambaNovaHandler,
DoubaoHandler,
FireworksHandler,
} from "./providers"

export interface SingleCompletionHandler {
Expand Down Expand Up @@ -124,6 +125,8 @@ export function buildApiHandler(configuration: ProviderSettings): ApiHandler {
return new CerebrasHandler(options)
case "sambanova":
return new SambaNovaHandler(options)
case "fireworks":
return new FireworksHandler(options)
default:
apiProvider satisfies "gemini-cli" | undefined
return new AnthropicHandler(options)
Expand Down
Loading
Loading