feat(quality): A4 — L2 Pro premium judge (8 dims, gpt-4o, Pro-gated, opt-in)
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled

This commit is contained in:
2026-07-14 16:56:04 +02:00
parent 8d0fc818ef
commit c794eff823
6 changed files with 1143 additions and 0 deletions

View File

@@ -91,6 +91,19 @@ class Config:
# Hard ceiling on the L1 call (seconds). Anything longer is a skip.
QUALITY_L1_TIMEOUT_SEC = float(os.getenv("QUALITY_L1_TIMEOUT_SEC", "8.0"))
# ============== Quality Layer (L2 — Pro tier) ==============
# Track A4 of the dev plan — STRONGER LLM judge (8 dimensions).
# Gated to Pro+ plans in the route. Default off everywhere.
# Cost: ~$0.005$0.02/job (gpt-4o) or ~$0.001/job (gpt-4o-mini).
# Set QUALITY_L2_TIER_GATE=false to allow L2 for free tier too.
QUALITY_L2_ENABLED = os.getenv("QUALITY_L2_ENABLED", "false").lower() == "true"
QUALITY_L2_LOG_ONLY = os.getenv("QUALITY_L2_LOG_ONLY", "true").lower() == "true"
QUALITY_L2_SAMPLE_SIZE = int(os.getenv("QUALITY_L2_SAMPLE_SIZE", "15"))
QUALITY_L2_MIN_CHUNKS = int(os.getenv("QUALITY_L2_MIN_CHUNKS", "20"))
QUALITY_L2_TIMEOUT_SEC = float(os.getenv("QUALITY_L2_TIMEOUT_SEC", "20.0"))
# When true, only Pro+ plans can use L2. Otherwise, all plans can.
QUALITY_L2_TIER_GATE = os.getenv("QUALITY_L2_TIER_GATE", "true").lower() == "true"
# ============== API Configuration ==============
API_TITLE = "Document Translation API"