Skip to content

Conversation

@demoray
Copy link
Contributor

@demoray demoray commented Dec 8, 2025

Title

Mitigate PydanticDeprecatedSince20 warnings

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

I did not implement unit tests, as the existing unit tests cover this functionality.

Type

🐛 Bug Fix

Changes

When using litellm with a recent pydantic, the following deprecation warnings are shown

litellm/types/llms/anthropic.py:531: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.12/migration/
  class AnthropicResponseContentBlockToolUse(BaseModel):
litellm/types/rag.py:181: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.12/migration/
  class RAGIngestRequest(BaseModel):

This aligns with multiple existing places within the litellm codebase that uses ConfigDict to configure pydantic model behavior.

When using litellm with a recent pydantic, the following deprecation warnings are shown

```
litellm/types/llms/anthropic.py:531: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.12/migration/
  class AnthropicResponseContentBlockToolUse(BaseModel):
litellm/types/rag.py:181: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.12/migration/
  class RAGIngestRequest(BaseModel):
```

This aligns with multiple existing places within the litellm codebase that uses ConfigDict to configure pydantic model behavior.
@vercel
Copy link

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Dec 8, 2025 3:49pm

@krrishdholakia krrishdholakia merged commit c9f88bf into BerriAI:main Dec 9, 2025
5 of 7 checks passed
@krrishdholakia
Copy link
Contributor

Thanks @demoray

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants