github pydantic/pydantic-ai v2.0.0
v2.0.0 (2026-06-23)

5 hours ago

🎉 Pydantic AI V2.0 is here!

After seven betas, Pydantic AI V2 is now stable. V2 leans into a harness-first design with capabilities as a core primitive — a single composable unit that bundles an agent's tools, hooks, instructions, and model settings, reaching every layer of the agent through one concept.

Install it with:

uv add pydantic-ai

See the Upgrade Guide for everything that's changed and the recommended path from V1.


What's Changed

🚀 Features

🐛 Bug Fixes

  • Don't send Gemini function_calling_config without function declarations by @glendigity in #5791
  • fix(openai): map image UploadedFile parts to input_image by @Oxygen56 in #5809
  • Fix unified thinking handling for Groq qwen3 and Cerebras gpt-oss by @dsfaccini in #5850
  • Disallow non-finite Evaluator outputs by @alexmojaki in #5863
  • Fix AnthropicModel.count_tokens divergence on ToolSearchTool replay history by @dsfaccini in #5855
  • Send reasoning_content on synthesized tool-call turns for DeepSeek thinking models by @adtyavrdhn in #5842
  • Validate UploadedFile.provider_name in tool returns and consolidate the guard into Model._validate_uploaded_file_provider by @Oxygen56 in #5860
  • Replay Cerebras zai-glm reasoning in <think> tags and bump to zai-glm-4.7 by @dsfaccini in #5891
  • Retain dropped usage fields across GoogleModel streaming chunks by @dsfaccini in #5886
  • Accumulate output_audio_tokens in RunUsage by @HaozheZhang6 in #5904
  • fix(output): validate union kind discriminator in text output by @ret2libc in #5845
  • fix(openai): prevent AG-UI stalls during multi-server MCP discovery by @cooleryu in #5443
  • Forward additionalModelRequestFields in Bedrock count_tokens by @dsfaccini in #5910
  • Fix MCPToolset(http_client=...) crash on FastMCP's follow_redirects kwarg by @he-yufeng in #5694
  • fix(cohere): forward tool_choice from ModelSettings to v2 chat API by @Julien-ser in #5833
  • Route max_tokens to max_completion_tokens or max_tokens via OpenAIModelProfile flag by @dsfaccini in #5926
  • Forward top_k model setting to Bedrock additionalModelRequestFields by @dsfaccini in #5922
  • Fix FallbackModel declaring an unassigned _model_name dataclass field by @dorukgezici in #5932
  • fix(groq): add groq_reasoning_effort setting by @Oxygen56 in #5797
  • fix: use running loop in chat app example by @Ghraven in #5971
  • fix(cohere): forward usage.cached_tokens as cache_read_tokens by @bdpgmbv in #5957
  • fix(mistral): forward penalties in completions by @he-yufeng in #5695
  • Emit reasoning_effort='none' for Cerebras, deprecate cerebras_disable_reasoning, add cerebras_clear_thinking by @dsfaccini in #5897

New Contributors

Full Changelog: v2.0.0b7...v2.0.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.