| What it is | A programming language for AI agents, with types that persist at runtime and built-in tests | Structured outputs from LLMs, validated with Pydantic | A Python library that guarantees LLM output matches a JSON schema, Pydantic model, regex or grammar | How Python does AI: agents, realtime voice, image generation, embeddings, typed end to end |
| Features | - programming language for AI agents that looks like TypeScript
- type system like Rust, with types kept at runtime and no any or unsafe casts
- typed, statically analyzed errors
- green threads and colorless concurrency like Go
- built-in tests and eval framework, and a standard library for agents
- call BAML functions from TypeScript, Python, Go, C#, Java and more through generated SDKs
- Boundary Cloud: hosted spans, profiles, dashboards, alerts and SQL queries over your BAML programs
| - extract structured data from LLM replies into Pydantic models
- validation with automatic retries
- streaming of partial objects and lists
- one interface for 15+ providers, including local models via Ollama
- async support and hooks
- CLI that opens and searches the docs
| - Constrains generation to a JSON schema or Pydantic model
- Regular expression constrained output
- Context-free grammar constrained output
- Multiple choice outputs
- Infers structure from function signatures
- Works with transformers, llama.cpp, vLLM, Ollama, OpenAI and Gemini
- Prompt templates
| - typed agent loop with validated outputs and tools
- many model providers, switched by model string, with fallback models
- MCP client capability
- Pydantic AI Harness: file system, shell, repo context, sub-agents and context management
- durable execution with Temporal, DBOS and Prefect
- realtime voice sessions
- Pydantic Evals for outputs and tool-call trajectories
- clai command-line chat
|