Skip to content

Conversation

@benank
Copy link
Contributor

@benank benank commented Aug 20, 2025

Description

Adds support for prompt caching on Kimi K2 on Groq.

Test Procedure

Have not tested, yolo (also this feature hasn't launched yet)

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ♻️ Refactor Changes
  • 💅 Cosmetic Changes
  • 📚 Documentation update
  • 🏃 Workflow Changes

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
  • Tests are passing (npm test) and code is formatted and linted (npm run format && npm run lint)
  • I have created a changeset using npm run changeset (required for user-facing changes)
  • I have reviewed contributor guidelines

Important

Adds prompt caching support for Kimi K2 model on Groq, updating cost calculations and model configurations.

  • Behavior:
    • Adds prompt caching support for Kimi K2 model in groq.ts.
    • Updates yieldUsage() in GroqHandler to calculate non-cached input tokens and total cost with cache read tokens.
  • Models:
    • Updates groqModels in api.ts to set supportsPromptCache to true for Kimi K2.
    • Adds cacheReadsPrice for Kimi K2 in groqModels.
  • Interfaces:
    • Introduces GroqUsage interface in groq.ts to include prompt_tokens_details with cached_tokens.

This description was created by Ellipsis for fad6d34. You can customize this summary. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Aug 20, 2025

⚠️ No Changeset found

Latest commit: fad6d34

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@arafatkatze arafatkatze merged commit 19f055e into cline:main Aug 20, 2025
8 checks passed
daniel-lxs added a commit to RooCodeInc/Roo-Code that referenced this pull request Aug 22, 2025
Ported from upstream Cline repository PR #5697
Original PR: cline/cline#5697

- Added GroqUsage interface to handle cached token fields
- Implemented proper cost calculation with cache read discounts
- Enabled prompt caching for Kimi K2 model with 50% discount on cached tokens
- Updated tests to verify caching functionality

Co-authored-by: Cline Contributors <[email protected]>
mrubens pushed a commit to RooCodeInc/Roo-Code that referenced this pull request Aug 22, 2025
Ported from upstream Cline repository PR #5697
Original PR: cline/cline#5697

- Added GroqUsage interface to handle cached token fields
- Implemented proper cost calculation with cache read discounts
- Enabled prompt caching for Kimi K2 model with 50% discount on cached tokens
- Updated tests to verify caching functionality

Co-authored-by: Cline Contributors <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants