
This project solves a common problem in production AI systems: using an expensive large language model for every query, even simple ones, wastes both money and compute. The Token-Efficient Routing Agent addresses this by analyzing each incoming query and automatically routing it to the most appropriate model. Simple, direct questions (e.g., "What is the capital of France?") are routed to gpt-oss-20b, a smaller and faster model. Complex questions that require reasoning, comparison, or detailed explanation (e.g., "Explain how neural networks work in detail") are routed to gpt-oss-120b, a larger and more capable model. The routing decision is based on query length and the presence of complexity-indicating keywords such as "explain," "analyze," and "compare." After each response, the agent reports the tokens used, estimated cost, and estimated savings compared to always using the large model. This approach mirrors how production AI systems can meaningfully reduce inference costs at scale without sacrificing response quality where it actually matters, making it a practical and beginner-friendly introduction to cost-aware AI system design.
13 Jul 2026