Files
wehub-resource-sync 9201ef759e
CI / lint (push) Waiting to run
CI / mypy (push) Waiting to run
CI / docs (push) Waiting to run
CI / test on 3.10 (standard) (push) Waiting to run
CI / test on 3.11 (standard) (push) Waiting to run
CI / test on 3.12 (standard) (push) Waiting to run
CI / test on 3.10 (all-extras) (push) Waiting to run
CI / test on 3.11 (all-extras) (push) Waiting to run
CI / test on 3.12 (all-extras) (push) Waiting to run
CI / test on 3.13 (all-extras) (push) Waiting to run
CI / test on 3.14 (pydantic-evals) (push) Waiting to run
Harness Compat / harness compat (push) Waiting to run
CI / test on 3.13 (standard) (push) Waiting to run
CI / test on 3.14 (standard) (push) Waiting to run
CI / test on 3.14 (all-extras) (push) Waiting to run
CI / test on 3.10 (pydantic-ai-slim) (push) Waiting to run
CI / test on 3.11 (pydantic-ai-slim) (push) Waiting to run
CI / test on 3.12 (pydantic-ai-slim) (push) Waiting to run
CI / test on 3.13 (pydantic-ai-slim) (push) Waiting to run
CI / test on 3.14 (pydantic-ai-slim) (push) Waiting to run
CI / test on 3.10 (pydantic-evals) (push) Waiting to run
CI / test on 3.11 (pydantic-evals) (push) Waiting to run
CI / test on 3.12 (pydantic-evals) (push) Waiting to run
CI / test on 3.13 (pydantic-evals) (push) Waiting to run
CI / test on 3.10 (lowest-versions) (push) Waiting to run
CI / test on 3.11 (lowest-versions) (push) Waiting to run
CI / test on 3.12 (lowest-versions) (push) Waiting to run
CI / test on 3.13 (lowest-versions) (push) Waiting to run
CI / test on 3.14 (lowest-versions) (push) Waiting to run
CI / test examples on 3.11 (push) Waiting to run
CI / test examples on 3.12 (push) Waiting to run
CI / test examples on 3.13 (push) Waiting to run
CI / test examples on 3.14 (push) Waiting to run
CI / coverage (push) Blocked by required conditions
CI / check (push) Blocked by required conditions
CI / deploy-docs (push) Blocked by required conditions
CI / deploy-docs-preview (push) Blocked by required conditions
CI / build release artifacts (push) Blocked by required conditions
CI / publish to PyPI (push) Blocked by required conditions
CI / Send tweet (push) Blocked by required conditions
chore: import upstream snapshot with attribution
2026-07-13 13:27:52 +08:00

6.8 KiB

Installation

Pydantic AI is available on PyPI as pydantic-ai so installation is as simple as:

pip/uv-add pydantic-ai

(Requires Python 3.10+)

This installs the pydantic_ai package, core dependencies, and libraries required to use the OpenAI, Anthropic, and Google models, plus the CLI, MCP, Evals, Web UI, Retries, and Logfire integrations. To use any other models or integrations, add the relevant extras to your install command, e.g. pydantic-ai[bedrock,temporal]. Alternatively, you can install the pydantic-ai-slim package with only the extras you need.

Use with Pydantic Logfire

Pydantic AI has an excellent (but completely optional) integration with Pydantic Logfire to help you view and understand agent runs.

Logfire comes included with pydantic-ai (but not the "slim" version), so you can typically start using it immediately by following the Logfire setup docs.

Running Examples

We distribute the pydantic_ai_examples directory as a separate PyPI package (pydantic-ai-examples) to make examples extremely easy to customize and run.

To install examples, use the examples optional group:

pip/uv-add "pydantic-ai[examples]"

To run the examples, follow instructions in the examples docs.

Slim Install

If you know which model you're going to use and want to avoid installing superfluous packages, you can use the pydantic-ai-slim package. For example, if you're using just [OpenAIChatModel][pydantic_ai.models.openai.OpenAIChatModel], you would run:

pip/uv-add "pydantic-ai-slim[openai]"

pydantic-ai-slim has the following optional groups:

You can also install dependencies for multiple models and use cases, for example:

pip/uv-add "pydantic-ai-slim[openai,google,logfire]"