Pydantic AI FallbackModel: Content-Based Semantic Fallback Across 25+ LLM Providers with Disabled SDK Retries
Pydantic AI Docs·medium signal
Pydantic AI's FallbackModel chains multiple providers and triggers fallback on 429/5xx—but also supports content-based fallback where a semantically invalid response (successful HTTP, wrong output) triggers the next provider. Critical pattern: disable provider SDK retries (set max_retries=0) so the fallback fires immediately rather than waiting on exponential backoff. Validation errors are automatically passed back to the model as retry prompts.