Skip to content

A template for building Python apps with PydanticAI, uv, Docker, logging via Logfire.

Notifications You must be signed in to change notification settings

cherninlab/pydantic-ai-starter

Repository files navigation

Pydantic AI Starter

CI License

This is a minimal starter project for PydanticAI, using uv to manage installations and run commands.

Open in GitPod

Need inspiration? Check out the official Pydantic AI Examples.

Table of contents

  1. Requirements
  2. Getting Started
  3. Usage
  4. Docker / Docker Compose
  5. Development & CI
  6. License

Requirements

Getting Started

Clone this repository and install dependencies:

git clone https://github.com/cherninlab/pydantic-ai-starter.git
cd pydantic-ai-starter
uv sync

By default, uv sync reads pyproject.toml and installs the [project] dependencies.

Usage

Run the main script:

uv run --env-file .env -- python -m pydantic_ai_starter

API Providers

This starter installs multiple providers via pydantic-ai-slim extras:

  • openai
  • anthropic
  • mistral
  • groq
  • logfire

Configure your keys (if needed)

Docker / Docker Compose

  1. Build with Docker:
docker-compose build
  1. Run:
docker-compose up

This will run __main__.py by default inside the container.

Development & CI

  • GitHub Actions in .github/workflows/CI.yml for linting (pre-commit)
  • Pre-commit config in .pre-commit-config.yaml
  • Example test in tests/test_example.py

License

MIT

Happy coding with PydanticAI! 🚀

About

A template for building Python apps with PydanticAI, uv, Docker, logging via Logfire.

Topics

Resources

Stars

Watchers

Forks