03 / LLM infrastructure

Distiller

Project study

Change one line, and repeated LLM calls slowly move to a small model you own.

Distiller / LLM infrastructure / 2026

Role
Solo — design and backend
Status
In progress
Year
2026
Stack
Python / FastAPI / LiteLLM / LoRA / Ollama

02 / Overview

An OpenAI-compatible gateway that learns your most repeated calls.

Distiller sits between an application and its LLM provider. A team adopts it by changing one line — the base URL. It logs the calls that keep repeating, fine-tunes small open models with LoRA to copy the large model on exactly those tasks, tests them quietly, and only then starts routing to them.

  1. Gateway
  2. Log
  3. Fine-tune
  4. Shadow test
  5. Route

Distiller / how the parts connect

03 / The problem

Companies pay a large model to answer the same kind of question all day.

A lot of production LLM traffic is repetitive: the same extraction, the same classification, the same formatting. A much smaller model could handle it — but switching safely means collecting data, training, evaluating and routing, which most teams never get round to.

  1. 01

    Repetitive calls billed at large-model prices

  2. 02

    No safe path from a big model to a small one

  3. 03

    Switching models means touching application code

04 / How it works

Log, train, test in the shadows, then route — with a fallback at every step.

  1. 01

    Gateway

    An OpenAI-compatible endpoint; adoption is a one-line change.

  2. 02

    Log

    Record repeated calls and the large model's answers.

  3. 03

    Fine-tune

    Train small open models with LoRA to copy those answers.

  4. 04

    Shadow test

    Run the small model alongside the big one and compare.

  5. 05

    Route

    Send confident requests to the small model, fall back otherwise.

05 / Key decisions

Where the important calls were made.

Decision 01

How do teams adopt it without rewriting code?

  1. →

    The choice

    Be OpenAI-compatible.

  2. →

    What it gave

    Adoption is a one-line base-URL change.

Decision 02

When is a small model good enough?

  1. →

    The choice

    Prove it in shadow mode first.

  2. →

    What it gave

    Nothing is routed until the small model has matched the large one on real traffic.

Decision 03

What if the small model is unsure?

  1. →

    The choice

    Fall back to the large model.

  2. →

    What it gave

    Quality never drops below what the team had before.

06 / The flow

From the first step to the result.

What it looks like from the side of the person using it — the path through Distiller in 4 steps.

  1. 01Point the app at Distiller
  2. 02Let it log real traffic
  3. 03Train and shadow-test small models
  4. 04Route confident requests

Distiller / user flow

07 / Outcome

Built in the open, one stage at a time.

Gateway skeleton and CLI
Working
LoRA training and routing
In development
To adopt it
1 line
04 / Next project Payment Advice Reads customer payment advices and auto-maps every payment to the right open invoices for the finance team.