Skip to content

Feature Request: Add Explicit Context Caching Support for Gemini Models #2359

@hsjun99

Description

@hsjun99

Problem

Current implicit caching for Gemini models doesn't guarantee caching, even when exceeding minimum token thresholds (1,024 tokens for 2.5 Flash, 2,048 tokens for 2.5 Pro). This is the observed behavior after thorough testing.

Solution

Add explicit context caching support using Gemini API's caching feature:

  • Cache Creation: Create caches with configurable TTL
  • Guaranteed Savings: Predictable caching mechanism

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions