Contributing
We'd love you to contribute to Pydantic AI!
Installation and Setup
Clone your fork and cd into the repo directory
git clone git@github.com:<your username>/pydantic-ai.git cd pydantic-ai Install uv (version 0.4.30 or later), pre-commit and deno:
To install pre-commit you can run the following command:
uv tool install pre-commit For deno, you can run the following, or check their documentation for alternative installation methods:
curl -fsSL https://deno.land/install.sh | sh Install pydantic-ai, all dependencies and pre-commit hooks
make install Running Tests etc.
We use make to manage most commands you'll need to run.
For details on available commands, run:
make help To run code formatting, linting, static type checks, and tests with coverage report generation, run:
make Documentation Changes
To run the documentation page locally, run:
uv run mkdocs serve Rules for adding new models to Pydantic AI
To avoid an excessive workload for the maintainers of Pydantic AI, we can't accept all model contributions, so we're setting the following rules for when we'll accept new models and when we won't. This should hopefully reduce the chances of disappointment and wasted work.
- To add a new model with an extra dependency, that dependency needs > 500k monthly downloads from PyPI consistently over 3 months or more
- To add a new model which uses another models logic internally and has no extra dependencies, that model's GitHub org needs > 20k stars in total
- For any other model that's just a custom URL and API key, we're happy to add a one-paragraph description with a link and instructions on the URL to use
- For any other model that requires more logic, we recommend you release your own Python package
pydantic-ai-xxx, which depends onpydantic-ai-slimand implements a model that inherits from ourModelABC
If you're unsure about adding a model, please create an issue.