Repository navigation
API Reference
Full interactive API documentation: http://localhost:8000/docs (Swagger UI) ReDoc alternative: http://localhost:8000/redoc
All endpoints are under /api/v1/.
Check if setup is complete.
{ "completed": true, "env_exists": true, "configured_keys": ["CUDA_DEVICE", "..."] }Read current .env configuration. Sensitive keys are redacted.
Write settings to .env.
{
"settings": {
"CUDA_DEVICE": "cuda:0",
"VRAM_LIMIT_GB": "8.0",
"ENVIRONMENT": "development"
},
"mark_setup_complete": true
}Run dependency check. Returns list of check items.
Docker availability, group membership, running containers.
Start annotation container stack.
{ "profile": "annotation" }Model catalog with present/missing status. Returns list[ModelInfo].
Start background model download. Returns task ID.
{ "model_id": "yolo11s" }Poll download progress.
{
"task_id": "abc-123",
"status": "downloading",
"progress": 67,
"filename": "yolo11s.pt",
"size_mb": 18.4,
"downloaded_mb": 12.3,
"detail": "Downloading… 12.3 / 18.4 MB"
}Create Label Studio account.
{ "url": "http://localhost:3005", "email": "admin@example.com", "password": "secret" }Response:
{ "ok": true, "token": "abc123...", "already_existed": false }Test Label Studio connection and authentication.
Create trichome annotation project with pre-built label config.
Live health check of all configured services. Returns latency + HTTP status per service.
Analyze an uploaded image.
curl -X POST http://localhost:8000/api/v1/detection/analyze \\
-F "image=@IMG_0001.tif" \\
-F "model=yolo11s" \\
-F "tiled=true" \\
-F "conf=0.25"Response:
{
"job_id": "xyz-456",
"status": "queued",
"estimated_seconds": 8
}Poll detection job status.
Retrieve detection results (JSON).
{ "config": "yolo11s_detection.yaml", "dataset": "v1" }List all training jobs with status.
Stop a running training job.
{ "status": "ok", "gpu_available": true, "gpu_busy": false }{
"name": "NVIDIA GeForce RTX 4060",
"vram_total_gb": 8.0,
"vram_used_gb": 2.3,
"vram_free_gb": 5.7,
"utilization_pct": 0
}All WebSockets at ws://localhost:8000/ws/:
| Endpoint | Data stream |
|---|---|
/ws/training |
Live training metrics (loss, mAP, epoch) |
/ws/system |
GPU/RAM usage every 2s |
/ws/jobs |
Background job progress updates |
/ws/logs |
Live log stream |
// Example: live GPU monitoring
const ws = new WebSocket('ws://localhost:8000/ws/system');
ws.onmessage = (e) => {
const { vram_used_gb, utilization_pct } = JSON.parse(e.data);
console.log(vram_used_gb, utilization_pct);
};CTIP — Cannabis Trichome Intelligence Platform · RTX 4060 / 8 GB VRAM · Backend API · MLflow · Label Studio
Installation & Setup
Scientific Workflow
Reference