{"data":{"slug":"pydantic-pydantic-ai","name":"pydantic-ai","tagline":"GenAI Agent Framework, the Pydantic way","github_url":"https://github.com/pydantic/pydantic-ai","owner":"pydantic","repo":"pydantic-ai","owner_avatar_url":"https://avatars.githubusercontent.com/u/110818415?v=4","primary_language":"Python","stars":18936,"forks":2455,"topics":["agent-framework","genai","llm","pydantic","python"],"archived":false,"github_pushed_at":"2026-08-01T04:46:56+00:00","maintenance_label":"Very active","url":"https://www.graphcanon.com/tools/pydantic-pydantic-ai","markdown_url":"https://www.graphcanon.com/tools/pydantic-pydantic-ai.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/pydantic-pydantic-ai","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=pydantic-pydantic-ai","description":"AI Agent Framework, the Pydantic way","homepage_url":"https://pydantic.dev/pydantic-ai","license":"MIT","open_issues":605,"watchers":114,"ai_summary":"Pydantic AI is a Python agent framework designed to build production-grade applications and workflows with Generative AI using Pydantic for robust validation.","readme_excerpt":"<div align=\"center\">\n  <a href=\"https://ai.pydantic.dev/\">\n    <picture>\n      <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://pydantic.dev/docs/ai/img/pydantic-ai-dark.svg\">\n      <img src=\"https://pydantic.dev/docs/ai/img/pydantic-ai-light.svg\" alt=\"Pydantic AI\">\n    </picture>\n  </a>\n</div>\n<div align=\"center\">\n  <h3>GenAI Agent Framework, the Pydantic way</h3>\n</div>\n<div align=\"center\">\n  <a href=\"https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml?query=branch%3Amain\"><img src=\"https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml/badge.svg?event=push\" alt=\"CI\"></a>\n  <a href=\"https://coverage-badge.samuelcolvin.workers.dev/redirect/pydantic/pydantic-ai\"><img src=\"https://coverage-badge.samuelcolvin.workers.dev/pydantic/pydantic-ai.svg\" alt=\"Coverage\"></a>\n  <a href=\"https://pypi.python.org/pypi/pydantic-ai\"><img src=\"https://img.shields.io/pypi/v/pydantic-ai.svg\" alt=\"PyPI\"></a>\n  <a href=\"https://github.com/pydantic/pydantic-ai\"><img src=\"https://img.shields.io/pypi/pyversions/pydantic-ai.svg\" alt=\"versions\"></a>\n  <a href=\"https://github.com/pydantic/pydantic-ai/blob/main/LICENSE\"><img src=\"https://img.shields.io/github/license/pydantic/pydantic-ai.svg?v\" alt=\"license\"></a>\n  <a href=\"https://logfire.pydantic.dev/docs/join-slack/\"><img src=\"https://img.shields.io/badge/Slack-Join%20Slack-4A154B?logo=slack\" alt=\"Join Slack\" /></a>\n</div>\n\n---\n\n**Documentation**: [ai.pydantic.dev](https://ai.pydantic.dev/)\n\n---\n\n### <em>Pydantic AI is a Python agent framework designed to help you quickly, confidently, and painlessly build production grade applications and workflows with Generative AI.</em>\n\n\nFastAPI revolutionized web development by offering an innovative and ergonomic design, built on the foundation of [Pydantic Validation](https://docs.pydantic.dev) and modern Python features like type hints.\n\nYet despite virtually every Python agent framework and LLM library using Pydantic Validation, when we began to use LLMs in [Pydantic Logfire](https://pydantic.dev/logfire), we couldn't find anything that gave us the same feeling.\n\nWe built Pydantic AI with one simple aim: to bring that FastAPI feeling to GenAI app and agent development.\n\n## Why use Pydantic AI\n\n1. **Built by the Pydantic Team**:\n[Pydantic Validation](https://docs.pydantic.dev/latest/) is the validation layer of the OpenAI SDK, the Google ADK, the Anthropic SDK, LangChain, LlamaIndex, AutoGPT, Transformers, CrewAI, Instructor and many more. _Why use the derivative when you can go straight to the source?_ :smiley:\n\n2. **Model-agnostic**:\nSupports virtually every [model](https://ai.pydantic.dev/models/overview) and provider: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and Perplexity; Azure AI Foundry, Amazon Bedrock, Google Cloud, Ollama, LiteLLM, Groq, OpenRouter, Together AI, Fireworks AI, Cerebras, Hugging Face, GitHub, Heroku, Vercel, Nebius, OVHcloud, Alibaba Cloud, SambaNova, and Z.AI. If your favorite model or provider is not listed, you can easily implement a [custom model](https://ai.pydantic.dev/models/overview#custom-models).\n\n3. **Seamless Observability**:\nTightly [integrates](https://ai.pydantic.dev/logfire) with [Pydantic Logfire](https://pydantic.dev/logfire), our general-purpose OpenTelemetry observability platform, for real-time debugging, evals-based performance monitoring, and behavior, tracing, and cost tracking. If you already have an observability platform that supports OTel, you can [use that too](https://ai.pydantic.dev/logfire#alternative-observability-backends).\n\n4. **Fully Type-safe**:\nDesigned to give your IDE or AI coding agent as much context as possible for auto-completion and [type checking](https://ai.pydantic.dev/agents#static-type-checking), moving entire classes of errors from runtime to write-time for a bit of that Rust \"if it compiles, it works\" feel.\n\n5. **Powerful Evals**:\nEnables you to systematically test and [evaluate](https://ai.pydantic.dev/evals) the performance and a","github_created_at":"2024-06-21T15:55:04+00:00","created_at":"2026-07-07T22:36:43.479433+00:00","updated_at":"2026-08-01T06:00:44.351157+00:00","categories":[{"slug":"ai-agents","name":"AI Agents","url":"https://www.graphcanon.com/categories/ai-agents","markdown_url":"https://www.graphcanon.com/categories/ai-agents.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/ai-agents"}],"tags":[{"slug":"agent-framework","name":"agent-framework"},{"slug":"genai","name":"genai"},{"slug":"llm","name":"llm"},{"slug":"pydantic","name":"pydantic"},{"slug":"python","name":"python"}],"trust":{"provenance":{"is_fork":false,"github_id":818331198,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-01T06:00:43.516Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":30,"days_since_push":0,"last_release_at":"2026-08-01T02:27:46Z"},"security_summary":{"status":"findings","scanner":"mcp_manifest@v1","low_count":2,"high_count":0,"last_scan_at":"2026-07-11T10:28:51.345Z","medium_count":0,"scan_profile":"mcp_manifest","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-01T06:00:43.956Z"},"has_cli":{"value":true,"source":"pyproject.toml:[project.scripts]","observed_at":"2026-08-01T06:00:43.956Z"},"languages":{"value":["python"],"source":"github.language+pyproject.toml","observed_at":"2026-08-01T06:00:43.956Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-08-01T06:00:43.956Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["Use Pydantic AI when you are looking to build GenAI apps and agents in Python, especially if your team has expertise or a preference for Pydantic, as it is built directly by the Pydantic development团队","考虑使用Pydantic AI当需要支持广泛的模型和提供商时，包括几乎所有主要的生成式AI服务和云平台。你可以轻松地实现自定义模型以适应特定需求。","选择Pydantic AI可无缝集成实时调试、性能监控以及行为追踪等功能，适用于寻求全面可观测性解决方案的企业"],"when_not_to_use":["如果你正在寻找不依赖于Pydantic的框架，则可能不适合使用Pydantic AI，因为它的设计深深植根于Pydantic的数据验证机制中。","如果你的应用需求仅限少数几个特定的模型或提供商，并不需要广泛的支持度，那么Pydantic AI可能功能过于冗余。"],"source":"enrich:decision_facts","observed_at":"2026-07-11T11:01:03.264Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"Pydantic AI is a Python framework for developing production-grade applications with Generative AI using the robust validation offered by Pydantic."}]}}