SShortSingh.
Back to feed

40 Lines of Go Slashed One Team's LLM Costs by 71% Using Cheap-First Routing

0
·1 views

A development team discovered they were routing nearly all LLM requests — including trivial tasks like naming files or generating titles — through an expensive frontier model by default. After reviewing their traffic mix, they built a lightweight Go-based router that sends requests to a cheaper model first and only escalates to the stronger model if the output fails a quality gate. The system moved 81% of requests off the expensive model, cutting the overall bill by 71%, with only a 15% escalation rate. The team found that pre-classifying prompts by difficulty was unreliable, since short prompts can be complex and long ones trivial, making output-based judgment more effective than input-based prediction. They noted that latency, not cost, proved to be the more significant constraint in practice.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer Seeks Community Help to Validate React Flex Forms SPFx Sample

A developer has built a SharePoint Framework sample called React Flex Forms, consisting of two web parts: a Form Designer and a Form Renderer that saves submissions to a SharePoint list. The sample has passed local lint, build, and packaging checks, but still requires real-tenant validation and screenshots for the official PnP sample README. Anyone with access to a SharePoint Online tenant is being asked to test the web parts and capture scrubbed screenshots showing the designer and renderer in action. Feedback on provisioning, permissions, accessibility, responsive behavior, and theme support is also welcome. Contributions can be submitted directly to pull request #6473 on the project repository.

0
ProgrammingHacker News ·

Survey: Majority of Britons want private messaging to remain encrypted

A new survey indicates that most people in the United Kingdom want their private messages to remain secure and unmonitored. The findings come amid ongoing government debates over whether tech companies should be required to provide backdoor access to encrypted communications. Authorities have argued that such access is necessary for national security and law enforcement purposes. Privacy advocates, however, warn that weakening encryption would expose ordinary users to significant security risks. The survey results suggest public opinion leans strongly toward protecting message privacy over expanded surveillance capabilities.

0
ProgrammingDEV Community ·

How One Developer Built a 237-Endpoint Vedic Astrology API and the Bugs Found Along the Way

A developer recently published a technical retrospective on building GrahaAPI, a REST API covering 237 endpoints across 23 modules of Vedic astrology with bilingual Hindi and English responses. The project surfaced a subtle thread-safety bug in the underlying C ephemeris library, where FastAPI's threadpool silently defaulted new threads to tropical zodiac mode instead of sidereal, returning plausible but astronomically wrong planetary positions with no errors. To validate accuracy, the team built regression tests anchored to centuries-old classical invariants — such as Vimshottari dasha periods summing to exactly 120 years and fixed choghadiya sequences — treating any test failure as a code defect, never a test flaw. One such test caught a time-formatting bug where 59.57 seconds was rounded to 60 without carrying over into the next minute, displaying 07:59:34 as 07:00. The post highlights how legacy domain knowledge with frozen specifications can serve as unusually reliable test fixtures for modern software systems.

0
ProgrammingDEV Community ·

Vincent 0.7.0 Released: AI Coding Agent Now Manages Its Own Development

Developer tool Vincent has reached version 0.7.0, with the key milestone being that the project now uses its own workflows to manage its entire development lifecycle, from issue creation to release. The update introduces structured workflow inputs with validation, an expanded CLI enabling scriptable task management without a terminal UI, and resilience features such as retry backoff, repair agents, and daemon backup and restore. A new workflow-authoring skill prioritizes deterministic automation over AI agents, invoking reasoning models only where genuinely needed. The release also re-adopts the MIT license and is designed to work as a vendor-independent local control plane compatible with tools like Claude Code, Codex, or Cursor.

40 Lines of Go Slashed One Team's LLM Costs by 71% Using Cheap-First Routing · ShortSingh