Files
adk-python/contributing/samples/litellm_with_fallback_models
George Weale 2367901ec5 chore: Upgrade to headers to 2026
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 858763407
2026-01-20 14:50:09 -08:00
..
2026-01-20 14:50:09 -08:00
2026-01-20 14:50:09 -08:00

LiteLLM with Fallback Models

This agent is built for resilience using LiteLLM's built-in fallback mechanism. It automatically switches models to guard against common disruptions like token limit errors and connection failures, while ensuring full conversational context is preserved across all model changes.

To run this example, ensure your .env file includes the following variables:

GOOGLE_API_KEY=
OPENAI_API_KEY=
ANTHROPIC_API_KEY=