Observability for a Production LLM Feature
Defines what to measure and log for a production LLM feature, so quality degradation that raises no error — and is therefore invisible to normal monitoring — gets caught.
Prompt
Design observability for a production LLM feature. The core problem: quality degradation raises no error. The system returns 200 and a bad answer.
Feature: [describe] Volume: [calls per day] What happens to the output: [displayed / feeds a decision / stored]
Define:
- What to log per call — request id, prompt version, model, input and output tokens, latency, cost, and a hashed user id. Do not log: privileged document content, keys, identifying information.
- Quality metrics without ground truth — refusal rate, malformed output rate, empty response rate, anomalous output length, retry rate, and user abandonment after a response.
- User signals — copy, edit-before-use, rating, and re-asking the same question rephrased. The last is the strongest signal of a bad answer.
- Alerts — for each metric, the threshold and window. Separate what wakes someone at night from what appears in a daily report. Cost and latency: page immediately. Quality: daily trend.
- Sampling for manual review — how many, selected by what criterion, reviewed by whom. Prefer sampling biased toward suspicious cases over uniform random sampling.
- Drift detection — how to distinguish a change in model behaviour from a change in the kinds of questions being asked. These look identical on a graph.
- What to retain for debugging — for how long and at what granularity, given privacy constraints.
Finally: the first question you will be asked when a user reports a wrong answer, and the data that must be available to answer it.
Why this converts well
- Ready to copy and use immediately
- Tailored for legal and public-sector work
- Easy to adapt to internal workflows
Tags
Related Prompts
Tool Specification for a Legal AI Agent
Produces a complete agent tool definition — schema, description, errors, permissions — with emphasis on tools that perform irreversible actions.
Designing a Structured Output Schema for Legal Data
Designs a JSON schema for legal data extraction with explicit representation of uncertainty and missing values instead of silent defaults.
Regression Test Suite for a Production Prompt
Builds a test suite for a prompt before changing it, catching silent regressions introduced by an innocent-looking improvement or a model swap.