releases.shpreview

Groq prompt cache hits now reported in usage

@ai-sdk/groq@4.0.8

July 11, 2026AI SDKView original ↗
1 fixThis release1 fixBug fixesAI-tallied from the release notes
From the original release noteView original ↗

Patch Changes

  • 23ca4c9: fix (provider/groq): surface prompt cache reads in usage

    convertGroqUsage accepted prompt_tokens_details.cached_tokens but never read it, so cache hits were reported as cacheRead: undefined and the entire prompt was counted as noCache. Groq's implicit prompt caching now surfaces as usage.cachedInputTokens (mapped to cacheRead, subtracted from noCache). Groq has no cache-creation charge, so cacheWrite remains undefined.

Fetched July 11, 2026