Case Study — Cutting LLM Token Spend 75% — Straight Up AI
Case Study · Healthcare GenAI

Scoring 25 KPIs per call for a quarter of the tokens

The client analyses pharma sales conversations against 25 distinct KPIs. Scoring each one with its own LLM call meant re-sending the whole transcript 25 times. By grouping correlated KPIs into batched, structured requests, we cut average token consumption by three-quarters — without losing measurement quality.

Client
Healthcare · Pharma call analytics
Engagement
ML / GenAI Engineer
Focus
LLM cost, token efficiency & evals
Stack
Python · LLM provider · Structured outputs · MLflow
−75%
Average token consumption per analysed call, by batching correlated KPIs into shared requests.
25 → few
Per-call LLM requests collapsed from one-per-KPI to a handful of grouped, structured calls.
Accuracy held
KPI measurement quality maintained — grouping shares context and reasoning rather than discarding it.
The Challenge

Paying for the same transcript 25 times over

Each sales call is scored against 25 KPIs — a mix of temporal signals (did the rep state a pre-call objective?) and semantic ones (did they surface a growth opportunity?). The straightforward implementation runs one LLM call per KPI. But every one of those calls needs the full call transcript as context, so the transcript gets sent, tokenised and billed 25 times for a single conversation.

At scale that's expensive and slow — token cost and latency both scale linearly with the number of KPIs, and most of those tokens are spent re-reading the same input. The naive design treats 25 related questions as 25 unrelated problems.

The Approach

Group what's correlated, ask it once

01

Map the KPI structure

Modelled the 25 KPIs by call stage and semantics — beginning, patient discussion, usage patterns, needs, growth questions, product messaging and closing — surfacing which questions share context and reasoning.

02

Batch correlated KPIs

Grouped KPIs that draw on the same passages and intent into a single request, so the transcript and chain-of-thought are amortised across the whole group instead of repeated per KPI.

03

Enforce structured output

Constrained each grouped call to a typed schema (one structured record per KPI), so a single response cleanly yields many independent, machine-readable results.

04

Preprocess once, reuse

Built an event-driven pipeline that preprocesses the transcript a single time and feeds every KPI group from it, eliminating redundant work end to end.

The Pipeline

One pass, many KPIs

Event Buscall transcript in
Preprocessonce per call
Grouped KPI callscorrelated & batched
Structured outputone record per KPI
Event BusKPIs out
What We Built

The engineering underneath the numbers

A semantic KPI grouping25 KPIs clustered by call stage and shared context into a handful of request groups.
Batched structured-output requestsTyped schemas that return many independent KPI verdicts from one call.
An event-driven inference pipelineEvent bus in and out, with a model served and tracked through MLflow.
Single-pass preprocessingTranscript prepared once and reused across every KPI group, cutting redundant tokens.

LLM bill scaling the wrong way?

See if we're a fit →
Previous
Previous

Negative Sampling