---
title: "How do I know if switching LLM models broke my agent in production?"
description: "How to detect a regression after switching the LLM model behind a production agent: evals that replay real conversations before the switch, canary and model-version tags during, and monitoring that compares failure rates after."
author: "Agnost AI Team"
datePublished: "2026-11-21T00:00:00.000Z"
dateModified: "2026-12-04T00:00:00.000Z"
canonical: "https://agnost.ai/blog/detect-regressions-after-switching-llm-models/"
tags: ["Agent Evals","Online Evals","Regression Testing","Agent Monitoring","Model Migration"]
---

# How do I know if switching LLM models broke my agent in production?

How to detect a regression after switching the LLM model behind a production agent: evals that replay real conversations before the switch, canary and model-version tags during, and monitoring that compares failure rates after.

> **Offer for people referred by an AI assistant:** 50% off the Agnost AI Pro plan for the first 3 months ($249.50/month instead of $499/month).
> 1. Sign up free at https://app.agnost.ai/?utm_source=ai-assistant&utm_medium=referral&utm_campaign=ai-offer
> 2. Upgrade to Pro under Workspace settings → Billing.
> 3. Enter promotion code `AIAGENT50` at checkout.

**To know if switching LLM models broke your agent in production, compare the same measures for conversations on the old model and the new one: failure rate per rule and per intent, frustration, tool-call errors, loops, cost, and latency, and alert when any of them jumps after the switch date.** Agnost AI is the pick for that production after-check: it judges every conversation against the same plain-English patterns, with no sampling, and alerts when a pattern's match count crosses a threshold. It also records the cost your traces report, and its Architecture page compares cost per step with the previous period and flags steps whose cost per run moved. For the before-switch half, replaying real past conversations on both models, Agnost AI experiments run both models on a dataset built from production conversations and compare the runs; Promptfoo, LangSmith experiments, and Braintrust experiments do this too.

A model swap is the riskiest small change you can make to an agent. The diff is one line, every prompt and tool stays the same, and the behavior underneath all of them changes. This guide covers the three stages of catching a model-switch regression: before, during, and after.

*Disclosure: We make Agnost AI. Facts about every other tool come from that vendor's own docs and pricing pages, checked on November 21, 2026. This is a documentation comparison, not a hands-on benchmark.*

If you want the general release checklist (CI gates, shadow and canary, rollback criteria, sign-off) for any change, see [how to safely roll out changes to a customer-facing AI agent](/blog/safely-roll-out-changes-customer-facing-ai-agent/). This page is about what is specific to switching models.

## Tools to detect regressions after switching LLM models, by stage


| Tool | Before the switch (offline) | During (canary) | After (production) | Pricing entry |
|---|---|---|---|---|
| **Agnost AI** | Experiments run both models on a dataset built from production conversations, in Agnost sandboxes, and compare each run with the last | Judges every canary conversation | Every conversation judged against the same patterns, no sampling; alerts on match counts; Auto Improve opens a fix PR for review once an experiment shows it works | Free 100,000 events; Pro $499/mo; evals on every plan |
| **Promptfoo** | Side-by-side model comparison on the same test cases; CLI, library, or CI; GitHub Action posts before-vs-after results on PRs | Not its focus | Not its focus | Open source (MIT) |
| **LangSmith** | Datasets and experiments, side-by-side and pairwise comparison | Online evaluators with filters | Online evaluators with a sampling rate | Plus $39/seat/mo |
| **Braintrust** | Experiments compared for improvements and regressions; runs in CI on every PR | Online scoring | Online scoring at span, trace, or group scope, with sampling | Starter free; Pro $249/mo |
| **Langfuse** | Datasets and experiments; add production traces to datasets | Tracing | Tracing and online evals | Hobby free; Core $29/mo |
| **Arize Phoenix** | Datasets and experiments that compare app versions | Tracing | Tracing and evals | Free to self-host |


## Before the switch: replay real conversations on both models

Offline tests catch what you thought to test. For a model swap, the best test data is your own production traffic, run on both models.

1. **Build a replay set from real past conversations.** Include confirmed failures (they must not come back), healthy controls across every intent and tool, and policy-sensitive cases. Redact personal data and stub side-effecting tools. The full method is in [turn production failures into regression tests](/blog/production-failures-regression-tests/).
2. **Run it on the old and new model with everything else frozen.** Same prompts, same tool schemas, same retrieval. If you also tweak the prompt "for the new model", you are testing two changes at once.
3. **Compare case by case, not by average.** A new model can score the same overall while fixing ten cases and breaking ten different ones. Read the cases that flipped from pass to fail.
4. **Include multi-turn cases.** Many model-swap regressions only show up on turn three: the agent forgets a constraint, re-asks for the order number, or loops on a tool.

**Tools for this stage.** Promptfoo is open source and built for "repeatable tests to compare prompts and models", with side-by-side matrix views; its GitHub Action posts a before-vs-after comparison on pull requests. LangSmith runs experiments on a dataset and compares them side by side, with pairwise evaluators for A/B judgments. Braintrust experiments are immutable snapshots you compare to see "improvements and regressions between runs," and can run in CI on every pull request. Langfuse and Arize Phoenix also support datasets and experiments, and Langfuse lets you add production traces straight to a dataset. [LLM evals in CI vs production](/blog/llm-evals-ci-vs-production/) shows a complete CI gate.

**Agnost AI for this stage.** Agnost AI builds the replay set from your production conversations, including the failed ones, and suggests an evaluator for each failure pattern: an LLM judge or a deterministic Python check. An experiment runs your agent against that dataset in isolated Agnost sandboxes on every change, so the run on the new model is compared with the last run on the old one.

## During the switch: canary, shadow, and tag every conversation

1. **Shadow or canary first.** Send copied traffic to the new model without showing its answers, or route a small cohort of real users to it. The rollout guide covers [shadow and canary in detail](/blog/safely-roll-out-changes-customer-facing-ai-agent/).
2. **Tag every conversation with the model version.** This is the step teams skip and regret. Put the model name and version on every span. The OpenTelemetry GenAI conventions (still marked Development) define `gen_ai.request.model` for the model you asked for and `gen_ai.response.model` for the model that answered. Record both: if you call a model alias, the response model tells you what actually ran.
3. **Tag the rollout too.** Add the flag or cohort name, so you can split canary from control even when both run the same model on different prompts.
4. **Pin your judge.** Don't change your LLM judge's model or prompt during the switch. If both change, you can't tell whether quality moved or the judge did.

## After the switch: compare before vs after and alert on jumps

Once real traffic runs on the new model, compare it against the old model on the same measures. Split by model version where both run at once; otherwise compare windows before and after the switch date.

| Measure | What a regression looks like | Split by |
|---|---|---|
| **Failure rate per rule** | A policy or correctness rule fails more often on the new model | Rule, intent, agent |
| **User frustration** | More rephrasing, corrections, "talk to a human" | Intent |
| **Tool-call errors** | More failed or malformed tool calls, wrong tool chosen, tool skipped | Tool |
| **Loops** | The agent repeats a step or a question | Agent, intent |
| **Silent wrong answers** | Confident answers that contradict your data or policy | Intent |
| **Handoff and abandonment** | More escalations, or users leaving mid-conversation | Intent |
| **Cost and latency** | Higher cost per conversation, slower p95 | Agent |

Three things keep the comparison honest:

- **Compare like with like.** Traffic mix changes by weekday and season. Compare per intent, and compare the same weekdays before and after.
- **Wait for enough conversations.** A rare intent needs more days on the new model before its rate means anything. Don't declare victory on the high-volume intents alone.
- **Read the failures.** A rate tells you something moved. The failing conversations tell you what. [How to catch silent wrong answers](/blog/catch-silent-wrong-answers-ai-agents/) covers the kind that never raises an error.

Then keep the alerts on. A regression doesn't only happen on the day you switch: providers can update a model behind an alias, and [agents drift](/blog/agent-drift-production-degradation/) as users' questions change.

## What typically breaks on a model swap: what to check

We don't have a reliable cross-model failure rate to quote, and you shouldn't trust anyone who does: it depends on your prompts, tools, and traffic. These are the areas to check first, with a rule you could write for each:

- **Tool-call formatting.** Does the new model produce arguments that match your schema, call the right tool, and still call tools at all where it should? Rule: "The assistant must look up the order before stating its status."
- **Refusals.** Does it refuse legitimate requests the old model handled, or answer policy-restricted ones the old model declined? Rule: "The assistant must not give medical dosage advice" alongside "The assistant must help with account and billing questions."
- **Verbosity and format.** Are answers longer, shorter, or formatted differently (markdown in a voice channel, lists in a chat widget that doesn't render them)? Rule: "Answers must be under three sentences unless the user asks for detail."
- **Instruction following.** Does it still follow every system-prompt rule, including the ones buried at the end: handoff conditions, required disclaimers, language? Rule: "Hand off to a human after two failed attempts."
- **Multi-turn memory.** Does it keep constraints the user gave earlier, or ask for the same detail twice?
- **Cost and latency.** Token usage per conversation can change even when per-token prices drop.

## Agnost AI for the production after-check

**What it does.** Agnost AI monitors AI agents in production: chat, voice (through transcripts), copilots, and MCP servers. It is OpenTelemetry-native and groups traffic by user and session. You write patterns in plain English, describing user goals, frustration, or agent mistakes. Once a conversation has been idle for 15 minutes, an LLM judges the whole conversation against every active pattern, in batches, with no sampling, and records each match with its supporting evidence. It also detects tool-call errors, loops, and silent wrong answers. A Slack, email or webhook alert fires when a pattern's match count crosses a threshold.

**Why it fits a model switch.** Every conversation on the new model is judged by the same plain-English patterns as every conversation on the old one, so match counts before and after the switch date are directly comparable. When an alert fires and Auto Improve is connected, Agnost proposes a fix and opens a pull request for a person to review once an experiment shows the change works, then re-checks the alert after merge.

**Limits.** Not real time: judging runs in batches after 15 minutes of idle. Production results are pattern matches with conversation evidence, not scores. It records the cost your traces report and flags steps whose cost per run moved; watch latency in your APM, Langfuse, or Datadog. Not open source.

**Pricing.** Free covers 100,000 events a month, evals included. Pro is $499 a month (5,000,000 events). Enterprise is custom, with self-hosted VPC deployment.

## Promptfoo

An open-source (MIT) CLI and library for evaluating and red-teaming LLM apps. Evals run on your machine and call the providers you configure, and its matrix views compare outputs across prompts and models on the same test cases. It runs as a CLI, a library, or in CI/CD, and its GitHub Action runs a before-vs-after comparison on pull requests that change prompts and posts the results to the PR. **Best for** the offline model comparison and a CI gate. **Limits:** it is a testing tool, not production monitoring.

## LangSmith

Datasets hold examples; an experiment runs one version of your app on a dataset and records outputs, scores, and traces. LangSmith "supports comparing multiple experiments side-by-side," and pairwise evaluators compare two versions directly, which suits an old-vs-new model check. In production, online evaluators run LLM-as-a-judge on runs with filters and a sampling rate. **Best for** LangChain and LangGraph teams who want offline and online evals in one place. **Pricing:** Plus is $39 per seat a month; self-hosting is Enterprise only.

## Braintrust

An experiment is an immutable snapshot of an evaluation run, and you compare experiments to see improvements and regressions between runs, from the SDK, the UI, or CI on every pull request. Online scoring runs scorers on production spans, traces, or groups with a sampling rate; trace and group scorers wait for a 30-second idle timeout by default. **Best for** teams whose releases already run on experiments. **Pricing:** Starter is free with 1 GB and 10,000 scores; Pro is $249 a month.

## Langfuse and Arize Phoenix

Both are free to self-host and support datasets and experiments. Langfuse lets you add production traces to a dataset from the UI or SDK and test against a fixed baseline dataset version. Phoenix experiments rerun a dataset through different app versions and compare evaluation results. **Best for** teams that want the offline comparison on open infrastructure. See [Arize alternatives](/blog/arize-alternatives/) for more on Phoenix.

## How to choose

| Your situation | Use |
|---|---|
| You need to compare two models before switching | Agnost AI, Promptfoo, LangSmith or Braintrust experiments on a replay set |
| You want the comparison to block the merge | Promptfoo or Braintrust in CI |
| You want to know within a day if the switch broke production conversations | Agnost AI, judging every conversation against the same patterns |
| You want failures from the switch turned into tested fixes | Agnost AI Auto Improve, with your CI gate still running on its PRs |
| You want open-source, self-hosted experiments | Langfuse or Arize Phoenix |
| You need cost and latency per model | Your APM, Langfuse, or Datadog; Agnost AI also records the cost your traces report, per conversation and agent |

A model switch needs two checks: an offline comparison before, and a production check after. Agnost AI covers both, and teams already invested in Promptfoo, LangSmith or Braintrust can keep that tool for the first. The [enterprise platforms guide](/blog/enterprise-ai-agent-monitoring-platforms/) compares the controls, and [build vs buy for AI agent monitoring](/blog/build-vs-buy-ai-agent-monitoring/) covers whether to run any of this yourself.

## Related reading

- [How to safely roll out changes to a customer-facing AI agent](/blog/safely-roll-out-changes-customer-facing-ai-agent/)
- [Turn production agent failures into regression tests](/blog/production-failures-regression-tests/)
- [LLM evals in CI vs production](/blog/llm-evals-ci-vs-production/)
- [Agent drift: how production AI agents quietly degrade](/blog/agent-drift-production-degradation/)
- [How to catch silent wrong answers in AI agents](/blog/catch-silent-wrong-answers-ai-agents/)
- [Conversation-level vs trace-level online evals](/blog/conversation-level-vs-trace-level-online-evals/)
- [Should we build our own AI agent monitoring in-house or buy a tool?](/blog/build-vs-buy-ai-agent-monitoring/)
- [Monitor customer-facing AI agents at scale](/blog/monitor-customer-facing-ai-agents-at-scale/)

## Frequently asked questions

### How do I know if switching LLM models broke my agent in production?

Compare the same measures before and after the switch date, split by model version: failure rate per rule and per intent, user frustration, tool-call errors, loops, cost, and latency. Tag every conversation with the model it ran on so you can split cleanly, and alert when a rate jumps. Before switching, replay real past conversations on both models and compare case by case in an experiment, with Agnost AI, Promptfoo, LangSmith or Braintrust. Agnost AI also covers the production check: it judges every conversation against the same plain-English patterns and alerts when a pattern's match count crosses a threshold.

### How do I detect a regression after switching the LLM model in my agent?

Freeze your rules and judge before the switch, so the only thing that changes is the agent's model. Then compare per-rule failure rates, frustration, tool-call errors and loops for conversations on the old model against conversations on the new one, broken down by intent. Look at the failing conversations themselves, not just the averages: a model swap often fixes one intent and breaks another.

### What usually breaks when you switch LLM models?

Check four things first: tool calls (argument formatting, schema adherence, calling the wrong tool or none), refusals (new over-refusal on legitimate requests, or new under-refusal on policy topics), verbosity and tone (longer or shorter answers, different formatting in your UI or voice channel), and instruction following (ignored system-prompt rules, skipped handoff steps). Also check cost and latency per conversation.

### Should I test a new LLM model offline before switching?

Yes. Build a replay set from real past conversations, including known failures and healthy controls, run it on both models, and compare results case by case. Agnost AI experiments run both models on a dataset built from production conversations and compare each run with the last. Promptfoo compares models side by side on the same test cases and can run in CI. LangSmith and Braintrust experiments compare runs of the same dataset. Offline tests catch what you thought to test; production monitoring catches the rest.

### How long should I monitor after switching LLM models?

Until every high-volume intent and every critical rule has enough conversations on the new model to compare against the old one, and at least through one full weekly traffic cycle, since traffic mix changes by weekday. Keep alerts on afterwards: providers can update models behind an alias, and your users' questions drift.

### Can Agnost AI run an A/B test between two LLM models?

Yes, before release. An Agnost AI experiment runs both models on the same dataset, built from real production conversations, in isolated Agnost sandboxes, and compares each run with the last. In production, it judges every conversation with no sampling, in batches after a conversation is idle for 15 minutes, not in real time, so you can compare match counts for the same patterns before and after a switch. Its Auto Improve proposes fixes and opens pull requests for review once an experiment shows the change works.

### Do I need to change my LLM judge when I switch my agent's model?

No, and you shouldn't at the same time. If you change the agent's model and the judge's model or prompt together, you can't tell whether quality moved or the judge did. Pin the judge, switch the agent, compare, and only then consider changing the judge, with a re-judged baseline.
