Skip to main content
Pydantic AI is a Python agent framework that brings FastAPI-like ergonomics to GenAI development. Since Pydantic AI uses standard provider SDKs under the hood, Bifrost adds enterprise features like governance, semantic caching, MCP tools, observability, etc, on top of your existing agent setup. Endpoint: /pydanticai
Provider Compatibility: This integration only works for AI providers that both Pydantic AI and Bifrost support. Currently supported: OpenAI, Anthropic, and Google Gemini.

Setup


Provider/Model Usage Examples

Your existing Pydantic AI provider switching works unchanged through Bifrost:

Tool Calling

Pydantic AI’s powerful tool system works seamlessly through Bifrost:

Tools with Dependency Injection

Use RunContext to pass dependencies to your tools:

Structured Output

Define response types using Pydantic models:

Streaming Responses

Stream responses in real-time for better UX:

Adding Custom Headers

Add Bifrost-specific headers for governance and tracking:

Multi-turn Conversations

Maintain conversation history across multiple turns:

Supported Features

The Pydantic AI integration supports all features available in both the Pydantic AI SDK and Bifrost core functionality: Your existing Pydantic AI agents work seamlessly with Bifrost’s enterprise features. 😄

Next Steps