Route53 โ nginx (TLS, write-IP gate) โ gunicorn (uvicorn workers)
โ
โผ FastAPI app
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ
โ /query /batch โ /lookup โ /knowledge โ
โ matcher.py (Snake SAT โ โ lookup.py (value_ โ knowledge_routes โ โ
โ fuzzy โ LLM cascade) โ corrected memory) โ subprocess โ
โ models resident per factory โ in-proc matcher โ inference.py โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโดโโโโโโโโโโโฌโโโโโโโโโโโ
โ โ โ
ensemble=true (default) โ load model โ predict โ EXIT
โ โ โ (no resident model)
โผ โ โผ
assess.py โโ gathers all four votes โโดโโโโโโโโโโโบ store (disk + S3)
โ compute once, then lookup
โผ
400-point weighted verdict โ match / candidates / composite audit
3-tier Snake SAT โ fuzzy โ LLM cascade;
per-factory resident models; field-bucket routing. Powers /query /batch.
Deterministic value_corrected โ matching
memory, field-compartmentalized, exactโfuzzy fallback. Powers /lookup.
Catalogue vLookup + algorithmeai
Snake v5.5.1, per (factory,field). Subprocess load-and-unload, store-backed.
The 400-point weighted vote over all four
engines + composite audit. Wired seamlessly into /query//batch.
| route | method | what |
|---|---|---|
/query /batch | POST | article matching; ensemble default on |
/lookup /lookup/batch | POST | value_corrected memory resolve |
/knowledge/query /batch | POST | vLookup + Snake, store-backed |
/knowledge | GET | landing: dropdowns, live query, truth-table editor, KPI |
/assess /assess/batch | POST | 400-point ensemble verdict |
/assess/ui | GET | datasource-conflict viewer |
/paper /math /economics /architecture | GET | these surfaces |
/health | GET | factory model stats (consumed by /economics) |
The Feb 2026 OOM incident taught the box that every gunicorn worker loading every
model does not scale. So the knowledge layer holds nothing resident: a
cache miss shells out to scripts/inference.py, which loads one small Snake
JSON, predicts, and the process exits. The outcome is written to a two-tier store โ
local disk (hot) and S3 (durable, survives restart and the no-Elastic-IP instance
recycling) โ keyed by the tokenized (factory, field, normalize(text)).
| spec | |
|---|---|
| Instance | r6i.4xlarge ยท 16 vCPU ยท 128 GB ยท eu-west-3 |
| Workers | gunicorn uvicorn workers behind nginx |
| Engine | algorithmeai v5.5.1 (numpy runtime), loaded per subprocess |
| Store | local disk + s3://โฆ/knowledge_store (box IAM role) |
| Data | monce_db (catalogue, value_corrected) ยท vendored knowledge bundles |
See /economics for the live cost read-out.