Installation
PydanticAI is available on PyPI so installation is as simple as:
pip install pydantic-ai
uv add pydantic-ai
It requires Python 3.9+.
Use with Pydantic Logfire
PydanticAI has an excellent (but completely optional) integration with Pydantic Logfire to help you view and understand agent runs.
To use Logfire with PydanticAI, install PydanticAI with the logfire
optional group:
pip install 'pydantic-ai[logfire]'
uv add 'pydantic-ai[logfire]'
From there, follow the Logfire documentation to configure Logfire.
TODO screenshot of Logfire with PydanticAI in action.