A starter structure for AI / ML / Data-Science projects. Two patterns are supported: a single-service layout for one focused product, and a multi-service monorepo for projects that may grow into several backend services behind a unified frontend.
This repo is a GitHub template. Click "Use this template" to create a new repo from it, then run one of the bootstrap scripts.
-
Click "Use this template" → "Create a new repository" at the top of this page.
-
Clone your new repo locally.
-
Go into the Project. Pick a pattern and run the matching bootstrap script:
cd AI-Project-Template # Single-service: one focused product, one Python package. chmod +x bootstrap_single.sh bash bootstrap_single.sh # Multi-service: monorepo of independent backend services. chmod +x bootstrap_multi.sh bash bootstrap_multi.sh
Each script is idempotent — it lays down folders, stub files,
.gitignore,.env.example, and a runnable Flask + gunicorn skeleton. -
Rename the placeholder (
your_pkgfor single-service,service_afor multi-service) to your real package or service name. Use a valid Python identifier — lowercase, no hyphens. -
Set up the venv and verify it runs:
cd backend python -m venv venv source venv/bin/activate pip install -r requirements.txt # Dev server (single-service): flask --app your_pkg.api.main run --host 0.0.0.0 --port 8000 # OR more production-ready gunicorn --bind 127.0.0.1:8000 your_pkg.api.main:app # Dev server (multi-service): flask --app service_a.api.main run --host 0.0.0.0 --port 8000 # OR more production-ready gunicorn --bind 127.0.0.1:8000 service_a.api.main:app
Then in an other terminal verify response:
# Multi architecture curl http://localhost:8000/service_a/health # Single architecture curl http://localhost:8000/your_pkg/health
You should get
{"status": "ok"}. -
Replace this README with one for your actual project.
The full layout, conventions, and rationale (why services are siblings, why models/ is split from ml_models/, where databases fit, etc.) are documented in docs/:
docs/single-service-project-structure.mddocs/multi-service-project-structure.md*-toml.mdvariants of each, for projects that prefer a minimalpyproject.toml.
Defaults baked into the bootstraps: Flask + gunicorn, requirements.txt (no pyproject.toml), flat layout (no src/ folder), one venv per area.
MIT — see LICENSE.