Aller au contenu

Configuration

Toutes les variables d'environnement sont chargées via src/config/reliability.py.
Les valeurs par défaut sont conçues pour un fonctionnement nominal en production.

Activation

Variable Type Défaut Description
RELIABILITY_BACKEND_V1_ENABLED bool true Killswitch global du backend Reliability.
RELIABILITY_API_V1_ENABLED bool true Killswitch des routes /api/reliability/*.
RELIABILITY_SUGGESTION_LIMIT int 2000 Plafond dur de suggestions par transcription.

LLM

Variable Type Défaut Description
RELIABILITY_LLM_ENABLED bool true Active l'étape de raisonnement contraint.
RELIABILITY_LLM_PRIMARY enum qwen Provider primaire (qwen, openai, none).
RELIABILITY_LLM_FALLBACK enum openai Provider de fallback.
RELIABILITY_LLM_TIMEOUT_S int 60 Timeout par appel LLM.
RELIABILITY_LLM_MAX_RETRIES int 2 Retries par provider.
RELIABILITY_OPENAI_FALLBACK_ENABLED bool true Active explicitement le fallback OpenAI.
LLM_RELIABILITY_CONCURRENCY int 2 Sémaphore global sur les appels LLM du pipeline.

Gating et seuils

Variable Type Défaut Description
RELIABILITY_LLM_GATING_ENABLED bool true Active le gate S2 (correspondance canonique).
RELIABILITY_S1_GATING_ENABLED bool true Active le gate S1 (rejets historiques).
RELIABILITY_S1_MIN_REJECTS int 3 Nombre de rejets historiques avant skip LLM.
RELIABILITY_S1_TTL_DAYS int 90 TTL du hash Redis des rejets.
RELIABILITY_GATING_NORMALISE_ACCENTS bool true Normalisation NFKD avant comparaison.
RELIABILITY_GATING_TOKENISATION_ENABLED bool true Active la tokenisation globale.
RELIABILITY_GATING_TOKENISATION_PERSON_ENABLED bool true Tokenisation spécifique aux personnes.
RELIABILITY_GATING_TOKENISATION_*_ENABLED bool false Idem pour les autres types.
RELIABILITY_GATING_MIN_TOKEN_LEN int 3 Longueur minimale d'un token.
RELIABILITY_HIGH_CONFIDENCE_THRESHOLD float 0.85 Seuil au-dessus duquel une suggestion est auto_applied en mode RAG_ENHANCED.
RELIABILITY_HIGH_CONFIDENCE_THRESHOLD_CONTEXT_FREE float 0.70 Idem en mode CONTEXT_FREE, et plafond du score global.
RELIABILITY_MODE_DECISION_STRICT bool true Application stricte des conditions de mode.
RELIABILITY_RAG_MODE_MIN_TOTAL int 3 Nombre minimal d'entités canoniques pour RAG_ENHANCED.
RELIABILITY_RAG_MODE_MIN_DIVERSITY int 2 Nombre minimal de types distincts.

RAG

Variable Type Défaut Description
RELIABILITY_RAG_CONFIDENCE_BONUS float 0.15 Bonus de confiance maximal accordé via RAG.
RELIABILITY_RAG_CANONICAL_MAX_ITEMS int 30 Plafond par catégorie de la liste canonique.

Géographie

Variable Type Défaut Description
RELIABILITY_GEO_ENABLED bool false Active le sous-pipeline géographique.
RELIABILITY_GEO_AS_SIGNAL bool false Inclut le score géographique comme signal du scorer.
RELIABILITY_GEO_INJECT_PROMPT bool false Injecte le résultat géographique dans le prompt LLM.
RELIABILITY_GEO_INJECT_MIN_SCORE float 0.70 Seuil minimal pour injecter dans le prompt.
RELIABILITY_GEO_AMBIGUITY_DELTA float 0.10 Distance maximale top1/top2 avant marquage ambiguous.
PHOTON_BASE_URL string URL de l'instance Photon self-host.
PHOTON_TIMEOUT_MS int 2000 Timeout par requête Photon.
PHOTON_SEMAPHORE int 10 Concurrence globale Photon.
PHOTON_HTTP_RETRY_MAX int 2 Retries HTTP côté Photon.

Wikidata

Variable Type Défaut Description
WIKIDATA_ENABLED bool true Active l'enrichissement Wikidata.
WIKIDATA_SPARQL_URL string https://query.wikidata.org/sparql Endpoint SPARQL.
WIKIDATA_TIMEOUT_MS int 10000 Timeout SPARQL.
WIKIDATA_SEMAPHORE int 2 Concurrence globale Wikidata.

Scoring multi-signal

Variable Type Défaut Description
RELIABILITY_V5_GATE_THRESHOLD float 0.70 Seuil du Decision Gate.
RELIABILITY_V5_CANONICAL_LIST_CAP int (1..200) 50 Cap items canoniques dans le prompt LLM.
RELIABILITY_V5_VARIANCE_THRESHOLD float 0.25 Stdev au-delà duquel la pénalité s'applique.
RELIABILITY_V5_VARIANCE_PENALTY float 0.10 Pénalité soustraite au fused_score.
RELIABILITY_V5_WIKIDATA_BOOST float 0.05 Bonus additif au signal LLM si confirmation Wikidata.
RELIABILITY_V5_WEIGHT_{TYPE}_{SIGNAL} float voir Scoring & décision 15 variables : pondération par type et signal.

Score global par transcription

Variable Type Défaut Description
RELIABILITY_WEIGHT_PLACES float 0.30 Poids du sous-score place dans le score global.
RELIABILITY_WEIGHT_PERSONS float 0.25
RELIABILITY_WEIGHT_ACRONYMS float 0.15
RELIABILITY_WEIGHT_ORGS float 0.15
RELIABILITY_WEIGHT_TYPOS float 0.15
RELIABILITY_TEXT_PROPAGATION_ENABLED bool false Propagation automatique des corrections texte.

Worker

Variable Type Défaut Description
RELIABILITY_WORKER_ENABLED bool true Active le worker au lifespan FastAPI.
RELIABILITY_STREAM_KEY string reliability:events Stream principal.
RELIABILITY_RETRY_STREAM_KEY string reliability:events:retry Stream de retries.
RELIABILITY_DLQ_STREAM_KEY string reliability:events:dlq Stream DLQ.
RELIABILITY_CONSUMER_GROUP string reliability-workers Consumer group.
RELIABILITY_LOCK_TTL_SECONDS int 1800 TTL du lock par transcription.
RELIABILITY_MAX_RETRIES int 3 Retries max avant DLQ.
RELIABILITY_RETRY_BASE_DELAY_S float 10.0 Délai de base du backoff exponentiel.
RELIABILITY_RETRY_POLL_INTERVAL_S float 2.0 Période du scheduler de retries.
RELIABILITY_RETRY_BATCH_SIZE int 50 Taille de batch par tick.
RELIABILITY_DLQ_MAX_LEN int 5000 Trim approximatif de la DLQ.
RELIABILITY_PROGRESS_TTL_SECONDS int 86400 TTL du hash de progression.
RELIABILITY_EXECUTOR_MAX_WORKERS int 2 Threads de l'executor du worker.
RELIABILITY_SHUTDOWN_DRAIN_S int 60 Délai max d'arrêt gracieux.

Pool de connexions dédié

Variable Type Défaut Description
RELIABILITY_USE_DEDICATED_POOL bool true Active un pool SQLAlchemy isolé.
RELIABILITY_DB_POOL_SIZE int 5 Taille du pool.
RELIABILITY_DB_MAX_OVERFLOW int 2 Connexions au-delà du pool.
RELIABILITY_DB_POOL_RECYCLE int 1800 Recyclage forcé (secondes).
RELIABILITY_DB_POOL_TIMEOUT int 30 Timeout d'acquisition.

Métriques

Variable Type Défaut Description
RELIABILITY_METRICS_ENABLED bool true Active l'exposition Prometheus.
RELIABILITY_METRICS_REFRESH_S float 30.0 Période de refresh des gauges.

Mémoire des corrections

Toutes ces variables sont par défaut désactivées (mémoire dormante) ; la
fonctionnalité s'active explicitement.

Variable Type Défaut Description
RELIABILITY_CORRECTIONS_MEMORY_ENABLED bool false Killswitch global de la mémoire.
RELIABILITY_CORRECTIONS_MEMORY_WRITE_ENABLED bool false Active l'écriture sur action utilisateur.
RELIABILITY_CORRECTIONS_MEMORY_READ_ENABLED bool false Active la lecture pour boost de confiance.
RELIABILITY_CORRECTIONS_MEMORY_PROMO_ENABLED bool false Active le job de promotion.
RELIABILITY_CORRECTIONS_MEMORY_BOOTSTRAP_ON_STARTUP bool true Bootstrap idempotent au démarrage.
RELIABILITY_CORRECTIONS_MEMORY_COLLECTION string reliability_corrections_memory Nom de la collection Qdrant.
RELIABILITY_CORRECTIONS_MEMORY_VECTOR_DIM int 1024 Dimension vectorielle.
RELIABILITY_CORRECTIONS_MEMORY_QUARANTINE_TTL_DAYS int 7 Durée de quarantaine.
RELIABILITY_CORRECTIONS_MEMORY_DEDUPE_THRESHOLD float 0.95 Seuil cosine pour déduplication.
RELIABILITY_CORRECTIONS_MEMORY_FINAL_TEXT_MAX_LEN int 200 Plafond final_text.
RELIABILITY_CORRECTIONS_MEMORY_CONTEXT_RADIUS int 100 Caractères de contexte stockés.
RELIABILITY_CORRECTIONS_MEMORY_PAYLOAD_SCHEMA_VERSION int 1 Version du payload.
RELIABILITY_CORRECTIONS_MEMORY_EMBEDDING_MODEL string bge-m3 Modèle d'embedding.
RELIABILITY_CORRECTIONS_MEMORY_EMBEDDING_MODEL_VERSION string 1.0 Version du modèle.
RELIABILITY_CORRECTIONS_MEMORY_PROMO_MIN_FREQ int 2 Fréquence minimale pour promotion.
RELIABILITY_CORRECTIONS_MEMORY_PROMO_BATCH_SIZE int 500 Taille de lot du job.
RELIABILITY_CORRECTIONS_MEMORY_PROMO_RUN_HOUR_UTC int 3 Heure UTC d'exécution.
RELIABILITY_CORRECTIONS_MEMORY_DELETE_AFTER_PROMO bool true Supprime les points après promotion.
RELIABILITY_CORRECTIONS_MEMORY_PROMO_ALERT_THRESHOLD int 5000 Seuil d'alerte sur la file de promotion.