Summary
Pydantic AI is a Python framework for building typed LLM agents, with structured outputs, validated tools and a model layer you swap with a string. A companion Harness package adds filesystem, shell, sub-agent and context-management capabilities, plus ready-made Coder and Researcher agents.
- Best for
- Python teams building type-safe agents who also want realtime voice, image generation and embeddings in one SDK, with optional durable execution via Temporal, DBOS, Prefect or Restate.
- Not for
- Teams that want built-in, zero-infrastructure durable or checkpointed workflow state without standing up a separate orchestrator, that need LangGraph-depth native graph-branching control as the core of the framework itself, or that want a single vendor-hosted managed runtime for production agents.
- From
- Free
- Free tier
- YesThe framework is free without limit: MIT-licensed, installed from PyPI, with no account, key or card required - the built-in 'test' model runs an agent offline before you hold any provider credential. Costs arise only from the model provider you configure, or from the optional paid Logfire platform.
What it does
- Writes code
- YesThe first-party Harness package ships Coder, a combined capability giving an agent workspace-rooted read/write/edit/search file tools plus an allowlisted shell.
Coder gives a Pydantic AI agent a complete, opinionated stack for working in a local codebase.
pydantic.dev/docs/ai/harness/coder - Debugs and fixes
- YesThe harness is written for exactly this: an agent with files, shell and planning turned loose to fix a codebase over a long session.
set an agent loose on complex, long-running work (fix a codebase, research a question, run for hours unattended)
pydantic.dev/docs/ai/harness - Reviews code
- PartlyReview comes from the third-party Macroscope CLI, which you must install and authenticate yourself; the capability surfaces findings only and the agent fixes them with its own tools.
Macroscope runs a local Macroscope code review from inside an agent: one tool shells out to the installed macroscope CLI, parses the streamed…
pydantic.dev/docs/ai/harness/macroscope - Whole-codebase work
- PartlyRepo-wide orientation and context management for long sessions are documented (RepoContext, compaction, a read-only explorer sub-agent), but no page claims a repository-wide migration as an outcome.
workspace-rooted file access, allowlisted shell, repo orientation, planning, and context management that survives long sessions
pydantic.dev/docs/ai/overview - Ships it
- PartlyIt stops at the working tree: it runs whatever commands you allowlist in the workspace, and no deploy, release or pull-request step is documented.
Shell: allowlisted commands rooted at the workspace (a guardrail, not a security boundary), with common LLM provider API-key variables filtered from…
pydantic.dev/docs/ai/harness/coder - Done-for-you service
- NoYou run the software: Pydantic AI is a package you install, and the product page offers installation rather than a team that builds or operates agents for you.
Open source (under MIT license). Install with uv (or pip) and start building production-grade AI applications today.
pydantic.dev/pydantic-ai
Not established: Writes tests
How much it does unattended
- Runs autonomously
- YesRuns are designed to continue without a person present, with durable-execution backends carrying them across restarts and approval gates available when you want one.
Agents survive restarts and run for days on the engine you already operate, with human-in-the-loop approval built in.
pydantic.dev/docs/ai/overview - Multi-agent
- YesOne delegate_task tool exposes named child agents, each running in its own message history; Coder ships with a read-only explorer sub-agent by default.
SubAgents lets an agent delegate self-contained tasks to named child agents. It takes a sequence of SubAgent entries and exposes a single…
pydantic.dev/docs/ai/harness/subagents - Agent permissions
- PartlyYou choose the ceiling: shell tools take allow/deny lists and default only to a destructive-command denylist, and individual tools can be marked as requiring human approval.
By default Shell runs in the current directory with the built-in destructive-command denylist active -- Shell() alone is a working (if permissive)…
pydantic.dev/docs/ai/harness/shell
Which models it runs on
- Claude
- YesAnthropicModel ships in the base install; Claude models are also reachable through Bedrock, Vertex and the Gateway.
To use AnthropicModel models, you need to either install pydantic-ai, or install pydantic-ai-slim with the anthropic optional group
pydantic.dev/docs/ai/models/anthropic - GPT
- YesOpenAIChatModel ships in the base install and doubles as the client for any OpenAI-compatible endpoint.
To use OpenAI models or OpenAI-compatible APIs, you need to either install pydantic-ai, or install pydantic-ai-slim with the openai optional group
pydantic.dev/docs/ai/models/openai - Open models
- YesOpen-weight models run through the first-party Ollama, Hugging Face, Groq, Cerebras and OpenRouter integrations, including a local Ollama server.
Pydantic AI supports both self-hosted Ollama servers (running locally or remotely) and Ollama Cloud.
pydantic.dev/docs/ai/models/ollama - Model choice
- YesYou pick: a model is a provider:model string you swap, and unsupported APIs can be added by subclassing Model.
Pydantic AI is model-agnostic and has built-in support for multiple model providers
pydantic.dev/docs/ai/models/overview
Where you use it
- In your editor
- PartlyAn editor surface exists over the Agent Client Protocol for editors such as Zed, but it is shipped as experimental and the docs say it may be removed in any release without a deprecation period.
run_acp_stdio serves any Pydantic AI Agent as an ACP agent over stdin/stdout. The editor launches your script as a subprocess and talks to it
pydantic.dev/docs/ai/harness/acp - On the command line
- YesThe clai CLI chats with any model or any agent you can import, and agent.to_cli_sync() turns your own agent into a terminal app.
Pydantic AI comes with a CLI, clai (pronounced "clay"). You can use it to chat with various LLMs and quickly get answers, right from the command line
pydantic.dev/docs/ai/integrations/cli - In your pipeline
- NoThe surface table enumerates code, terminal, web chat, your frontend, editors and voice; nothing acts on a pull request or in CI, and the roadmap line names messaging channels and API endpoints as what is still missing.
More surfaces are on the way; follow the roadmap discussions for messaging channels and API endpoints.
pydantic.dev/docs/ai/overview/interfaces - In a browser
- Yesagent.to_web() and clai web serve a browser chat for any agent; the same page scopes it to local development and points production frontends at the UI event-stream protocols.
Pydantic AI includes a built-in web chat interface that you can use to interact with your agents through a browser.
pydantic.dev/docs/ai/guides/web
Whose machine it runs on
- Self-hosted
- YesIt is a library in your own process, so the runtime is yours; the Gateway and Logfire also publish self-hosted deployments if you use them.
A Pydantic AI agent is plain Python with no interface baked in: the same agent can run headless inside your backend, chat in a terminal, serve a web…
pydantic.dev/docs/ai/overview/interfaces - Open source
- YesMIT-licensed, developed in the open at github.com/pydantic/pydantic-ai, and installable from PyPI.
Open source (under MIT license). Install with uv (or pip) and start building production-grade AI applications today.
pydantic.dev/pydantic-ai
What it costs to run
- How it meters
- YesThe framework itself meters nothing; you pay whichever model provider you configure, and the optional Gateway is free on your own keys or a percentage markup on its built-in providers.
Bring your own provider credentials (BYOK): free on every plan, no markup
pydantic.dev/ai-gateway - Free tier
- YesNo call, no account, no card: install the package and exercise an agent offline against the built-in test model before you hold any provider key.
You don't need a provider API key to try any of this. Pass the built-in 'test' model (Agent('test')), which runs entirely offline without calling an…
pydantic.dev/docs/ai/overview - API access
- YesThe library is the interface - an awaitable in your own Python - and AG-UI or Vercel AI event streams expose a running agent over HTTP to any frontend.
Stream text, tool calls, and reasoning to your frontend as they happen. Pydantic AI offers out of the box support for AG-UI protocol for standardized…
pydantic.dev/pydantic-ai - MCP server
- YesBoth directions are documented: an agent can consume MCP servers, and an agent wrapped in an MCP server can be called by any MCP client, with sampling support.
This server can be queried with any MCP client.
pydantic.dev/docs/ai/mcp/server - Bring your own key
- YesProvider keys are yours by default - the library reads them from your environment - and the Gateway keeps BYOK as a first-class path alongside its own billed providers.
BYOK and managed providers: Bring your own API keys (BYOK) from LLM providers, or pay for inference directly through the platform.
pydantic.dev/docs/ai/overview/gateway
Buying it for a team
- A company can buy it
- PartlyThere is nothing to buy for the framework itself; purchasing applies to the surrounding Logfire platform, which is sold to organisations from a paid team plan up to Enterprise.
For organizations where observability has to pass security review.
pydantic.dev/pricing - Seat model
- PartlyThe framework has no seats. Logfire's Team plan includes five and caps at twelve at $25 each, while Growth and Enterprise are flat-price with unlimited seats.
Admin or member seats for you & your core team. 5 seats included, $25/extra seat.
pydantic.dev/pricing - Pooled budget
- PartlyGateway budgets are pooled by scope you choose - project, user or key - rather than per seat; in the OSS harness, SpendLimits can share one spend counter across worker processes.
Cost Limits: Set spending limits at project, user, and API key levels with daily, weekly, and monthly caps.
pydantic.dev/docs/ai/overview/gateway - Admin controls
- PartlyConstraints are code, not a console: guardrail callables gate prompts, tool calls and outputs, alongside shell allowlists, tool approval and spend limits. Role-based control arrives only with Logfire Enterprise.
Guardrails put a validation layer on the three edges of an agent run: the prompt on its way in to the model, the tool calls the model makes along the…
pydantic.dev/docs/ai/harness/guardrails - Audit log
- PartlyModel traffic through the Gateway can be logged to Logfire or any OpenTelemetry backend as a central trail; an administrative audit-log API is listed only on Logfire Enterprise.
Log every request through Pydantic Logfire or any OTel backend. Create a centralized audit trail where no API usage can hide.
pydantic.dev/ai-gateway - Single sign-on
- PartlySAML and OIDC exist but sit on Logfire Enterprise in the plan comparison, which marks SSO absent on Personal, Team and Growth.
Bring your identity provider — first-party integrations for the common IDPs and generic SAML for the rest.
pydantic.dev/pricing
What happens to your code
- Opt out of training
- PartlyNo training-opt-out toggle is published, and none is needed for the library itself, which sends prompts straight to the provider you configure. Where Pydantic is in the path, the Gateway terms license your content only to operate the Gateway, and provider terms govern the provider leg.
You grant Pydantic a limited, non‑exclusive license to process Customer Content solely to provide, secure, troubleshoot, and improve the Gateway
pydantic.dev/legal/terms-of-service - Data residency
- PartlyThe library holds nothing, so residency is yours. If you send telemetry to Logfire, you choose a US or EU region at signup; regions are strictly separated and migration between them is not available.
Logfire is hosted in two separate geographic regions to provide you with options for data residency, compliance with local regulations, and optimal…
pydantic.dev/docs/logfire/manage/data-r… - Getting out
- PartlyPrepaid Gateway credits are non-refundable and expire after twelve months of account dormancy; Logfire data is exportable over its query API and Growth adds self-serve deletion.
Gateway Credits will expire if your Account remains dormant (inactive) for a period of twelve (12) months.
pydantic.dev/legal/terms-of-service - Certifications
- PartlyThe certifications cover the hosted platform, not the library: SOC 2 Type 2 audited, GDPR with a DPA, and HIPAA under a signed BAA, with the report itself behind a document request.
SOC 2 Type 2 — Type 2 audited Independently audited controls for security, availability, and confidentiality.
pydantic.dev/security
34 sourced claims on this page. Checked 2026-09-02. How we check.
Alternatives
Where we would send a reader instead, in that listing's own words.
Open source agent frameworks plus LangSmith, the platform for tracing, evaluating and deploying agents.
Open-source multi-agent framework with a governed enterprise runtime for building and operating agent workflows.
Python SDK, open-source AgentOS runtime and hosted control plane for building and operating agents.
Open-source orchestration framework and runtime for stateful, long-running LLM agents, from LangChain.
Filed under
Sources and updates
The pages we read27
1 of 27 independent of the vendor.
- pydantic.dev/docs/ai/overview5 fields
- pydantic.dev/docs/ai/overview/interfaces5 fields
- pydantic.dev/docs/ai/models/overview4 fields
- pydantic.dev/pricing4 fields
- pydantic.dev/docs/ai/harness/coder3 fields
- pydantic.dev/enterprise3 fields
- pydantic.dev/pydantic-ai3 fields
- pydantic.dev/ai-gateway2 fields
- pydantic.dev/docs/ai/harness2 fields
- pydantic.dev/docs/ai/harness/shell2 fields
- pydantic.dev/docs/ai/overview/gateway2 fields
- pydantic.dev/legal/terms-of-service2 fields
- pydantic.dev/docs/ai/core-concepts/message-history1 field
- pydantic.dev/docs/ai/guides/web1 field
- pydantic.dev/docs/ai/harness/acp1 field
- pydantic.dev/docs/ai/harness/guardrails1 field
- pydantic.dev/docs/ai/harness/macroscope1 field
- pydantic.dev/docs/ai/harness/spend1 field
- pydantic.dev/docs/ai/harness/subagents1 field
- pydantic.dev/docs/ai/integrations/cli1 field
- pydantic.dev/docs/ai/mcp/server1 field
- pydantic.dev/docs/ai/models/anthropic1 field
- pydantic.dev/docs/ai/models/ollama1 field
- pydantic.dev/docs/ai/models/openai1 field
- pydantic.dev/docs/logfire/manage/data-regions1 field
- api.github.com/repos/pydantic/pydantic-aiPlatform record1 field
- pydantic.dev/security1 field
Platform record2026-08-30
- Licence
- MIT
- Stars
- 19,584
- Forks
- 2,617
- Last push
- 2026-08-30
Updates3
- Capabilities · Commercial terms · Free tier
- Capabilities · Commercial terms · Free tier
- Alternatives · One-liner · Summary · Website
