Personal project by Ulf Fäldt Reifenberg, built for a job application with coding agents. Unofficial, not affiliated with any company. Public data only.
Which production faults can you catch before anyone labels the data?
A Swedish intent classifier behind a FastAPI scoring service, five label-free drift monitors, and a weekly audit of 50 hand-checked labels, replayed over 600 healthy weeks and 1200 faulty ones.
What this shows
- Cheap input monitors see small faults that a 50-label audit cannot. At 10% affected traffic accuracy falls 1 to 9 points; the audit flags 0 to 10 weeks of 100, the label-free set 55 to 91.
- Each fault has one monitor that finds it first: unknown-word rate for stripped letters, length for cut messages, confidence for an unseen product area. Predicted-intent PSI, the usual default, flags at most 23 of 100 weeks on any of the three at 10%.
- Label-free monitors cannot tell harm from change. A shift toward weather, news and time questions sets them off every week from 25% while accuracy improves. The audited labels stay quiet there, which is their real job: confirm or dismiss an alarm.
- Thresholds set on 300 healthy weeks did not hold their 1% false-alarm target on 300 fresh ones (12 alarms, about 4%). Calibrating a 99th percentile from 300 weeks is too thin; I report it as measured.
Alarms per 100 weeks
| Fault and share of weekly requests | Accuracy change, points | Accuracy | Unknown-word rate | Length (KS) | Confidence drop | Predicted-intent PSI | Domain classifier* | Any label-free | 50 audited labels |
|---|---|---|---|---|---|---|---|---|---|
| Healthy weeks (false alarms per 300) | – | 84.7% | 13 | 5 | 8 | 8 | 0 | 12 | 0 |
| Client strips å/ä/ö | |||||||||
| 10% of requests | -0.9 | 83.8% | 99 | 2 | 9 | 1 | 1 | 91 | 0 |
| 25% of requests | -2.1 | 82.6% | 100 | 1 | 45 | 0 | 65 | 100 | 3 |
| 50% of requests | -4.0 | 80.7% | 100 | 3 | 97 | 12 | 100 | 100 | 1 |
| Client cuts messages to two words | |||||||||
| 10% of requests | -4.1 | 80.6% | 2 | 79 | 26 | 5 | 2 | 55 | 4 |
| 25% of requests | -9.9 | 74.7% | 0 | 100 | 92 | 16 | 62 | 100 | 19 |
| 50% of requests | -20.2 | 64.5% | 0 | 100 | 100 | 81 | 100 | 100 | 80 |
| Requests from an unseen product area | |||||||||
| 10% of requests | -8.7 | 75.9% | 74 | 3 | 96 | 23 | 13 | 89 | 10 |
| 25% of requests | -21.2 | 63.5% | 100 | 2 | 100 | 100 | 100 | 100 | 84 |
| 50% of requests | -42.2 | 42.5% | 100 | 4 | 100 | 100 | 100 | 100 | 100 |
| Known areas get more traffic (harmless) | |||||||||
| 10% of requests | +0.7 | 85.4% | 3 | 2 | 1 | 21 | 3 | 16 | 0 |
| 25% of requests | +1.6 | 86.3% | 0 | 6 | 1 | 100 | 53 | 100 | 0 |
| 50% of requests | +3.5 | 88.2% | 2 | 19 | 0 | 100 | 100 | 100 | 0 |
Hover a cell for its 95% Wilson interval. Each week is 400 requests drawn from a pool of 3291; the reference window is 1500 requests with accuracy 85.9%. Orange cells are alarms on a change that did no harm. *The domain classifier needs the request text; the other four need only numbers the service already logs. "Any label-free" splits the 1% budget across the five.
How it is built
- Model: TF-IDF (words and character n-grams) with logistic regression, trained on 11,046 Swedish utterances and 56 intents from Amazon MASSIVE (sv-SE, CC BY 4.0). Two product areas, takeaway and cooking, are held out to play the unseen area.
- Service: FastAPI with Pydantic request and response models. It rejects malformed input with 422 and logs predicted intent, confidence, token count and unknown-word count per request. It does not store the text.
- Monitoring job:
monitor.pyreads the last 400 logged requests, compares them with the reference profile and prints one JSON report with the alarms. - Tests: 11 pytest cases, including an end-to-end one: 400 healthy requests through the API stay quiet, 400 with stripped letters raise the unknown-word alarm.
Limits
- One model, one dataset, one random seed. Weeks are resampled from a pool of 3291 utterances, so they overlap and the intervals are narrower than truly independent weeks would give.
- The faults are injected by me, three kinds of harm and one harmless change. Real drift is slower and mixed.
- Runs on a laptop with SQLite as the request log. Nothing here is deployed to a cloud ML platform, and no experiment tracker is attached: the MLflow logging step failed in this environment and I left it out rather than rerun for two hours.
- Small text classifier, not an LLM; no PySpark or large-scale data handling.
Seed 11. Results file: results.json. 2026-11-29.