Performance, Cost, and Quality Evaluation Pipeline for Cognitive Agents

AI providers discontinue models frequently, forcing companies to replace them on short notice, often without enough time to validate whether the replacement model performs as well as the one it's replacing, at the same cost and latency. The risk isn't abstract. On the customer side, it means receiving wrong information about a cancellation, a deadline, or a charge. On the company side, it means a cost per session that rises without warning, an SLA that doesn't hold up at scale, or a model-swap decision made under pressure, without data to support it before it reaches production.

This work presents an evaluation pipeline built on the Tech4AI platform, which tests candidate models under full operational parity with the production environment.

Instead of public benchmarks, which test isolated responses against an AI-simulated user or a scoring key built specifically for the test, the pipeline replays synthetic conversations based on real interactions, selected and approved as a quality reference (Base 0), reproducing the exact operational context of the product: the same memory, the same tools, the same prompt. The only variable under test is the model behind the agent (LLM-swap).

Eight models were evaluated, from the GPT-4.1/5 and Gemini 2.5 families and open-weight models such as Kimi-K2.5 and GPT-OSS-120B, across hundreds of executions covering four service instances.

The approval criterion combines quality, task completion, tool precision, latency, and cost, with the hallucination rate acting as an independent elimination filter. Three models were approved. The most relevant finding is the reason why the other five, despite competitive quality, were rejected.

Problem context

The AI provider market rarely updates an existing model: it typically creates entirely new model families and discontinues the previous ones. A model in use for two years, with an already-validated cost margin, can have its shutdown date announced with only a few months' notice. As a result, migrating to the substitute recommended by the provider itself doesn't always preserve the same performance, the same cost per session, or the same task completion rate.

The risk also isn't limited to the model in isolation: it involves the entire orchestration of an agent's multiple use cases, such as billing, negotiation, and case filing, plus the precision of tool calls and the preservation of financial margins in contracts already signed with clients.

Methodology

The goal of the test is to put a candidate model in charge of the same situations the team already handles today, and compare the result against a quality reference.

The difficulty lies in making that comparison fairly, without context bias and without depending on real customer traffic. That's what the pipeline exists for.

The reference: Base 0

Before testing any model, it's necessary to define what counts as "good service." To do this, 106 synthetic sessions were manually reviewed, turn by turn, by a human analyst, against a structured script covering routing, adherence to instructions, and correct tool calls.

Only 20 sessions survived that curation, distributed across four different service instances. These 20 sessions form Base 0: the minimum quality bar that every candidate model must match or exceed, accepting paraphrasing and language variation, as long as they preserve the essential information and the resolution of the interaction.

How the test works, step by step.

Each Base 0 session goes through the same flow:

  1. The session's data is masked, replaced with fictitious values, before any call to the provider APIs.
  2. The replay engine reconstructs the exact context of that interaction: the same memory injected into the prompt, the same tools available, the same conversation history.
  3. The candidate model takes the agent's place and decides, turn by turn, how to act: respond directly or call a tool, within a limit of repetitions per turn.
  4. The session ends following the same rule used in the reference interaction.
  5. The response generated by the candidate is compared against the homologated Base 0 response, using the metrics engine described below.
  6. The result is aggregated into a single verdict per session: approved, partial, or rejected.

Visually, this complete flow, including session selection and masking already described above, looks like this:

Detailed model evaluation pipeline flow, with numbered steps: approved synthetic conversations, data masking, context reconstruction, replay loop, session closure, metrics calculation, aggregation and verdict, and final artifacts.

Tools aren't actually executed

To maintain safety and allow the same test to be repeated multiple times, the pipeline never triggers a real tool during replay: no charge, cancellation, or registration change actually happens. When the candidate model calls the right tool, at the expected step of the reference interaction, the pipeline returns the same response that tool originally gave in Base 0.

When the model calls a different tool than expected, or out of order relative to the reference interaction, the pipeline returns a simulated failure response, not a success. This tells the model the action didn't work, instead of letting it believe it succeeded, and with that clear failure signal, the pipeline discourages a new attempt at the same call, instead of letting the model repeat the action as if it might work next time. Combined with a limit on repetitions per turn, this rule prevents an incorrect tool call from degenerating into a loop within the same session.

This choice has a known side effect: when the model takes a different path than the baseline, but one that's still valid for resolving the interaction, the response it receives from the tool is still generic, not the real response that alternative path would have generated.

Since the only variable that changes from one test to another is the model behind the agent, any difference in performance, latency, or cost is attributable exclusively to the model swap, and not to differences in context or prompt bias. This tool-execution simulation mechanism is summarized visually below:

Image of a documentation page titled "Tools don't actually execute," explaining how the "Replay layer" intercepts calls and compares the result with "Baseline 0," with numbered step boxes and examples of tools and recorded responses.

At every tool call, the replay engine decides: if it matches the expected Base 0 step, it returns the real recorded response; if it diverges, it returns a simulated failure and the session continues normally from there, with the model simply proceeding knowing that action didn't work.

Three-layer metrics engine

The first layer uses entirely deterministic business rules, such as response format and presence of required fields.

The second combines two hybrid metrics, TCR (task completion) and TCA (tool precision), which start from a deterministic check and add a layer of contextual judgment when the response diverges from what was expected.

The third is a panel of multiple judges (LLM-as-a-Judge), which evaluates the entire session holistically. These judges have a different architecture from the models being evaluated, which prevents a model from favoring responses that resemble its own style (self-preference bias).

In practice, each judge returns output in this JSON format, never in free text:

{
  "score": 0.82,
  "verdict": "good",
  "detailed_metrics": {
    "quality_vs_base0": 3,
    "tone_clarity": 4,
    "hallucination_type": "none"
  }
}

The scores from multiple judges are combined using the median for the quality score, but use the most severe classification among them to decide hallucination: a single judge flagging critical hallucination is enough to mark the entire session as such, even if the other judges didn't notice the problem.

All conversations used in the evaluation are synthetic datasets, masked before any calls to the providers' APIs.

Metrics tracked by the pipeline:

  • Cost Per Session (CPS): the real value of a complete interaction, summing all reasoning cycles and tool executions.
  • Total latency per turn: accumulated time per turn, with an acceptance ceiling of 30 seconds.
  • Task Completion Rate (TCR): a continuous score weighing flow completion, path efficiency, and closing satisfaction.
  • Tool Calling Accuracy (TCA): validates syntax, action, parameters, and tool sequence, with support from a context judge when the call diverges from the baseline.
  • Business Rules: deterministic validations of format and required fields.
  • LLM-as-a-Judge: a panel of multiple judges evaluates the full session on a Likert scale, using the median for quality and the most severe classification for hallucination.
  • Semantic Similarity: a point-in-time backstop for TCA on free-text narrative parameters.
  • Consistency Evaluation: multiple rounds with the same input, to measure response variance.
  • Hallucination Rate (critical and general): requires 0% for issues with direct impact on the user's decision, and accepts up to 2% for minor inaccuracies.
Comparative table with models and providers, including tiers and performance scores, showing evaluation results in the production pipeline.

What sets this approach apart

Conversational agent evaluation today generally relies on one of three approaches, each solving part of the problem, but not the whole problem:

  • Traditional LLM-as-a-Judge applies a judge model to isolated responses or single conversation turns. Here, judgment is applied to the complete session, by a panel of judges with a different architecture from the models being evaluated, which reduces self-preference bias and captures the coherence of the interaction from start to finish, not just a single response.
  • Tool-calling benchmarks, such as the Berkeley Function Calling Leaderboard (BFCL), validate function calls syntactically, against a scoring key built specifically for the benchmark. The tool-precision metric used here compares the call sequence against a synthetic interaction, curated and approved as a quality reference (Base 0), capturing not just whether the syntax is correct, but whether the sequence makes sense for that business flow.
  • Multi-turn agent benchmarks, such as τ-bench, depend on a user simulated in real time by another language model, interacting with synthetic databases during the test itself. This pipeline uses an internal corpus of already-completed synthetic conversations, selected and approved through human review as a quality reference (Base 0): the interaction script is fixed before the test begins, and the replay engine reapplies only the candidate model's turn-by-turn decision, under full operational parity (same memory, same tools, same prompt).

None of these three approaches, on its own, combines the three things this pipeline requires at once: a curated synthetic reference corpus approved through human review, controlled model swapping under real operational parity, and a verdict that weighs quality, latency, and cost together, with hallucination rate acting as an independent safety filter, not diluted into the average.

Approval criteria

Once tested, each model is evaluated on four fronts: cost per session, latency, task-resolution capability, and behavioral quality.

These four fronts combine into a Final Score, on a scale of 1 to 4, with different weights: 50% for quality, 30% for cost, and 20% for latency. The faster and cheaper a model resolves the interaction with quality, the higher the score.

But a high score alone isn't enough. The hallucination rate acts as a separate filter, applied after the Final Score: a model is only approved if, in addition to a Final Score of 75% or higher and a Pass Rate of 70% or higher, it has 0% critical hallucinations (fabricated information with direct impact on the user's decision) and at most 2% general hallucinations (minor inaccuracies). A model can have the best score in the study and still be rejected if it exceeds that limit.

Key findings

Only three of the eight models were approved, and each carries its own story

  • GPT-5.4 mini: best Pass Rate in the study (92.5%), Final Score of 86.4%, and a general Hallucination Rate of just 0.9%. No practical caveat was identified in the data collected, which is why this work recommends it for production adoption.
  • GPT-5.4 nano: lowest latency (44.1 seconds per session) and second-lowest token volume among the eight candidates. On the other hand, its general Hallucination Rate (2.0%) sits very close to the 2% elimination ceiling, and its approval verdict holds up in only 50.9% of the pipeline's independent runs, the least consolidated among the three approved models.
  • Kimi-K2.5: the only model in the study with 0% general Hallucination Rate across the entire sample. However, its total latency per session (167.8 seconds) is the third-highest in the study, and its execution showed operational limitations that could compromise availability under higher demand. As a result, the approval reflects response quality, not the deployment's operational readiness for real-time synchronous service.
Ranking chart by composite score (Final Score) with scores from GPT-5 mini, GPT-5.4 nano, GPT-4.1 nano, Kimi-K2 and Gemini 2.5 Flash, indicating approved and rejected candidates.
Bar chart “Ranking by final verdict” with scores and evaluation status (APPROVED, PARTIAL and REJECTED) for GPT-5.4 mini, GPT-5.4 nano, Kimi-K2.5, GPT-5 nano, GPT-4.1 nano, Gemini 2.5 Flash and GPT-5 mini models.

Of the five rejected models, three had a score good enough to pass, if not for hallucination

Gemini 2.5 Flash, GPT-4.1 nano, and GPT-5 mini scored above 79% on the Final Score, competitive enough for approval if the criterion were only the weighted average of quality, latency, and cost.

Even so, all three were rejected for exceeding the 2% general Hallucination Rate limit set for the project. The hallucination rate, not response quality, was the eliminating factor in these three cases. GPT-5 mini went further: it recorded the only critical hallucination occurrence among the eight candidates (1.6% of sessions), the strictest elimination requirement in the study.

Comparative table of AI model performance, with Final Score, Quality, Latency, Cost, Pass Rate, Criterion Hallucination, and Gen. Hallucination, including values ​​such as Gemini 2.5 Flash and GPT-4.1 nano.

The token-cost proxy can invert the real cost ranking between models

Comparative chart of estimated Cost Per Session (CPS) in USD, with horizontal bars showing costs per AI model such as GPT-4.1 nano, GPT-5 mini, and Gemini 2.5 Flash.

Without telemetry on contracted cost, the pipeline uses the volume of tokens processed per session as a cost proxy. Converting that consumption into monetary value, using each provider's public list prices, changes the picture: GPT-5.4 mini, which receives the best normalized cost score among the eight candidates, actually has the highest estimated Cost Per Session (around US$0.093), about 5.3 times the cost of GPT-5.4 nano (US$0.017) and 5.8 times that of GPT-4.1 nano (US$0.016, the cheapest in the sample).

The cause isn't the volume of tokens processed. It's the list price per output token for GPT-5.4 mini (US$4.50 per million), far higher than that of GPT-5.4 nano (US$1.25 per million) within the same model family.

Comparative table of Estimated Cost Per Session (CPS) in USD with values ​​per model, including inputs, cached input, output and estimated CPS

Rejection isn't always a structural trait of the model

Since language models are probabilistic, the same model can produce different results in each independent run. Recalculating the verdict run by run, two models rejected in aggregate (Gemini 2.5 Flash and GPT-5 mini) swung between approval and rejection in a nearly even split, which suggests dependence on the specific sample of sessions, not a structural limitation.

GPT-OSS-120B, by contrast, showed the opposite pattern: it never reached approval in any of the runs, a result consistent with an identified structural cause (the model natively uses the Harmony output format, incompatible with the rest of the pipeline's standard, which caused 87% of sessions to end without a recognizable decision).

Conclusion

In conclusion, the final recommendation is to adopt GPT-5.4 mini, with no operational caveat identified in the data collected. GPT-5.4 nano remains an alternative with lower cost and latency, with a narrower safety margin. Kimi-K2.5 is approved on quality criteria and remains a secondary candidate, conditional on operational validation of the deployment with the provider.

This summary covers the main findings, but the full study details points we didn't explore here: the structure of the prompt used by the judge panel (LLM-as-a-Judge), the consistency of the verdict across runs for all eight models, and the complete list of the study's limitations and the technical criteria used in the final decision matrix.

Researcher
Anna Júlia de Souza Ferreira
R&D Intern at Tech for Humans and Software Engineering undergraduate at the Federal University of Lavras. Works on Generative AI research and the development of applied studies, with a focus on continuous experimentation and the production of technical knowledge. Also researches and proposes improvements to the company's process workflows, contributing to the enhancement of development practices and the evolution of technological solutions.