Back to Portfolio
Case StudyOpen Source

Kindling

An adaptive, tiered LLM inference runtime — it reads how hard a request is and routes it to the cheapest model that can still get it right.

TypeScript library|Public on GitHub|Tiered model routing

The Problem

Sending every request to a top-tier model is simple and expensive. Most production LLM traffic is easy — short classifications, extractions, routine generations — and would be served just as well by a smaller, cheaper model. But deciding which request needs the big model, per call, is the hard part. Get it wrong toward cheap and quality drops; get it wrong toward expensive and the bill balloons.

The Approach

Kindling treats model selection as a routing problem. Each incoming request is analyzed for complexity and matched to the lowest-cost tier that can handle it within the caller's cost constraints. The routing logic is the product — a clean API surface that drops in front of whatever models you already use.

Because routing decisions are risky to change blindly, Kindling added a shadow mode: new routing logic runs alongside production, scoring what it would have done without affecting live traffic — so a change can be validated on real requests before it ships.

The Build

Built as a public TypeScript library, developed in phases up to:

Complexity analysis per incoming request
Tiered routing to the cheapest capable model
Cost-constraint-aware model selection
Shadow mode for safe evaluation of routing changes
ML meta-confidence classifier
Open-source TypeScript library

The latest phase introduced an ML meta-confidence classifier — a model that predicts how confident the routing decision should be, sharpening the tier selection beyond hand-tuned heuristics.

The Result

Kindling is published open-source and serves as the reference implementation of the cost-aware routing patterns I apply when a build's LLM spend needs to scale without a linear cost curve. It pairs naturally with multi-model systems where the same question can be answered at very different price points.

Stack

TypeScriptNode.jsLLM routingML classification

Want something like this?

I ship production-ready applications fast. Let's talk about your project.

FL

FormationLabs

AI Assistant

Hey! I'm the Formation Labs AI assistant. How can I help you today?

Quick questions:

Powered by FormationLabs