Book a call
← All work
[ 03 ] · Case study · AI cost

80% cheaper AI classification

A hybrid pipeline that sends common cases to fast classic models and keeps generative AI for the hard ones.

Role
AI engineer
Approach
Confidence-based routing
Models
SBERT · classic ML · Llama 3
Status
In production
[ 01 ]
80%
Lower cost

to run the classification

[ 02 ]
90%
Lower latency

for each request

[ 03 ]
LLM
Only when needed

hard cases get the big model

SBERTClassic MLLlama 3
[ 01 ]

The problem

Classifying every item with a large language model worked well, but it was slow and expensive at scale.

[ 02 ]

What I built

A router: sentence embeddings (SBERT) and fast classic models handle the common, clear-cut cases, and only uncertain ones go to Llama 3. Confidence thresholds decide which path each item takes.

[ 03 ]

How it works

01

Embed

Each item becomes a vector with SBERT.

02

Score

Fast models predict with a confidence score.

03

Route

Confident → done. Unsure → Llama 3.

04

Monitor

Results are watched to tune the thresholds.

[ 04 ]

Results

  • 80% lower running cost.
  • 90% lower latency per request.
  • Generative AI kept for the cases where it actually adds value.
Stack
PythonSBERTClassic MLLlama 3Confidence routing
[ 05 ]

For your business

If AI is already part of your business but the bill or the waiting time is growing, the same idea applies: use the expensive model only where it matters.

Want something like this for your business?Free demo on your own site or documents. I reply within 24 hours.
Next case study · [ 04 ]Payment-behaviour scoring