• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agentjido / req_llm / 20cb655c7e63ec10c089c22690d0b034dda10c47-PR-193
49%
main: 49%

Build:
Build:
LAST BUILD BRANCH: feat/load-dotenv-config
DEFAULT BRANCH: main
Ran 06 Nov 2025 12:46AM UTC
Jobs 4
Files 90
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Nov 2025 12:45AM UTC coverage: 51.792% (-1.0%) from 52.762%
20cb655c7e63ec10c089c22690d0b034dda10c47-PR-193

Pull #193

github

neilberkman
feat: Add Google Context Caching support for Gemini models

Adds explicit context caching API for Gemini models to reduce costs by up to
90% when reusing large amounts of content.

## Changes

- Add ReqLLM.Providers.Google.CachedContent module for cache CRUD operations
- Support for both Google AI Studio and Vertex AI (when Gemini support is added)
- Add cached_content provider option to reference existing caches
- Comprehensive tests for cache creation, listing, updating, and deletion
- Documentation and examples in Google provider moduledoc
- Updated CHANGELOG

## Usage

```elixir
# Create a cache
{:ok, cache} = ReqLLM.Providers.Google.CachedContent.create(
  provider: :google,
  model: "gemini-2.5-flash",
  api_key: System.get_env("GOOGLE_API_KEY"),
  contents: [%{role: "user", parts: [%{text: large_document}]}],
  ttl: "3600s"
)

# Use the cache in requests
{:ok, response} = ReqLLM.generate_text(
  "google:gemini-2.5-flash",
  "Question about the document?",
  provider_options: [cached_content: cache.name]
)

# Check cached tokens in usage
IO.inspect(response.usage.cached_tokens)
```

## Requirements

- Gemini 2.5 Flash: 1,024 minimum tokens
- Gemini 2.5 Pro: 4,096 minimum tokens
Pull Request #193: feat: Add Google Context Caching support for Gemini models

11 of 165 new or added lines in 2 files covered. (6.67%)

2 existing lines in 1 file now uncovered.

4003 of 7729 relevant lines covered (51.79%)

345.99 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
61.86
0.46% lib/req_llm/providers/google.ex
153
2.55
lib/req_llm/providers/google/cached_content.ex

Uncovered Existing Lines

Lines Coverage ∆ File
2
82.14
-7.14% lib/req_llm/keys.ex
Jobs
ID Job ID Ran Files Coverage
1 20cb655c7e63ec10c089c22690d0b034dda10c47-PR-193.1 06 Nov 2025 12:46AM UTC 90
51.73
GitHub Action Run
2 20cb655c7e63ec10c089c22690d0b034dda10c47-PR-193.2 06 Nov 2025 12:46AM UTC 90
51.69
GitHub Action Run
3 20cb655c7e63ec10c089c22690d0b034dda10c47-PR-193.3 06 Nov 2025 12:46AM UTC 90
51.69
GitHub Action Run
4 20cb655c7e63ec10c089c22690d0b034dda10c47-PR-193.4 06 Nov 2025 12:46AM UTC 90
51.68
GitHub Action Run
Source Files on build 20cb655c7e63ec10c089c22690d0b034dda10c47-PR-193
  • Tree
  • List 90
  • Changed 9
  • Source Changed 0
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #193
  • PR Base - main (#6FE32B91...)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc