Back to selected work

Difficulty-aware LLM router

Sends each prompt to the smallest model that can answer it well.

37% less generation energy than always using the largest model

Undergraduate research assistant, sole developer · Summer 2026, Siena University

Problem

Running the largest model on every prompt wastes energy, because many prompts are easy enough for a small model.

My role

I designed and built the whole project myself: the energy measurements, the difficulty models, the router and the routing experiment. Dr. Ting Liu and Dr. Kate Meierdiercks were my faculty advisors, in Siena’s Summer 2026 “The Ethical Implications of AI” program.

What I built

Result

The router cut generation energy by about 37% compared with always using the largest model, over 19,952 held-out prompts. Both were held to the same quality bar: 90% of prompts reach a model at least as large as their difficulty calls for. That bar comes from a difficulty score rather than graded answers, so grading the answers themselves is the next check.

The router running in the browser on four prompts. An easy factual question goes to the 0.5B model (72.9 J), a literature question to the 1B model (128.0 J), a C code question to the 3B model (221.8 J) and a sonnet request to the 8B model (486.6 J).

Stack

Python, TF-IDF plus Ridge regression, Ollama, NVML, CodeCarbon.

What I’d do differently

I’d analyze the model outputs more closely to see whether there’s more room to optimize. With more funding, I’d also test whether the savings change across CPUs with more threads and cores.

Stack: Python, scikit-learn, Ollama, NVML, CodeCarbon