Engineering approach

Baseline first. Then one change at a time.

A reproducible process for improving LLM systems: measure what you run, define success, test changes in isolation, and ship only what holds up.

01

Establish the baseline

Instrument every route: input, output and cached tokens, retries, errors, p50/p95 latency and cost. Agree on a task-level definition of success.

Baseline report · cost per successful task by route

02

Build the eval set

Sample representative and adversarial cases from real traffic (anonymized), define graders (exact, rubric, model-graded with human spot checks) and lock a regression suite.

Versioned eval set · grading rubric · current scores

03

Prototype changes in isolation

Routing, prompt and context changes, retrieval tuning, caching, batching, model swaps. One variable at a time so attribution is clean.

Experiment log · configs · raw results

04

Measure the tradeoffs

Every candidate reported on quality, latency and cost per successful task together, with confidence notes where the sample is small.

Tradeoff matrix · recommendation with rejected options

05

Harden and hand off

Ship behind feature flags and regression gates, set budgets and alerts, write ADRs and runbooks, and pair with your engineers until they own it.

ADRs · runbooks · dashboards · CI eval gate

Reference architecture

Where cost and quality are decided.

Most systems we look at share these decision points. The work is finding which ones matter for your traffic.

Reference request path: routing, caching, model tiers, eval gate and cost per successful task Requests → Router → Cache → Small model / Frontier model → Eval gate → Cost. cache hit: no model call. Requests Routerby task difficulty Cacheexact + prefix Frontier modelonly when needed Small modelroutine tasks Eval gatemeets threshold? Costper successful task cache hit: no model call Reference request path: routing, caching, model tiers, eval gate and cost per successful task Router Cache Frontier model Small model Eval gate Cost · per successful task
Illustrative reference architecture. Your system will differ.

Tenets

Vendor-neutral by design

No referral fees or partner agreements with model or cloud providers. If we recommend a vendor, the ADR says why and what lost.

Cost per successful task, not cost per token

A cheaper call that fails more often can cost more. We optimize the unit your business actually pays for.

Reproducible or it didn’t happen

Configs, prompts, eval sets and results are versioned so your team can rerun every comparison.

Leave the team stronger

Engagements end with documentation and working gates in your repo, not a slide deck.

Questions about the process

What access do you need for the baseline?

Usually exported usage data or read access to observability tooling, scoped by your security team. We define the minimum needed in the statement of work. Never send credentials through web forms.

How do you grade outputs without bias?

Grader choice depends on the task: deterministic checks where possible, rubric-based model grading calibrated against human labels where not, and periodic human review of disagreements.

Can this run inside our CI?

Yes. The regression suite and thresholds are designed to run in your pipeline so quality and cost regressions block a deploy the same way failing tests do.

Start with a baseline.

A 30-minute call to see what measuring your system would involve.