Home
Upload
Paper
Architecture
Economics
Manifest
Architecture v0.2
Charles Dana · Monce AI · April 2026
Request flow
HTTPS
│
┌─────────▼─────────┐
│ Route53 A │ alma.aws.monce.ai → 35.180.91.48
└─────────┬─────────┘
│
┌─────────▼─────────┐
│ nginx (443) │ Let's Encrypt TLS, reverse proxy
└─────────┬─────────┘
│ 127.0.0.1:8000
┌─────────▼─────────┐
│ uvicorn/FastAPI │ systemd: alma.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, CIF, language
1 Doc Analyzer regex + 1 Haiku call < 1 s page triage, layout
2 Unified Extractor 1 Sonnet call per 3-page chunk 3–6 s structured JSON
3 Rules Engine deterministic < 10 ms cleaned values
4 Snake Matcher in-process SAT < 20 ms/line matched PN/customer
4.5 Pricing (NEW) deterministic lookup < 50 μs/line tariff-filled unit_price
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 847 parts (67 real + 180 AXALYS + 600 filler)
├─ clients.json 216 customers (16 real + 200 filler)
├─ alma_entities.json 1 entity — ALMA COMPONENTES
├─ axalys_tarif.json 180 AXALYS refs across 21 product sheets
├─ pricing.json 313 priced entries (155 GPAO + 158 AXALYS)
└─ models/
├─ article_matcher.json
├─ client_matcher.json
└─ entity_matcher.json
tarifs/
└─ TARIF GENERAL 240207.xlsx (password: soleil)
Deployment topology
Layer Spec
EC2 t3.medium, Ubuntu 24.04, 20 GB gp3, eu-west-3
IAM instance profile safran-po-ec2-profile → Bedrock InvokeModel
Auth AWS_BEARER_TOKEN_BEDROCK env in systemd unit
Nginx 443 TLS (Let's Encrypt) → 127.0.0.1:8000
Service alma.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.
New tariff entries. Update tarifs/TARIF GENERAL….xlsx,
re-run the extractor (msoffcrypto decrypts with password
soleil ), deploy data/pricing.json.
New language. Extend _detect_language() and
the Stage 2 prompt column dictionary.
New model. Point MODELS in config.py to
any Bedrock-hosted Anthropic model ID.
Monce AI · alma.aws.monce.ai · April 2026
See paper for the pricing formalism · economics for cost.