← All projects
Developer building blocks

Pydantic AI

A Python toolkit for building dependable AI agents and features that work with almost any AI model.

What it does

Pydantic AI is a code library for adding AI to Python programs. Developers build an "agent", an AI model with instructions and tools, and can switch between AI providers by changing one line. It checks that the AI's answers come back in exactly the shape the program expects, which helps prevent errors.

The same agent can run behind a website, in a terminal, on a live voice call, in a background job that survives crashes, or in GitHub Actions. It also covers image generation and embeddings (number-based representations of meaning used for search).

Companion projects add memory, guardrails, a full coding agent and tools for grading an agent's results. Pydantic also offers paid monitoring and model-gateway services.

Who it's for

Python developers building AI features or agents.

Can I use it without coding?

Developers only. A Python library for programmers. New to this? Start here.

Can I run it?

Cost
FreeNothing to pay or sign up for.
API key
Not needed

Try it

Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?

Before you install

  • Only download from the official GitHub page. Copies with similar names exist for many popular projects.
  • License (MIT): Very permissive: free to use, change and share, including for business.
  • More on staying safe

Where people are talking about it