Home
Upload
Paper
Architecture
Economics
Manifest
Architecture v0.2
Charles Dana · Monce AI · April 2026
Request flow
HTTPS
│
┌─────────▼─────────┐
│ Route53 A │ saft.aws.monce.ai → 35.180.91.48
└─────────┬─────────┘
│
┌─────────▼─────────┐
│ nginx (443) │ Let's Encrypt TLS, reverse proxy
└─────────┬─────────┘
│ 127.0.0.1:8000
┌─────────▼─────────┐
│ uvicorn/FastAPI │ systemd: saft.service
│ api/app.py │
└─────────┬─────────┘
│
┌─────────▼─────────┐ ┌─────────────────────┐
│ Pipeline (7 st) │──────▶│ AWS Bedrock │
│ stages 0..6+4.5 │ │ eu-west-3 │
└─────────┬─────────┘ │ Haiku 4.5 │
│ │ Sonnet 4.6 │
│ └─────────────────────┘
│
┌─────────▼─────────┐
│ Snake v5.4.5 │ pure Python, in-process
│ SAT classifier │ 3 models in data/models/
└───────────────────┘
Pipeline stages
# Stage Cost Typical time Output
0 Client ID regex + 1 Haiku call < 1 s customer_id, PO#, layout family
1 Doc Analyzer regex + 1 Haiku call < 1 s page triage, layout (Ariba / Satair / direct)
2 Unified Extractor 1 Sonnet call per 3-page chunk 3–6 s structured JSON (mfr_pn, customer_pn, desc, qty, unit, price)
3 Rules Engine deterministic < 10 ms schedule-line merge, subtotal check, ISO dates
4 Snake Matcher in-process SAT < 10 ms/line matched SKU from 9,425-article basis
5 Validation 1 Haiku call 1–2 s flags & overall confidence
6 Router deterministic < 1 ms auto-approve / review / full review
Data layout
data/
├─ articles.json 9,425 SKUs — the Saft Valdosta master data
│ (number, material_id, description) from OM-Material.csv
├─ clients.json ~25 customers — Verizon, Satair, Airbus, military primes,
│ European rail, direct-ship accounts
├─ saft_entities.json 1 entity — SAFT AMERICA INC, Valdosta GA
└─ models/
├─ article_matcher.json 9,425-label Snake, L=15, bucket=250
├─ client_matcher.json
└─ entity_matcher.json
Deployment topology
Layer Spec
EC2 t3.medium, Ubuntu 24.04, 20 GB gp3, eu-west-3
IAM instance profile saft-po-profile → Bedrock InvokeModel
Auth AWS_BEARER_TOKEN_BEDROCK env in systemd unit
Nginx 443 TLS (Let's Encrypt) → 127.0.0.1:8000
Service saft.service, auto-restart, 3 worker coroutines
DNS Route53 zone aws.monce.ai, A-record TTL 300
Cert certbot renewal cron, valid until 2026-07-21
Extensibility
New customer layout. Add a regex to
stage0_client_extraction.py:_CUSTOMER_PATTERNS plus an entry to
REAL_CLIENTS in scripts/generate_catalog.py.
Retrain Snake → deploy.
Master data refresh. Drop a new OM - Material.csv
into Dataset pour propal Monce/Master data - Articles Valdosta/,
run scripts/generate_catalog.py (rebuilds articles.json),
then scripts/train_snake_models.py.
New synonyms. Historical mfr-PN ↔ SKU aliases live in
the synonyms column of articles.json; regenerate and retrain.
New model. Point MODELS in config.py to
any Bedrock-hosted Anthropic model ID.
Monce AI · saft.aws.monce.ai · April 2026
See paper for the pricing formalism · economics for cost.