mirror of
https://github.com/danagble/backend.git
synced 2026-11-16 02:50:22 +00:00
61 lines
2 KiB
YAML
61 lines
2 KiB
YAML
# Non-secret backend configuration. Secrets ONLY in .env.
|
|
# Rule: .env decides WHO/WHERE (credentials, hosts), yaml decides HOW (layout, ttl, thresholds).
|
|
app:
|
|
name: danagble
|
|
api_prefix: /api/v1
|
|
|
|
api:
|
|
default_page_size: 50
|
|
max_page_size: 200
|
|
upload_max_mb: 50
|
|
|
|
database:
|
|
pool_size: 10
|
|
max_overflow: 10
|
|
|
|
storage:
|
|
bucket_default: danagble
|
|
# Reference quota for the sidebar meter (R2 free tier = 10 GiB).
|
|
quota_bytes: 10737418240
|
|
# R2 key layout. {project} = project slug, {image} = image id.
|
|
layout:
|
|
image: "datasets/{project}/{image}-{filename}"
|
|
thumbnail: "datasets/{project}/thumbs/{image}.jpg"
|
|
export: "artifacts/exports/{project}/{file}"
|
|
model: "models/{name}/{version}.pt"
|
|
embedding: "artifacts/embeddings/{project}/{image}.npy"
|
|
presigned_ttl:
|
|
put_seconds: 900 # upload direct-to-R2
|
|
get_seconds: 3600 # preview/download
|
|
export_seconds: 86400
|
|
# Free-tier guardrails: small thumbs, embedding cache, no proxy of full images.
|
|
thumbnail:
|
|
enabled: true
|
|
max_side: 512
|
|
quality: 70
|
|
|
|
tasks:
|
|
classification: { version: 1 }
|
|
object_detection: { version: 1 }
|
|
segmentation: { version: 1 }
|
|
# voice: reserved for later (audio schema + sampler)
|
|
|
|
ai:
|
|
enabled: true
|
|
# registry only; heavy weights live on worker hosts, never in git.
|
|
models:
|
|
- { name: sam-vit-b, kind: segment, device: cpu, max_side: 1024, default: true }
|
|
- { name: yolo-detect-m, kind: detect, device: cpu, conf_min: 0.35 }
|
|
- { name: clf-resnet50, kind: classify, device: cpu }
|
|
cache_embeddings: true # SAM image embedding reuse across point/box prompts
|
|
|
|
# Placeholder for the future traffic/monitoring layer (see src/middlewares/traffic.py).
|
|
# Phase 1: in-process counters only. Phase 2: Prometheus + Grafana, R2 request accounting.
|
|
traffic:
|
|
enabled: true
|
|
log_slow_ms: 800
|
|
# Per-route R2 op budget alerts (Class A writes / Class B reads), enforced later.
|
|
r2_budgets: { class_a_warn: 800000, class_b_warn: 8000000 }
|
|
|
|
export:
|
|
formats: [coco_json, yolo_txt, labelme_json, mask_png]
|