fastai-stack
Build production-ready, AI-first FastAPI backends in minutes.
fastai-stack is an interactive CLI generator for modern Python teams that want strongly typed APIs, async-first architecture, and built-in paths for LLM apps, embeddings, background jobs, observability, and container deployment.
Why fastai-stack
- AI-native backend scaffolding, not generic boilerplate
- FastAPI + Pydantic v2 conventions out of the box
- Opinionated project structure for scale and maintainability
- Interactive and non-interactive modes for both humans and CI
- One command to scaffold full backend architecture
Core Features
- Typer-based CLI with clean UX and smart defaults
- Jinja2 template engine with conditional generation
- Modular API layout (
app/api/v1/endpoints/*) - Pydantic settings model for environment-driven config
- Async-ready backend structure
- Optional AI endpoints for chat and embeddings
- Optional vector DB integration (
pgvector,weaviate) - Optional task queue support (
celery + redis) - Optional monitoring support (
sentry,prometheus) - Docker + Docker Compose with CPU/GPU profiles
- Poetry-based dependency management
- Test + CI scaffolding included
Install
pip install fastai-stack
Quick Start
Interactive Mode
fastai-stack create myapp --interactive
Non-Interactive Mode
fastai-stack create myapp \
--non-interactive \
--db postgres \
--auth jwt \
--tasks celery+redis \
--ai openai \
--vector-db pgvector \
--docker gpu \
--monitoring prometheus \
--frontend htmx+vite
CLI Options
fastai-stack create <project_name> [options]
--interactive / --non-interactive--db:postgres|mongodb|sqlite--auth:none|jwt|oauth2--tasks:none|celery+redis--ai:none|openai|langchain|huggingface--vector-db:none|pgvector|weaviate--docker:cpu|gpu--monitoring:none|sentry|prometheus--frontend:none|htmx+vite--output-dir <path>
Generated Project Structure
<project_slug>/
|- app/
| |- core/
| | |- config.py
| | |- deps.py
| | `- security.py
| |- api/v1/endpoints/
| | |- health.py
| | `- ai/ (optional)
| |- models/
| |- schemas/
| `- crud/
|- tests/
|- migrations/ (postgres)
|- docker-compose.yml
|- Dockerfile
|- .env.example
|- pyproject.toml
`- .github/workflows/ci.yml
AI Capabilities
- OpenAI chat endpoint template with SSE token streaming
- Embeddings endpoint starter template
- Hugging Face sentence-transformers friendly defaults
- LangChain-ready integration stubs
Dev Experience
- Consistent settings loading through
pydantic-settings - Clear separation of API, core, schemas, and crud layers
- Ready-to-run local development setup
- Starter tests for smoke validation
Local Development
poetry install
poetry run pytest
poetry run fastai-stack --help
Running a Generated App
Inside the generated project:
cp .env.example .env
poetry install
poetry run uvicorn app.main:app --reload
Open docs: http://127.0.0.1:8000/docs
Docker Usage
docker compose up --build
If you choose --docker gpu, the generated compose config includes NVIDIA device reservations.
Publishing This CLI
poetry build
poetry publish
Roadmap Direction
- Richer auth blueprints (fastapi-users full wiring)
- Production-ready DB model templates
- More AI provider templates and eval-ready scaffolds
- Full release automation for PyPI + GitHub Releases
License
MIT
Metadata
Release files for fastai-stack 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fastai_stack-0.1.1.tar.gz | 13.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastai_stack-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.3 kB
Release files / fastai_stack-0.1.1.tar.gz
| Download URL | fastai_stack-0.1.1.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f00127690b48a7d1752a9f9952d5476a17bde4e66d56c12da1b3ad14d9033d3
|
|
BLAKE2b-256 checksum How to use checksums |
111f80cc51a066eee3ce00831df223e38e2f80aa71d9ca942570f113403fde04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.10.10 Windows/10
|
Release files / fastai_stack-0.1.1-py3-none-any.whl
| Download URL | fastai_stack-0.1.1-py3-none-any.whl |
|---|---|
| Size | 20.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7da7a3822da9bb032757c7507ae7f3c2ec9d3104a255b27796f7d1b1196aae15
|
|
BLAKE2b-256 checksum How to use checksums |
1dfc160b7d0209cf65efac8ef59eb5e26a69265e33cc151ac5153c58c6293640
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.10.10 Windows/10
|