This repository was archived by the owner on May 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: add prompt caching support for Groq provider #7321
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,100 +22,111 @@ export const groqModels = { | |
| maxTokens: 8192, | ||
| contextWindow: 131072, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 0.05, | ||
| outputPrice: 0.08, | ||
| cacheReadsPrice: 0.01, // 80% discount on cached tokens | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the pricing calculation correct? The comment says "80% discount on cached tokens" but the math appears to show 20% of the original price (which is indeed an 80% discount). The wording might be confusing - consider clarifying the comment to say "20% of original price (80% discount)" for clarity. |
||
| description: "Meta Llama 3.1 8B Instant model, 128K context.", | ||
| }, | ||
| "llama-3.3-70b-versatile": { | ||
| maxTokens: 8192, | ||
| contextWindow: 131072, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 0.59, | ||
| outputPrice: 0.79, | ||
| cacheReadsPrice: 0.118, // 80% discount on cached tokens | ||
| description: "Meta Llama 3.3 70B Versatile model, 128K context.", | ||
| }, | ||
| "meta-llama/llama-4-scout-17b-16e-instruct": { | ||
| maxTokens: 8192, | ||
| contextWindow: 131072, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 0.11, | ||
| outputPrice: 0.34, | ||
| cacheReadsPrice: 0.022, // 80% discount on cached tokens | ||
| description: "Meta Llama 4 Scout 17B Instruct model, 128K context.", | ||
| }, | ||
| "meta-llama/llama-4-maverick-17b-128e-instruct": { | ||
| maxTokens: 8192, | ||
| contextWindow: 131072, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 0.2, | ||
| outputPrice: 0.6, | ||
| cacheReadsPrice: 0.04, // 80% discount on cached tokens | ||
| description: "Meta Llama 4 Maverick 17B Instruct model, 128K context.", | ||
| }, | ||
| "mistral-saba-24b": { | ||
| maxTokens: 8192, | ||
| contextWindow: 32768, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 0.79, | ||
| outputPrice: 0.79, | ||
| cacheReadsPrice: 0.158, // 80% discount on cached tokens | ||
| description: "Mistral Saba 24B model, 32K context.", | ||
| }, | ||
| "qwen-qwq-32b": { | ||
| maxTokens: 8192, | ||
| contextWindow: 131072, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 0.29, | ||
| outputPrice: 0.39, | ||
| cacheReadsPrice: 0.058, // 80% discount on cached tokens | ||
| description: "Alibaba Qwen QwQ 32B model, 128K context.", | ||
| }, | ||
| "qwen/qwen3-32b": { | ||
| maxTokens: 8192, | ||
| contextWindow: 131072, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 0.29, | ||
| outputPrice: 0.59, | ||
| cacheReadsPrice: 0.058, // 80% discount on cached tokens | ||
| description: "Alibaba Qwen 3 32B model, 128K context.", | ||
| }, | ||
| "deepseek-r1-distill-llama-70b": { | ||
| maxTokens: 8192, | ||
| contextWindow: 131072, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 0.75, | ||
| outputPrice: 0.99, | ||
| cacheReadsPrice: 0.15, // 80% discount on cached tokens | ||
| description: "DeepSeek R1 Distill Llama 70B model, 128K context.", | ||
| }, | ||
| "moonshotai/kimi-k2-instruct": { | ||
| maxTokens: 16384, | ||
| contextWindow: 131072, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 1.0, | ||
| outputPrice: 3.0, | ||
| cacheReadsPrice: 0.2, // 80% discount on cached tokens | ||
| description: "Moonshot AI Kimi K2 Instruct 1T model, 128K context.", | ||
| }, | ||
| "openai/gpt-oss-120b": { | ||
| maxTokens: 32766, | ||
| contextWindow: 131072, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 0.15, | ||
| outputPrice: 0.75, | ||
| cacheReadsPrice: 0.03, // 80% discount on cached tokens | ||
| description: | ||
| "GPT-OSS 120B is OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with 20 billion parameters and 128 experts.", | ||
| }, | ||
| "openai/gpt-oss-20b": { | ||
| maxTokens: 32768, | ||
| contextWindow: 131072, | ||
| supportsImages: false, | ||
| supportsPromptCache: false, | ||
| supportsPromptCache: true, | ||
| inputPrice: 0.1, | ||
| outputPrice: 0.5, | ||
| cacheReadsPrice: 0.02, // 80% discount on cached tokens | ||
| description: | ||
| "GPT-OSS 20B is OpenAI's flagship open source model, built on a Mixture-of-Experts (MoE) architecture with 20 billion parameters and 32 experts.", | ||
| }, | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new setting
groqUsePromptCachewould benefit from documentation. Consider adding a comment explaining what this does and its cost implications for users who might see this in the settings UI.