Idea · Aug 30, 2026

Build Your Own LLM Router

Students implement a production-quality LLM gateway supporting model selection by cost tier, streaming responses, per-user cost budgeting, retry with backoff, and a live admin dashboard, then benchmark it against an open-source reference implementation.

What it would do

As LLM API calls become standard infrastructure in software products, CS students need hands-on experience with the systems concerns that surround them: latency, cost, fault tolerance, and observability. This four-milestone assignment asks students to build an LLM router from scratch. In the first milestone they implement a FastAPI proxy that routes requests to different providers based on a cost-tier configuration file, validating request schemas and returning unified response objects. In the second milestone they add streaming response support using server-sent events, with a configurable timeout and retry policy. In the third milestone they implement per-user cost budgeting backed by a SQLite ledger: requests are metered by token count, budgets are enforced per user, and the gateway returns a 429 with remaining budget when the limit is hit. In the fourth milestone students build a React admin dashboard showing real-time request volume, cost burn rate by user, provider latency distributions, and error rates. The final deliverable includes a benchmarking report comparing their gateway's throughput and latency tail to OmniRoute on a shared load-test harness. An optional extension adds multi-key rotation and circuit-breaker logic for providers that return 5xx errors.

Key features

  • Four milestones: cost-tier routing proxy, streaming SSE support, per-user cost budgeting ledger, and real-time admin dashboard
  • Shared benchmark harness measuring requests per second, P95 latency, and budget enforcement accuracy against a reference implementation
  • Instructor-provided stub configurations for multiple providers so the assignment works in development without live API keys
  • Optional extension: multi-key rotation pool and circuit-breaker state machine for providers returning 5xx errors

More in Systems & Hardware

Protocol Interop Lab

Students design and implement a custom agent-to-agent communication protocol, build two cooperating AI agents that use it to solve a shared problem, then test interoperability with a stranger's implementation on Interop Day.

Systems & HardwareClass assignmentLargeSep 13, 2026

Browser OS Scheduler Lab

Students build a fully browser-native OS process scheduler simulation using Web Workers and SharedArrayBuffer, then add a Claude-powered inspector that explains scheduling decisions in plain English.

Systems & HardwareClass assignmentLargeSep 4, 2026

Mini-Compiler Workbench

A multi-week course project in which students implement a complete compiler pipeline from scratch: lexer, recursive-descent parser, AST, type checker, and a bytecode virtual machine, culminating in a working language that compiles and runs a reference program.

Systems & HardwareClass assignmentLargeAug 23, 2026

Event Log Time Machine

Students build a journal app using event sourcing: every change is an immutable log entry, and a time-travel UI lets them rewind the app to any past state, teaching distributed-systems patterns through a complete, tangible project.

Systems & HardwareClass assignmentLargeAug 22, 2026

All 39 ideas in Systems & Hardware →