SShortSingh.
Back to feed

How to Build an LLM Model Router to Cut AI Agent Costs

0
·4 views

An LLM model router inspects each incoming request and forwards it to the cheapest model able to handle it, so expensive frontier models are reserved for difficult tasks. The author recommends first labelling at least 500 real user prompts by task type and difficulty, since most turn out to be simple work like formatting or data extraction. A small, inexpensive LLM is suggested as the routing decision-maker rather than brittle keyword rules. Answers can be checked by another LLM acting as judge, with failures escalated to a higher tier, and an escalation rate of 20% or more signals the routing needs work. Savings depend on the share of spending on simple tasks rather than on request volume, and the author reports cutting simple-prompt costs by about 65% in testing.

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 ·

Checking LED COB Lighting Schedules in Python: Watts, VA and Power Factor

A DEV Community post explains that total wattage alone can understate the electrical load of LED COB lighting on commercial sites. Power factor, which is often unstated, determines how much apparent power (VA) and current a fitting draws beyond its rated watts. Voltage sag during peak demand and inrush current at switch-on can also affect breakers and generator sizing. To address this, the author presents a standard-library Python script that reads a lighting schedule in CSV form and reports watts, VA and current per circuit at 230 V and 200 V. The script flags fittings with assumed power factors and notes missing inrush data, and it is presented as a checking aid rather than a replacement for a consultant's design.

0
ProgrammingDEV Community ·

Solo developer builds encrypted AI memory vault with multiple agents in eight hours

On November 28, 2026, a developer launched ownmem, an encrypted memory vault designed to be shared across several AI assistants, taking it from an unregistered domain to four live sites in roughly eight hours. Most of the code was written by multiple AI agents working in parallel, with the developer setting direction and reviewing their output. The product stores users' memories as Markdown files encrypted in the browser, with the server holding only ciphertext, and connects to tools like ChatGPT, Claude, Codex and Cursor via MCP. A key design challenge was letting agents read memory without the server decrypting it, which is handled by relaying requests to an open, unlocked browser tab that decrypts locally. The developer acknowledges trade-offs, including the need for the tab to stay open and an opt-in shared-folder mode that is not zero-knowledge, while cautioning against overstating the privacy guarantees since model providers still process conversation content.

0
ProgrammingDEV Community ·

How One Team Cut Page Load Time from 6 Seconds to 1.8 Seconds

A client's product page took six seconds to display its main content on a mid-range phone over 4G, and its bounce rate was rising. Over two sprints, the team focused on a series of small, measurable fixes rather than a framework rewrite or a bigger server. The largest gain came from the hero image, which was an oversized PNG that was also lazy-loaded; converting it to AVIF, serving appropriately sized versions, and prioritizing its download made a major difference. Further improvements came from route-level code splitting and replacing heavy libraries, which roughly halved the initial JavaScript. The team tracked Largest Contentful Paint as its main metric, using Lighthouse and bundle analysis tools to pinpoint bottlenecks before changing code.

0
ProgrammingDEV Community ·

مؤسس يروي تقدمه لـY Combinator ثلاث عشرة مرة وتطور أفكاره عبر الطلبات

يتحدث مؤسس شركة VISXA عن تقديمه لبرنامج Y Combinator ثلاث عشرة مرة منذ شتاء 2021 حتى صيف 2026 دون أن يُقبل في أي منها. يعود إلى نصوص طلباته القديمة ليتتبع الفرق بين الأفكار التي كانت قيد البحث والمنتجات التي وصلت فعلًا إلى المستخدمين. تنتقل المبادرات من مساعدة المسافرين في طلبات التأشيرات إلى نماذج توجّه المغتربين وروّاد الأعمال الدوليين إلى الخدمات المناسبة. يقدّم المقال أيضًا شريكه أنتوني بَر ومنتجه الجديد: غطاء فولاذي لحماية أطراف الأوتاد في مواقع البناء، وقد دخل الاستخدام التجاري بحسب الطلب الأخير. ويقترح الكاتب على مؤسسي المشروعات مقارنة إجاباتهم عن سؤال التقدم عبر الزمن لمعرفة ما كان يقدمه المنتج فعلًا في كل مرحلة.