Skip to content

Feature request: Make provider dependencies optional (don't force anthropic on OpenAI users) #3208

@MattiasHaughom

Description

@MattiasHaughom

Description

Issue:
pydantic-ai forces anthropic>=0.52.0 dependency on all users (via pydantic-ai-slim[anthropic]), even when only using OpenAI.

Current behavior:
pip install pydantic-ai[openai] # Still installs anthropic

Requested behavior:
pip install pydantic-ai[openai] # Only installs openai
pip install pydantic-ai[anthropic] # Only installs anthropic

Benefits:

  • Smaller dependency trees
  • Fewer version conflicts
  • Faster installs
  • Aligns with extras philosophy

Example implementation:
Make pydantic-ai-slim truly minimal (no providers), then add providers only via extras.

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalequestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions