- build a test set from your own examples
- score answers in ways you can repeat
- compare models and settings before you switch
- log what each request did
- use your logs to debug and to work with support
Build a test set from your own examples
General evaluation benchmarks tell you little about your app. A small set of your own examples tells you a lot.- Start with 30 to 100 cases. Take them from real requests (with personal details removed), from your product’s requirements, and from bugs you’ve fixed.
- Cover the hard parts: short and long inputs, ambiguous questions, questions your app should decline, inputs in other languages, and inputs that try to override your instructions.
- Write down what a good answer has, not the exact words: the facts it must include, the format it must follow, what it must not do.
- Keep it in version control next to your prompts, and add a case every time a user reports a bad answer.
Score answers in ways you can repeat
Model output varies from run to run, so score properties, not exact strings.- Check with code first. Does the JSON parse and match the schema? Did the tool call name the right tool with valid arguments? Is the answer under the length limit? Did it finish (
finish_reasonorstatus)? These checks are cheap and never disagree with themselves. - Use a rubric for the rest. For tone, helpfulness and accuracy, have reviewers, or a separate model given a written rubric, score each answer. Spot-check the model’s scores against a person’s before you trust them.
- Run each case more than once. One run can be lucky. Three to five runs per case show how consistent the answer is.
- Don’t count on
temperatureto make runs repeatable. Some models don’t take it, for example Claude 5 models and OpenAI GPT-5 and later models while they reason. The request still runs, and your value is listed inignored_params. See Sampling parameters. - Track cost and time too. Record
usageand response time for every case, so a change that improves quality at three times the cost is visible.
Compare before you switch
Run the whole test set before any change that could affect answers: a new model, a new prompt, a different reasoning effort or output limit, a new tool definition, or a switch between guarded and direct endpoints.- Change one thing at a time, so you know what caused a difference.
- Pin the
modelin tests and in production, so the model you tested is the model you run. See Choosing, Pinning and Updating Models. - Compare side by side. Put the old and new answers for each case next to each other, with scores,
usageand time. The Chat Playground is useful for a first look at a few prompts. - Decide your bar in advance: for example, no case that passed before may fail, and average cost may not rise by more than 20%.
- Roll out gradually where you can, and watch the production signals below before moving all traffic.
Log what each request did
For every request, log one structured record. Leave out prompt and answer text unless you need it and can protect it.
On the direct endpoints, an
X-Request-Id you send on the request is returned on the response, so you can use your own ID end to end.
Watch production
- Track rates, not single events: error rate by
error.name, cut-off rate,content_filterrate, redirect count, cost per feature and response time. A rise matters more than any one request. - Alert on model changes. Any
X-Gloo-Model-Redirected-From, or aSunsetwithout it, means a model you use is retiring. See Choosing, Pinning and Updating Models. - Reconcile with Studio. The API Usage page shows spend, requests and tokens, filterable by API key. Give each application and environment its own key, so a spike points to a source.
- Feed problems back into tests. Sample answers regularly, especially refusals, cut-offs and low-rated replies, and add the bad ones to your test set.
Handle retries without hiding problems
Retry only what’s retryable, with backoff and a budget, and log every attempt, not just the last one; a request that succeeds on its third try is a signal. See Error Handling and Retries and the Build a Resilient Client tutorial. When errors persist after retrying, contact support with thetrace_id from the error body, and the X-Request-Id on direct endpoints, so the exact request can be traced.
Summary
- Keep a version-controlled test set of your own examples, and add every reported bad answer to it.
- Score properties with code first and a rubric second; run each case several times.
- Change one thing at a time, pin the model, and compare quality, cost and time before you switch.
- Log model, redirects,
ignored_params,usage, how the request ended, timing and request IDs for every request. - Watch rates over time, alert on retiring models, and include
trace_idorX-Request-Idwhen you contact support.
Next steps
Error Handling and Retries
Which errors to retry, backoff, budgets and what to log.
Build a Resilient Client
Put retries, failover and logging into code, step by step.
Metrics and Evaluation
The lesson: benchmarks, latency and human evaluation.
Building Trustworthy Grounded Applications
Evaluation for answers grounded in your own content.

