Skip to content

Monitoring, drift, cost alerts, and model updates

نگرانی، drift، خرچ کے الرٹس، اور ماڈل اپ ڈیٹس

40 min read

Three ways to see it

  1. Five signals to monitor daily. Volume: how many calls per day, broken out by user and use case. Cost: PKR per day with a drift alert when it deviates by more than 20% from the rolling weekly average. Latency: 50th and 95th percentile response times. Error rate: 4xx and 5xx from the model provider, and application errors. Satisfaction: rolling daily ratio of positive to negative user feedback. Each signal gets a number on a dashboard that the on-call engineer checks every morning. The dashboard is your seismograph; small tremors are warnings, big tremors are emergencies.

  2. Drift detection is more subtle. The user inputs and the model outputs may slowly shift in shape even when no single day looks bad. Track the distribution of prompt lengths, output lengths, and category mixes weekly. If the average prompt grew from 5,000 tokens to 8,000 tokens over six weeks, your cost has crept up 60% without anyone noticing. If the share of Urdu-dominant inputs dropped from 30% to 5%, your users may have stopped trusting the system on Urdu work. Weekly distribution snapshots are cheap and they catch the slow problems that daily metrics miss.

  3. Cost alerts are a discipline of their own. Set hard daily and monthly caps in the vendor console. Anthropic, OpenAI, and Azure all let you cap spend per project. Add a soft alert at 50% and 80% of the cap; a hard halt at 100%. In a Pakistani context where rupee swings can move USD-denominated bills by 10% month to month, also track PKR cost directly and alert when the rupee bill exceeds the original PKR budget by a chosen percentage. The first time the alert fires you will be glad it does, because the alternative is a quarter-end surprise.

Quick check

Quick check: what makes modern AI different from a rule-based program?

The why-tree

Why-tree level one: why daily monitoring rather than weekly? Because some failures cascade. A prompt change that breaks half of calls today wastes half a day if caught on Monday morning; the same change wastes a week if caught the following Friday. Daily is the slowest cadence that catches cascades early.

Try this with Claude

AI-edge prompt to try with Claude or ChatGPT: 'I run an AI assistant serving 200 calls a day at a Karachi hospital. Design a monitoring dashboard with the five daily metrics, weekly drift signals, and cost alerts in PKR. Output: a list of dashboard widgets, the SQL each widget runs against my logs table, and an Urdu paragraph for the head of department explaining what the dashboard shows.' Translate to your own context.

Sources

Sources and further reading. Anthropic 'Usage and rate limits' page (docs.anthropic.com). OpenAI usage dashboards (platform.openai.com/usage). Google SRE book, chapters on monitoring and SLOs (sre.google/sre-book). Grafana, Prometheus open source monitoring stack (grafana.com). 'Datasheets for Datasets', Gebru et al, 2021 (arxiv.org/abs/1803.09010) for the discipline of documenting changing data.