Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Pydantic AI 2.0 lets Python developers define an LLM agent as a typed application component: choose a model, give it instructions and tools, optionally declare dependencies and a structured result, then select how the application runs it. Start with one agent and the simplest run mode that fits your app; add reusable capabilities or multiple agents only when the workflow calls for them.
Pydantic AI V2 became stable on June 23, 2026. The project’s releases page listed v2.54.0, dated October 2, 2026, as its latest stable release when checked on October 7, 2026. Because releases change frequently, verify the current version and pin the package version you use for an application.
As an Amazon Associate I earn from qualifying purchases.
What makes up a Pydantic AI agent?
Pydantic AI is a Python SDK, not a model or a hosted AI service. Its central Agent abstraction brings together the parts an application needs to run an LLM interaction: instructions, callable tools or toolsets, an optional output type, an optional dependency type, a model, and model settings. The official agent guide describes agents as reusable components that can be instantiated once for an application or created dynamically.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problems- Instructions describe the agent’s role and constraints.
- Tools let the model request application-defined actions or information.
- Output typing is useful when downstream code needs a predictable structured result rather than free-form text.
- Dependencies provide application context or services to the agent’s execution without baking that context into its instructions.
- Model and settings determine which model is used and how the request is configured.
Type the inputs and outputs that matter to your application. This makes the intended contract clearer to readers, IDEs, and static type checkers. Keep the first version narrow: give the agent one job, only the tools it needs, and a structured output only if the next part of your program benefits from one.
#1 Best Overall
Install Pydantic AI and choose a model provider
The official installation guide documents the standard pydantic-ai package as including core dependencies and libraries for OpenAI, Anthropic, and Google models, plus integrations such as the CLI, MCP, Evals, Web UI, and Logfire. Provider-specific setup still depends on the provider and model you select; there is no single API key or model name that applies to every configuration.
- Check the current installation instructions. Follow the command on the official installation page rather than assuming it has not changed.
- Install the package and any needed extras. For providers or integrations not included in the standard package, the guide documents extras and gives
pydantic-ai[bedrock,temporal]as an example. It also describespydantic-ai-slimfor installations that select only the extras required. - Configure your chosen provider. Follow that provider’s current documentation for credentials, model identifiers, and usage rules. Keep credentials in your application’s secret-management mechanism rather than embedding them in source code.
- Pin the version used by your project. Record the exact package version in your dependency configuration so the code you deploy does not silently track a later release.
Do not add optional integrations just because they are available. A basic agent needs a supported model connection; observability, gateway access, and other integrations depend on your operational needs.
Rank #2
Define the agent’s contract before adding complexity
Write down what the agent should receive, what it may do, and what your program expects back. Then encode those boundaries in the agent’s instructions, tools, dependency type, and output type as appropriate. For example, an agent that classifies an incoming request may need a constrained result type; an agent that only drafts text may not.
Use dependencies for runtime context or application services that should be supplied by the calling program. Use tools for actions the model may choose to request. Neither makes an agent inherently reliable: validate consequential outputs and enforce permissions and business rules in application code, especially before a tool can change external state.
Choose how to run the agent
Pydantic AI documents several run interfaces in its agent guide. Choose based on the surrounding program and how much of the execution the caller needs to observe.
| Interface | Use it when | What the caller gets |
|---|---|---|
agent.run() |
Your application is asynchronous and can wait for completion. | A completed result. |
agent.run_sync() |
Your calling code needs synchronous execution. | A completed result. |
agent.run_stream() or agent.run_stream_sync() |
The interface should display generated text or structured output incrementally. | Streamed output. |
agent.run_stream_events() |
The application needs an event iterator rather than only a completed response. | A stream of execution events. |
agent.iter() |
The workflow needs stepwise access to the underlying graph. | Access to execution steps. |
For a basic asynchronous service, start with agent.run(). Choose streaming when a user interface benefits from showing progress as output arrives. Use iteration when step-level visibility or control is a real workflow requirement; it exposes more of the underlying execution than a typical request-response call needs.
When should you add capabilities or multiple agents?
Use a capability to reuse behavior
The official capabilities guide presents capabilities as composable units of behavior. A capability can provide tools, lifecycle hooks, instructions, model settings, or model selection. Simple instructions and settings can be supplied directly to an agent or agent spec; capabilities become useful when behavior goes beyond that configuration and needs to be reused or extended.
Recommended Free Tools
Use multiple agents only when their boundaries help
The multi-agent guide describes a progression from a single-agent workflow to delegation through a sub-agent tool, programmatic hand-off in application code, and graph-based control flow for more complex coordination. Choose the least complicated pattern that gives each responsibility a clear boundary. A single agent is often easier to understand; separate agents add coordination and more paths to inspect, so use them when distinct responsibilities or explicit control flow justify that cost.
Best Value
Observe execution and prepare for deployment
During development, inspect whether the agent is following the intended path, invoking the right tools, and returning the expected output. The installation guide points to Pydantic Logfire for observing agent behavior and describes a free tier; availability and terms can change. It also describes Pydantic AI Gateway as an optional way to access models from several providers with one API key. Neither service is required to build an agent.
Before deployment, check that your application handles provider errors and timeouts, validates outputs it relies on, and limits tools to actions the agent is authorized to request. Keep credentials and model configuration outside the agent’s user-facing instructions, and verify the package and provider setup against the current documentation. The official agent guide and examples are practical next steps for adapting the basic design to a specific application.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




