Skip to content

mfmezger/llm-engineering-template-github

Repository files navigation

LLM Engineering Template

Use this template Python 3.13+ License: MIT

A template for building LLM-powered applications with Python. This is the variant of the LLM Engineering Template that is not using copier but instead using a setup script which is better if you want to use the github template feature.

✨ Features

  • 🚀 FastAPI backend with automatic OpenAPI docs
  • 🔍 Phoenix for LLM observability and tracing
  • 📦 uv for fast, reliable package management
  • 🛠️ Pre-commit hooks with Ruff, mypy, and more
  • 🐳 Docker support with compose
  • 📚 MkDocs documentation setup
  • pytest with coverage reporting

🚀 Quick Start

Option 1: Use the Setup Script (Recommended)

  1. Click the "Use this template" button above to create your repo
  2. Clone your new repository
  3. Run the setup script:
./setup.sh

The script will prompt you for:

  • Module name (e.g., my_ai_app)
  • Your name and email
  • Python version (default: 3.13)

Option 2: Manual Setup

  1. Click "Use this template" to create your repo
  2. Clone your new repository
  3. Replace placeholders:
# Replace module name (use your actual module name)
find . -type f \( -name "*.py" -o -name "*.toml" -o -name "*.yml" -o -name "*.yaml" -o -name "Makefile" -o -name "Dockerfile" \) \
    -not -path "./.git/*" \
    -exec sed -i '' 's/your_module_name/my_project/g' {} +

# Rename the source directory
mv src/your_module_name src/my_project

# Update author info in pyproject.toml and LICENSE
  1. Install and run:
uv sync
cp template.env .env  # Edit with your API keys
uv run pre-commit install
make test

📁 Project Structure

.
├── src/your_module_name/     # Main application code
│   ├── api/                  # FastAPI endpoints
│   ├── llm.py               # LLM integration
│   ├── settings.py          # Configuration
│   └── instrumentation.py   # Observability setup
├── tests/                    # Test suite
├── docs/                     # Documentation
├── Makefile                  # Development commands
└── docker-compose.yml        # Container orchestration

🛠️ Development

Command Description
make setup Install dependencies and hooks
make style Run linting and formatting
make test Run tests with coverage
make mypy Run type checking
make start_backend Start FastAPI server
make restart Rebuild and restart Docker

📊 Technologies

Technology Purpose
uv Fast Python package manager
FastAPI Modern web framework
LiteLLM Universal LLM API
Phoenix LLM observability
Loguru Logging
Pydantic Data validation

📝 License

MIT License - see LICENSE for details.


🔗 Related Links

About

Template for GenAI Engineering.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published