Local Development¶
Setup¶
Running¶
# Minimal (SQLite + in-process async)
uvicorn app.adapters.http.app:app --reload
# Full stack (Postgres + Redis + arq worker)
bash dev.sh
dev.sh starts Docker services, waits for Postgres to be ready, runs the DB migration, launches the arq worker, and starts uvicorn.
Note
dev.sh now runs everything inside Docker Compose. No host-side venv path configuration is needed.
Tests¶
Tests use httpx.TestClient — no running server needed. SQLite uses :memory: for isolation. Coverage requires ≥ 70%.
Curl tests¶
Runs end-to-end checks against a live server and writes results to tests/curl_results.md.
Useful commands¶
BASE=http://localhost:8000
curl $BASE/health
curl $BASE/ready
curl -H "X-API-Key: dev-key" $BASE/models
# Sync inference
curl -X POST $BASE/predict \
-H "X-API-Key: dev-key" -H "Content-Type: application/json" \
-d '{"model":"echo","version":"v1","data":"hello"}'
# Async inference
curl -X POST $BASE/predict/async \
-H "X-API-Key: dev-key" -H "Content-Type: application/json" \
-d '{"model":"echo","version":"v1","data":"hello"}'
curl $BASE/metrics
curl -H "X-API-Key: admin-key" $BASE/debug/models/loaded
curl -H "X-API-Key: admin-key" $BASE/admin/models/memory