llm-quota-orchestration

Rotate Gemini API keys and manage session affinity for multi-key LLM deployments.

Updated Jan 19, 2026
One-click install
npx skills add https://github.com/KAFKA2306/yt3 --skill llm-quota-orchestration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llm-quota-orchestration
Source: https://github.com/KAFKA2306/yt3/tree/main/.agent/skills/llm-quota-orchestration
Command: npx skills add https://github.com/KAFKA2306/yt3 --skill llm-quota-orchestration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @google/generative-ai, and includes scripts (resource) components.

What problem does it solve?

Prevents quota exhaustion and cache disruption in multi-key LLM deployments by managing API key rotation, maintaining session affinity, and orchestrating tiered fallbacks so requests remain fast and reliable.

Core Features & Use Cases

  • Sticky Sessions & Prefix Caching: Pin workflows to a single API key to preserve prefix cache hits and reduce latency.
  • Tiered Resilience: Failover from Gemini cloud keys to local vLLM instances and provide a controlled fail-fast option when necessary.
  • Quota-aware Key Selection & Ledger: Select keys by affinity, remaining quota, or LRU, and update a ledger using rate-limit headers with cooldown management.
  • Use Case: Ideal for services with parallel LLM requests that must avoid 429s, maintain prompt caching benefits, and route traffic across multiple Gemini API keys.

Quick Start

Use the llm-quota-orchestration to validate available Gemini keys, pin a session to the best key, and fallback to a local model on quota exhaustion.

Frequently Asked Questions about llm-quota-orchestration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage multiple Gemini API keys to avoid 429 quota errors?

Manage multiple Gemini API keys by implementing quota-aware key rotation and a ledger system that parses rate-limit headers to trigger cooldowns. This approach selects keys based on remaining quota or LRU, preventing 429 errors during high request volumes.

Can I failover from Gemini cloud keys to a local vLLM instance?

Yes, you can failover from Gemini cloud keys to local vLLM instances using tiered resilience. This configuration provides a controlled fail-fast fallback option when cloud API quota exhaustion occurs.

How does quota-aware routing handle rate-limit headers for key selection?

Quota-aware routing parses rate-limit headers from LLM responses to update a quota ledger and manage cooldowns. It selects the optimal API key by evaluating session affinity, remaining quota, or LRU status to route traffic reliably.

How do I preserve prefix caching when rotating multiple API keys?

Preserve prefix caching during API key rotation by using sticky sessions that pin workflows to a single key. The orchestration layer injects status updates into agent prompts to maintain session affinity and reduce latency.

Does this quota management approach work with the @google/generative-ai dependency?

Yes, quota management works directly with the @google/generative-ai dependency. It is designed for services operating with multiple Gemini API keys that need to avoid 429s and route parallel requests efficiently.

When should I use a fail-fast option for LLM request routing?

Use a fail-fast option when cloud API keys are exhausted and local vLLM fallbacks are unavailable. This controlled failure mechanism prevents cascading delays in tiered resilience routing during critical quota depletion.