Members-Only
Recent Talks & Demos are for members only
You must be an AI Tinkerers active member to view these talks and demos.
Skipping RAG: Gemini Long Context Performance Analysis
This talk explores a two-layer caching system using Redis and Google's Gemini Context Cache API to improve performance, reduce costs, and simplify long-context management.
This project demonstrates how Google’s Gemini Context Caching API can be effectively managed through a two-layer caching system to improve performance and reduce costs. The benchmark results are compelling: a 74% cost reduction (from $4.31 to $1.12) and 17% faster response times (21.6s vs 26.3s average) with just a 1-minute TTL over 5 test runs.
The implementation features a Redis + Google cache architecture where Redis stores metadata (Google cache IDs, MD5 hashes of content, expiration times) while Google’s servers store the actual context content. The system handles cache invalidation automatically through Redis TTL and content change detection via MD5 hashing, creating a seamless developer experience - developers simply pass their content and a cache key, and the system manages everything else.
Technical highlights include:
Automatic cache invalidation via Redis TTL and MD5 content hashing
RESTful integration with Google’s Context Cache API
Detailed benchmarking system measuring latency, token usage, and costs
Comparison of cached vs uncached approaches with real-world data
Ruby implementation with minimal dependencies (just Redis and net/http)
Compose Email
Loading recent emails...