🎉 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-aiSee the Upgrade Guide for everything that's changed and the recommended path from V1.
What's Changed
🚀 Features
- Add
gemini-embedding-2embedding model by @dsfaccini in #5887 - Map AG-UI interrupts to
DeferredToolsinAGUIAdapterby @jjmllr in #5441 - Add
google_tasktext-prefix conditioning forgemini-embedding-2embeddings by @dsfaccini in #5894 - feat: add
xai_max_turnstoXaiModelSettingsby @manan-tech in #5978 - Pydantic AI V2 by @DouweM in #5451
🐛 Bug Fixes
- Don't send Gemini
function_calling_configwithout function declarations by @glendigity in #5791 - fix(openai): map image
UploadedFileparts toinput_imageby @Oxygen56 in #5809 - Fix unified
thinkinghandling for Groq qwen3 and Cerebrasgpt-ossby @dsfaccini in #5850 - Disallow non-finite
Evaluatoroutputs by @alexmojaki in #5863 - Fix
AnthropicModel.count_tokensdivergence onToolSearchToolreplay history by @dsfaccini in #5855 - Send
reasoning_contenton synthesized tool-call turns for DeepSeek thinking models by @adtyavrdhn in #5842 - Validate
UploadedFile.provider_namein tool returns and consolidate the guard intoModel._validate_uploaded_file_providerby @Oxygen56 in #5860 - Replay Cerebras
zai-glmreasoning in<think>tags and bump tozai-glm-4.7by @dsfaccini in #5891 - Retain dropped usage fields across
GoogleModelstreaming chunks by @dsfaccini in #5886 - Accumulate
output_audio_tokensinRunUsageby @HaozheZhang6 in #5904 - fix(output): validate union
kinddiscriminator in text output by @ret2libc in #5845 - fix(openai): prevent AG-UI stalls during multi-server MCP discovery by @cooleryu in #5443
- Forward
additionalModelRequestFieldsin Bedrockcount_tokensby @dsfaccini in #5910 - Fix
MCPToolset(http_client=...)crash on FastMCP'sfollow_redirectskwarg by @he-yufeng in #5694 - fix(cohere): forward
tool_choicefromModelSettingsto v2 chat API by @Julien-ser in #5833 - Route
max_tokenstomax_completion_tokensormax_tokensviaOpenAIModelProfileflag by @dsfaccini in #5926 - Forward
top_kmodel setting to BedrockadditionalModelRequestFieldsby @dsfaccini in #5922 - Fix
FallbackModeldeclaring an unassigned_model_namedataclass field by @dorukgezici in #5932 - fix(groq): add
groq_reasoning_effortsetting 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, deprecatecerebras_disable_reasoning, addcerebras_clear_thinkingby @dsfaccini in #5897
New Contributors
- @glendigity made their first contribution in #5791
- @Oxygen56 made their first contribution in #5809
- @HaozheZhang6 made their first contribution in #5904
- @ret2libc made their first contribution in #5845
- @cooleryu made their first contribution in #5443
- @jjmllr made their first contribution in #5441
- @strickvl made their first contribution in #5908
- @Julien-ser made their first contribution in #5833
- @MylittleQueercat made their first contribution in #5876
- @Kropiunig made their first contribution in #5928
- @Nukually made their first contribution in #5813
- @MakenRosa made their first contribution in #5997
- @manan-tech made their first contribution in #5978
- @MeloMei made their first contribution in #5950
- @kaxil made their first contribution in #5984
- @pranavmutatkar made their first contribution in #5991
- @Ghraven made their first contribution in #5971
- @bdpgmbv made their first contribution in #5957
Full Changelog: v2.0.0b7...v2.0.0