Adding Groq provider (#4943)

This commit is contained in:
Ara authored and GitHub committed 2025-07-15 19:47:56 -07:00
1 parent b6f6358d4a
commit 5dddbef65c
17 files changed
+1024 -8

No files matched your search

+93
View File
@@ -28,6 +28,7 @@ export type ApiProvider =
| "sambanova"
| "cerebras"
| "sapaicore"
| "groq"
export interface ApiHandlerOptions {
apiModelId?: string
@@ -99,6 +100,9 @@ export interface ApiHandlerOptions {
reasoningEffort?: string
sambanovaApiKey?: string
cerebrasApiKey?: string
groqApiKey?: string
groqModelId?: string
groqModelInfo?: ModelInfo
requestTimeoutMs?: number
sapAiCoreClientId?: string
sapAiCoreClientSecret?: string
@@ -2403,6 +2407,95 @@ export const cerebrasModels = {
},
} as const satisfies Record<string, ModelInfo>
// Groq
// https://console.groq.com/docs/models
// https://groq.com/pricing/
export type GroqModelId = keyof typeof groqModels
export const groqDefaultModelId: GroqModelId = "moonshotai/kimi-k2-instruct"
export const groqModels = {
// Compound Beta Models - Hybrid architectures optimized for tool use
"compound-beta": {
maxTokens: 8192,
contextWindow: 128000,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.0,
outputPrice: 0.0,
description:
"Compound model using Llama 4 Scout for core reasoning with Llama 3.3 70B for routing and tool use. Excellent for plan/act workflows.",
},
"compound-beta-mini": {
maxTokens: 8192,
contextWindow: 128000,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.0,
outputPrice: 0.0,
description: "Lightweight compound model for faster inference while maintaining tool use capabilities.",
},
// DeepSeek Models - Reasoning-optimized
"deepseek-r1-distill-llama-70b": {
maxTokens: 131072,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.75,
outputPrice: 0.99,
description:
"DeepSeek R1 reasoning capabilities distilled into Llama 70B architecture. Excellent for complex problem-solving and planning.",
},
// Llama 4 Models
"meta-llama/llama-4-maverick-17b-128e-instruct": {
maxTokens: 8192,
contextWindow: 131072,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0.2,
outputPrice: 0.6,
description: "Meta's Llama 4 Maverick 17B model with 128 experts, supports vision and multimodal tasks.",
},
"meta-llama/llama-4-scout-17b-16e-instruct": {
maxTokens: 8192,
contextWindow: 131072,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0.11,
outputPrice: 0.34,
description: "Meta's Llama 4 Scout 17B model with 16 experts, optimized for fast inference and general tasks.",
},
// Llama 3.3 Models
"llama-3.3-70b-versatile": {
maxTokens: 32768,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.59,
outputPrice: 0.79,
description: "Meta's latest Llama 3.3 70B model optimized for versatile use cases with excellent performance and speed.",
},
// Llama 3.1 Models - Fast inference
"llama-3.1-8b-instant": {
maxTokens: 131072,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 0.05,
outputPrice: 0.08,
description: "Fast and efficient Llama 3.1 8B model optimized for speed, low latency, and reliable tool execution.",
},
// Mistral Models
"moonshotai/kimi-k2-instruct": {
maxTokens: 16384,
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 1.0,
outputPrice: 3.0,
description:
"Kimi K2 is Moonshot AI's state-of-the-art Mixture-of-Experts (MoE) language model with 1 trillion total parameters and 32 billion activated parameters.",
},
} as const satisfies Record<string, ModelInfo>
// Requesty
// https://requesty.ai/models
export const requestyDefaultModelId = "anthropic/claude-3-7-sonnet-latest"