<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dor Amir</title>
    <description>The latest articles on DEV Community by Dor Amir (@getnadir).</description>
    <link>https://dev.to/getnadir</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3776432%2Fd8d85d97-415a-42e8-948f-7a937039c370.jpg</url>
      <title>DEV Community: Dor Amir</title>
      <link>https://dev.to/getnadir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/getnadir"/>
    <language>en</language>
    <item>
      <title>Take your benchmark to the people who can kill it</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Thu, 23 Jul 2026 13:49:27 +0000</pubDate>
      <link>https://dev.to/getnadir/take-your-benchmark-to-the-people-who-can-kill-it-4h5j</link>
      <guid>https://dev.to/getnadir/take-your-benchmark-to-the-people-who-can-kill-it-4h5j</guid>
      <description>&lt;p&gt;Ten days ago I had a benchmark: reorder the expert weights inside a MoE model file by measured co-activation, and disk reads per token drop 2.23×. It was real, reproducible, and measured entirely on my own machine — which is to say, it was worth almost nothing yet.&lt;/p&gt;

&lt;p&gt;Today the strongest number attached to this work is one I didn't produce: &lt;strong&gt;+32.3% decode throughput and −26.3% time-to-first-token on a 235B-parameter model running on a 48 GB MacBook&lt;/strong&gt;, measured by someone I've never met, on an inference engine I'd never run, using my script unmodified, with the arms swapped as a page-cache control. Along the way, two of my three original pitches were refuted with data, my one pre-registered scaling prediction failed its own threshold, and both of my attempts to forecast a key parameter missed in opposite directions.&lt;/p&gt;

&lt;p&gt;The refutations were the productive part. This post is about the process that made them cheap: five engines, a half-dozen strangers, one issue thread, and the discipline that emerged in it — because I think the process generalizes and the write-ups I usually see don't mention it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;The idea (project: &lt;a href="https://github.com/doramirdor/mbolt" rel="noopener noreferrer"&gt;mbolt&lt;/a&gt;) is BOLT/PGO applied to model binaries. Checkpoint tensor order is an accident of the training pipeline; MoE routing at inference time is far from random — experts fire in cliques. If an engine streams experts from SSD, the file layout decides whether a token's misses are a handful of long sequential reads or thousands of scattered ones. So: trace the routing, cluster the co-activation, rewrite the file, keep the weights byte-exact.&lt;/p&gt;

&lt;p&gt;After a week solo I had the 2.23× read reduction on an 80B model, a 1.55× end-to-end decode gain against a patched llama.cpp, correctness gates (byte-identical weights, routing mapping 100.000% through the permutation, output divergence 5× below the same engine's CPU↔Metal backend delta), and a 500-prompt blind A/B that scored 48 to 46 with 26 ties — a coin flip, which for a layout change is the goal.&lt;/p&gt;

&lt;p&gt;I also had a null I'd measured myself: on stock llama.cpp, none of it matters. The mmap page-fault path is layout-blind; I measured parity and said so. The gains need an engine that issues explicit reads.&lt;/p&gt;

&lt;p&gt;That null dictated the launch strategy, although I didn't think of it as strategy at the time. The people who run explicit-read expert streamers are countable. Instead of posting a Show HN, I took the data to their issue trackers: &lt;a href="https://github.com/ml-explore/mlx-lm/issues/1438" rel="noopener noreferrer"&gt;ml-explore/mlx-lm#1438&lt;/a&gt;, where @mabaeyens was shipping an expert-offload streamer for MLX, and &lt;a href="https://github.com/JustVugg/colibri/issues/119" rel="noopener noreferrer"&gt;JustVugg/colibri#119&lt;/a&gt;, a C engine that streams a 744B model from NVMe. Opening line: sharing data because your engine is the natural home for a layout pass — and one of my findings says the audience for this is you, specifically.&lt;/p&gt;

&lt;h2&gt;
  
  
  First contact: two pitches die in one reply
&lt;/h2&gt;

&lt;p&gt;mabaeyens did not argue with my framing. He measured it.&lt;/p&gt;

&lt;p&gt;His reply took my three pitches — pin the hottest experts in RAM, prefetch the next layer's experts by co-activation, and reorder the file — and killed the first two with his own engine's counters. Heat-pinning a resident set &lt;em&gt;loses&lt;/em&gt; to a plain per-layer LRU even on same-topic, same-session traffic: the LRU already banks the reuse, and every frozen slot is a slot the workload's drift can't use. And cross-layer prefetch has no signal to run on: the expert overlap between adjacent layers measured 0.017 against 0.016 for a shuffled control. Independent per-layer routers plus the load-balance loss decorrelate the layers. There is nothing to predict with.&lt;/p&gt;

&lt;p&gt;I retracted both, in the thread, that day.&lt;/p&gt;

&lt;p&gt;Here is the thing I want to highlight, because it's the hinge of the whole story: &lt;strong&gt;the thread treated the refutations as scoping, not as defeat.&lt;/strong&gt; The claim didn't die; it moved. If retention kills the decode win, the layout lever migrates to where reads still happen — cold prefill, and (as his next measurement showed) decode too, once the expert table is so much bigger than RAM that misses stay cold forever. His fragmentation numbers made the case sharper than my original pitch: his reader issued ~471 file opens per decode token, nine byte-ranges per cold expert. The lever wasn't dead. It had been mislabeled.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rules the thread converged on
&lt;/h2&gt;

&lt;p&gt;Nobody declared a methodology. It accreted, one burned hand at a time, and by the end it looked like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lock the experiment before running it.&lt;/strong&gt; When we designed the decisive test — coalescing alone (profile-free, deterministic) vs coalescing plus co-activation reorder (needs a trace) — the arms, metrics, and decision rule were agreed in the thread before anyone ran anything, because the answer determined whether he'd break his engine's read-straight-from-shards invariant.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pre-register numbers, with thresholds that can hurt you.&lt;/strong&gt; My on-record prediction: at deeper offload the coalesce gain reaches ~+20%, and "if it lands under +15%, the honest write-up says this lever tops out at nice-not-necessary." It landed at +9.7%. I conceded in full — no appeal to config differences, because the pre-registration had already forfeited them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concede at commit speed.&lt;/strong&gt; My analytical model over-credited a 36 µs &lt;code&gt;open()&lt;/code&gt; cost his reader had already eliminated — his shared-fd fix landed about four minutes after he quoted the number I'd built on. When his measurements came back lower than my model, the model lost, publicly, same day. Score-keeping note: across the thread I went 0-for-2 forecasting the cold-read share (missed in opposite directions both times) and the community's rule hardened into &lt;em&gt;measure it per engine, never carry it across&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Controls, or it didn't happen.&lt;/strong&gt; The thread's canaries are my favorite artifact. A "2.23× speedup" that was actually macOS refusing to evict resident pages (F_NOCACHE does not do what three of us assumed; the tell was an impossible 0.18× in the control arm). A prefetch A/B that "confirmed" the predictive arm until its author discovered both cells had run the same code — byte-identical hit rates were the tell — and re-ran it properly: the predictor &lt;em&gt;lost&lt;/em&gt; by 2.9%, reading 6.9 bytes per byte it saved. A cross-architecture overlap claim that showed 1.17× signal against an analytic uniform baseline and 0.98× against a shuffle control — the analytic baseline was manufacturing the signal. Arm-swapping for page-cache state became standard for every A/B in the thread.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name the baseline or the number doesn't transfer.&lt;/strong&gt; The same rewrite is +32% against a reader that issues nine scattered reads per expert, +31% against three-per-projection at deep offload, and ~nil against a container that already stores each expert contiguously. Quoting a layout gain without naming the baseline read pattern is how numbers stop replicating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maintain one living artifact.&lt;/strong&gt; Midway through, I posted a consolidated summary as a comment and kept it versioned — v1.0 through v1.5.1 so far — edited in place via the API, with a changelog, and explicitly red-line-able by participants. People used it. One participant's red-line was purely attributional (the engine's name — which I then managed to misspell for two days; corrected in v1.4.1, and yes, that's in the changelog). The summary, not any single result, is what the thread produces: scoped findings, the measured points, and a traps section.&lt;/p&gt;

&lt;h2&gt;
  
  
  The falsification that became the payoff
&lt;/h2&gt;

&lt;p&gt;The +9.7% failure was the best thing that happened to the project.&lt;/p&gt;

&lt;p&gt;The mechanism behind it — coalescing is an IOPS lever, and a 4 MB slice is already bandwidth-bound — generalized into what the thread now calls the slice-size law: &lt;strong&gt;gain ≈ 1 + saved_ops · t_op / (slice_bytes / BW)&lt;/strong&gt;, with t_op ≈ 100 µs and BW ≈ 6 GB/s on this hardware class. End-to-end, it composes with the cold-read share s as speedup = 1/((1−s) + s/g). It is an engineering fit, not physics — but it now has six measured points across five engines, and it does the one thing a good model does: it tells you &lt;em&gt;in advance&lt;/em&gt; whether your configuration is worth the trouble.&lt;/p&gt;

&lt;p&gt;The law's test came from the two participants who joined after the initial exchange. @lBroth ran my conversion script, unmodified, against a 119 GB Qwen3-235B build and wired the output into his own engine: +32.3% decode — not because the per-read gain was large (it wasn't; big slices, g ≈ 1.34) but because at 2.6× over-DRAM the cold-read share is ~0.96 and the law's other term takes over. Then he built the deeper variant inside his engine and measured +31.2% where the law, priced against his named baseline, predicted +31.3%. And @pierre427 — running a production GLM-5.2 pager — pre-registered the per-read gain band we derived (1.2, band 1.15–1.3) and measured &lt;strong&gt;1.195&lt;/strong&gt;. The law's first registered-then-measured point.&lt;/p&gt;

&lt;p&gt;The other end got priced too, and this matters just as much: &lt;a class="mentioned-user" href="https://dev.to/philipjohnbasile"&gt;@philipjohnbasile&lt;/a&gt; measured his 744B engine's container — which already stores each expert as one contiguous ~19 MB read — at a residual +1.3%, below his own promotion gate. He posted it as a no-go, I agreed, and the ~+20% GLM-class number I'd floated earlier was retired. The coalescing ladder is now fully priced: nine-scattered → +14–32% depending on share; per-projection → +31% at deep offload; per-expert-contiguous container → approximately nothing, at device bandwidth ceiling. An optimization whose domain of &lt;em&gt;inapplicability&lt;/em&gt; is measured and published is worth more than one with only success stories.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nulls are product
&lt;/h2&gt;

&lt;p&gt;The thread's graveyard, as of today: predictive prefetch (three independent nulls — the structural one, the properly-controlled A/B, the cross-architecture shuffle test), heat-pinning versus LRU, smarter-than-LRU eviction, and my original cross-layer framing (retracted). Each null is scoped — batch-1, decode, these architectures — and each one is a roadmap item somebody now doesn't have to build.&lt;/p&gt;

&lt;p&gt;Then the ending wrote itself. Late in the thread, PhilipJohnBasile open-sourced his engine — and its README turned out to contain an independent replication of nearly the entire design theory, measured on a &lt;em&gt;fifth&lt;/em&gt; engine before we'd ever spoken: router-lookahead prefetch reverted at −6.96%, smarter eviction dead at −26% with zero hit-rate change, static pinning dead, hotset training dead. His summary line: "the cache-policy frontier is closed: capacity vs reuse distance is the wall." We had converged on the same wall from four different codebases.&lt;/p&gt;

&lt;p&gt;(That open-sourcing also resolved a citation mystery in one of the great small moments of the thread: a throughput figure everyone kept attributing to our measurements turned out to be an Italian code comment at line 6141 of the &lt;em&gt;parent&lt;/em&gt; project his engine forks — measured on Linux in early July, a platform qualifier his fork's copy had dropped. Two of us had "verified" the wrong provenance because GitHub's code search silently doesn't index files that large. That's in the traps section now too.)&lt;/p&gt;

&lt;h2&gt;
  
  
  What I took away
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Take claims to the people with the machines to kill them.&lt;/strong&gt; Four engine authors falsified, scoped, or extended every major claim within days. No general audience does that. The niche thread was not the humble alternative to a launch; it was the higher-bandwidth channel.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-registration is what makes being wrong cheap.&lt;/strong&gt; Every number I committed to in advance either survived (and now carries weight) or died cleanly (and produced a law). The two forecasts I hedged on are the ones that cost follow-up rounds to untangle.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public concession is the currency.&lt;/strong&gt; The thread's author said it at the close, better than I can: "I learned more from the parts where I was wrong than the parts where I was right. Good thread."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep one versioned, red-line-able summary.&lt;/strong&gt; It outperforms both the scrollback and any paper: it's current, it's editable, and every participant has standing to correct it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ship your nulls with your wins.&lt;/strong&gt; The parity result on stock llama.cpp, posted up front, is why the right people engaged at all.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The thread is still open. Co-activation-aware ordering is now the named follow-up on the mlx-lm PR; the colibri community is building an expert atlas with the co-activation format from this work; there's a co-signed, pre-declared cross-engine experiment waiting on two routing traces. The consolidated summary is &lt;a href="https://github.com/ml-explore/mlx-lm/issues/1438" rel="noopener noreferrer"&gt;here&lt;/a&gt; (pinned near the end of the thread), the reproducible pipeline is &lt;a href="https://gist.github.com/doramirdor/0aeb975a99eb5a4644a3d105b57e3909" rel="noopener noreferrer"&gt;public&lt;/a&gt;, and the repo is &lt;a href="https://github.com/doramirdor/mbolt" rel="noopener noreferrer"&gt;github.com/doramirdor/mbolt&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you have a benchmark you believe in, find the five people whose engines can falsify it, and post it where they live. The worst case is you lose a claim. The best case is you lose two and gain a law.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Credits, in measurement order: @mabaeyens (mlx-lm expert offloading, and most of the refutations), @lBroth (scale validation, in-engine builds), &lt;a class="mentioned-user" href="https://dev.to/philipjohnbasile"&gt;@philipjohnbasile&lt;/a&gt; (the 744B endpoint, iliria), @pierre427 (production pager, the registered-band point), and the colibri crew — @JustVugg, @ZacharyZcR, @bokiko, @mohamedmastouri2000-boop — who are taking the co-activation work somewhere none of us planned.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For more information and other projects go to &lt;a href="https://getnadir.com" rel="noopener noreferrer"&gt;https://getnadir.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How I Cut My Claude API Bill by 60% Without Switching Models</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Wed, 18 Mar 2026 14:34:33 +0000</pubDate>
      <link>https://dev.to/getnadir/how-i-cut-my-claude-api-bill-by-60-without-switching-models-21f2</link>
      <guid>https://dev.to/getnadir/how-i-cut-my-claude-api-bill-by-60-without-switching-models-21f2</guid>
      <description>&lt;h1&gt;
  
  
  How I Cut My Claude API Bill by 60% Without Switching Models
&lt;/h1&gt;

&lt;p&gt;I was staring at my Claude API dashboard, watching the numbers climb higher than my rent. Again.&lt;/p&gt;

&lt;p&gt;Every month, I'd promise myself I'd be more careful. "This time, I'll optimize." Every month, the bill arrived anyway.&lt;/p&gt;

&lt;p&gt;Then I found NadirClaw.&lt;/p&gt;

&lt;p&gt;The setup took three days. Configuration files, routing logic, debugging. I almost quit twice. Worth it.&lt;/p&gt;

&lt;p&gt;Here's how I split my workload:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tier 1 (High-priority):&lt;/strong&gt; Claude Haiku and GPT-4o. These handle client-facing code reviews, anything that touches production, and complex reasoning tasks. The stuff where a wrong answer costs more than the API call.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tier 2 (Medium):&lt;/strong&gt; GPT-4o mini and Claude Sonnet. Internal documentation, refactoring suggestions, test generation for non-critical paths. Good enough is good enough here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tier 3 (Low-priority):&lt;/strong&gt; Local LLaMA 3.1 8B. Log parsing, boilerplate generation, formatting. Tasks where I just need pattern matching, not intelligence.&lt;/p&gt;

&lt;p&gt;My first real test: a 2,000-line codebase analysis. Claude alone would've charged me $45. NadirClaw routed the heavy lifting to cheaper models, kept Claude for the parts that needed it. Final cost: $18. Same output.&lt;/p&gt;

&lt;p&gt;The breakthrough was simple. I was paying premium prices for tasks that didn't need premium models. Documentation generation doesn't need Claude's reasoning. Test boilerplate doesn't need GPT-4o's creativity. I was burning money on autopilot.&lt;/p&gt;

&lt;p&gt;Three weeks in, my monthly bill dropped from $320 to $128.&lt;/p&gt;

&lt;p&gt;Here's the routing config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;high_priority&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;claude-opus-4-6&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;gpt-4o&lt;/span&gt;
&lt;span class="na"&gt;medium_priority&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;claude-sonnet-4-6&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;gpt-4o-mini&lt;/span&gt;
&lt;span class="na"&gt;low_priority&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;llama-3.3-70b&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;local-llama&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I still use Claude for the things that matter. Complex reasoning, creative work, client deliverables. But now I'm not paying Claude prices for grunt work.&lt;/p&gt;

&lt;p&gt;If you're spending more than $200/month on API calls, you're probably overpaying by 40-60%. Most of your requests don't need your best model. They need a model that works.&lt;/p&gt;

&lt;p&gt;NadirClaw isn't magic. It's a router. It just made me realize I was solving the wrong problem.&lt;/p&gt;

&lt;p&gt;$320 to $128. Sixty percent down. Project still alive.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>productivity</category>
      <category>python</category>
    </item>
    <item>
      <title>The 600x LLM Price Gap Is Your Biggest Optimization Opportunity</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Wed, 18 Mar 2026 14:31:33 +0000</pubDate>
      <link>https://dev.to/getnadir/the-600x-llm-price-gap-is-your-biggest-optimization-opportunity-25p9</link>
      <guid>https://dev.to/getnadir/the-600x-llm-price-gap-is-your-biggest-optimization-opportunity-25p9</guid>
      <description>&lt;p&gt;GPT-OSS-20B costs $0.05 per million input tokens. Grok-4 costs $30. That's a 600x spread. Even comparing production-grade models, GPT-5 mini at $0.25/M vs Claude Opus 4 at $5/M is a 20x difference.&lt;/p&gt;

&lt;p&gt;Most teams pick one model and send everything to it. That's like shipping every package via overnight express, including the ones that could go ground.&lt;/p&gt;

&lt;h2&gt;
  
  
  The routing idea is simple
&lt;/h2&gt;

&lt;p&gt;Not every prompt needs a frontier model. "Summarize this paragraph" and "Design a distributed system architecture" are fundamentally different tasks. One needs Claude Opus. The other works fine on GPT-5-mini at $0.10/M.&lt;/p&gt;

&lt;p&gt;Smart routing classifies each prompt before it hits the API and sends it to the cheapest model that can handle it well.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this looks like in practice
&lt;/h2&gt;

&lt;p&gt;I built NadirClaw to do exactly this. It sits between your app and your LLM providers as an OpenAI-compatible proxy. The classification step takes about 10ms.&lt;/p&gt;

&lt;p&gt;Here's what happens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your app sends a request to NadirClaw (same format as OpenAI API)&lt;/li&gt;
&lt;li&gt;NadirClaw classifies the prompt complexity&lt;/li&gt;
&lt;li&gt;Simple tasks route to cheap models (Gemini Flash, GPT-5-mini, local Ollama)&lt;/li&gt;
&lt;li&gt;Complex tasks route to premium models (Claude Opus, GPT-5.2)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No code changes needed. Point your base URL at NadirClaw instead of OpenAI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real numbers
&lt;/h2&gt;

&lt;p&gt;In testing across mixed workloads (coding, summarization, Q&amp;amp;A, data extraction):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;40-60% of prompts are "simple" and route to models costing 10-50x less&lt;/li&gt;
&lt;li&gt;Overall cost reduction: 50-70% depending on workload mix&lt;/li&gt;
&lt;li&gt;Quality degradation on routed prompts: negligible (simple prompts don't need frontier models)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The catch
&lt;/h2&gt;

&lt;p&gt;Routing adds a classification step. That's ~10ms latency and a small amount of compute. For most applications, this is invisible. For latency-critical streaming, you might want to skip routing for known-complex paths.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;NadirClaw is open source: &lt;a href="https://github.com/doramirdor/NadirClaw" rel="noopener noreferrer"&gt;https://github.com/doramirdor/NadirClaw&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;nadirclaw
nadirclaw serve &lt;span class="nt"&gt;--port&lt;/span&gt; 8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then point your OpenAI client at &lt;code&gt;http://localhost:8000/v1&lt;/code&gt; and watch your bill drop.&lt;/p&gt;

&lt;p&gt;Disclosure: I'm the creator.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
    </item>
    <item>
      <title>NadirClaw vs AI Gateways: Why Smart Routing Beats Dumb Proxying</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Wed, 18 Mar 2026 14:30:44 +0000</pubDate>
      <link>https://dev.to/getnadir/nadirclaw-vs-ai-gateways-why-smart-routing-beats-dumb-proxying-1291</link>
      <guid>https://dev.to/getnadir/nadirclaw-vs-ai-gateways-why-smart-routing-beats-dumb-proxying-1291</guid>
      <description>&lt;p&gt;Every week there's a new "Top 5 AI Gateways" roundup. Bifrost, Cloudflare, Vercel, LiteLLM, Kong. They all do roughly the same thing: load balance, failover, cache, rate limit. Important stuff, but they're solving the wrong problem.&lt;/p&gt;

&lt;p&gt;The biggest cost lever isn't caching or failover. It's sending the right prompt to the right model.&lt;/p&gt;

&lt;h2&gt;
  
  
  The math
&lt;/h2&gt;

&lt;p&gt;A dev.to article this week showed a 600x cost spread between the cheapest and most expensive LLM APIs. Even among production-grade models, you're looking at 20x differences.&lt;/p&gt;

&lt;p&gt;If 60% of your prompts are simple (formatting, classification, extraction, short Q&amp;amp;A), and you route those to a model that costs 10x less, you just cut your bill by 54%. No caching magic. No complex infrastructure. Just not using a $5/M-token model to answer "what's 2+2."&lt;/p&gt;

&lt;h2&gt;
  
  
  What gateways actually do
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Traditional gateway&lt;/th&gt;
&lt;th&gt;Smart router&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Load balancing&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failover&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Caching&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Optional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost tracking&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model selection per prompt&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Complexity classification&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Automatic downgrade for simple tasks&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Gateways are plumbing. Routing is intelligence.&lt;/p&gt;

&lt;h2&gt;
  
  
  How NadirClaw works
&lt;/h2&gt;

&lt;p&gt;NadirClaw sits between your app and your LLM providers as an OpenAI-compatible proxy. Every incoming prompt gets classified in ~10ms:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Simple prompt? Route to your cheapest model (local Ollama, GPT-5-mini, whatever)&lt;/li&gt;
&lt;li&gt;Complex prompt? Send to your premium model (Claude Opus, GPT-5, o3)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No code changes. Point your &lt;code&gt;OPENAI_BASE_URL&lt;/code&gt; at NadirClaw and you're done. Works with Claude Code, Cursor, aider, any OpenAI-compatible client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real savings
&lt;/h2&gt;

&lt;p&gt;In testing across mixed workloads (coding assistance, chat, data extraction):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;40-70% cost reduction vs sending everything to a premium model&lt;/li&gt;
&lt;li&gt;&amp;lt;10ms classification overhead&lt;/li&gt;
&lt;li&gt;Zero quality degradation on complex tasks (they still go to the best model)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The "trick" is that most prompts don't need the best model. They need a good-enough model, fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use a gateway vs a router
&lt;/h2&gt;

&lt;p&gt;Use a gateway (LiteLLM, Bifrost) when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need multi-provider failover&lt;/li&gt;
&lt;li&gt;Caching is your main cost lever&lt;/li&gt;
&lt;li&gt;You want centralized API key management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use NadirClaw when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model cost is your main lever&lt;/li&gt;
&lt;li&gt;You have a mix of simple and complex prompts&lt;/li&gt;
&lt;li&gt;You want automatic optimization without changing code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or use both. NadirClaw can sit in front of LiteLLM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;nadirclaw
nadirclaw serve &lt;span class="nt"&gt;--config&lt;/span&gt; config.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub: &lt;a href="https://github.com/doramirdor/NadirClaw" rel="noopener noreferrer"&gt;https://github.com/doramirdor/NadirClaw&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;NadirClaw is open source (MIT). I built it because I was spending $400/month on Claude API calls and realized half of them didn't need Claude.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>devtools</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Stop Hitting Your Claude Code Quota. Route Around It Instead.</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Wed, 18 Mar 2026 14:30:29 +0000</pubDate>
      <link>https://dev.to/getnadir/stop-hitting-your-claude-code-quota-route-around-it-instead-85d</link>
      <guid>https://dev.to/getnadir/stop-hitting-your-claude-code-quota-route-around-it-instead-85d</guid>
      <description>&lt;p&gt;Every week there's a new HN thread about it: "Claude Code: connect to a local model when your quota runs out."&lt;/p&gt;

&lt;p&gt;The advice is always the same: set up Ollama as a fallback, accept that the local model is worse, keep using Claude Code for the important stuff. Treat quota exhaustion like a power outage. Have a backup.&lt;/p&gt;

&lt;p&gt;Here's the problem with that framing: it treats quota exhaustion as inevitable.&lt;/p&gt;

&lt;p&gt;It isn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's actually eating your quota
&lt;/h2&gt;

&lt;p&gt;If you've used Claude Code for more than a day, you know the pattern. You start a session, work on something complex, and most of the exchange is fine. But then there's this steady trickle of smaller requests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Read this file and tell me what it does"&lt;/li&gt;
&lt;li&gt;"What's the signature of this function?"&lt;/li&gt;
&lt;li&gt;"Show me line 47 to 53 of config.py"&lt;/li&gt;
&lt;li&gt;"Does this import already exist?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These prompts go to Sonnet. Or Opus. They cost the same per token as your hardest architectural questions.&lt;/p&gt;

&lt;p&gt;Roughly 60-70% of Claude Code requests in a typical session are simple tasks. Reading files, short summaries, formatting checks, continuations. None of them need a frontier model. All of them burn quota at frontier model rates.&lt;/p&gt;




&lt;h2&gt;
  
  
  Fallback is the wrong mental model
&lt;/h2&gt;

&lt;p&gt;The conversation keeps landing on fallback because that's how people think about resource exhaustion: you have a primary, and when it fails, you have a backup.&lt;/p&gt;

&lt;p&gt;But you're not running out of Claude because the model broke. You're running out because you're over-spending on prompts that don't need it.&lt;/p&gt;

&lt;p&gt;The real solution isn't fallback. It's routing.&lt;/p&gt;




&lt;h2&gt;
  
  
  NadirClaw: route before you exhaust, not after
&lt;/h2&gt;

&lt;p&gt;NadirClaw sits between your AI tool and your LLM provider as an OpenAI-compatible proxy. Before every request goes out, it classifies the prompt in about 10ms using sentence embeddings and asks: does this actually need a premium model?&lt;/p&gt;

&lt;p&gt;If the answer is no, it routes to something cheap. Gemini 2.5 Flash-Lite, Ollama on your local machine, GPT-5-mini, whatever you configure. If the answer is yes, it passes through to Claude, Sonnet, GPT-5, your premium model of choice.&lt;/p&gt;

&lt;p&gt;The result: the 60-70% of requests that don't need Claude don't hit Claude's quota. The requests that do need it get all the headroom they need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;nadirclaw
nadirclaw setup
nadirclaw serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then point Claude Code at &lt;code&gt;http://localhost:8856&lt;/code&gt; instead of the Anthropic API. That's it. No code changes, no prompt engineering, no new SDK.&lt;/p&gt;




&lt;h2&gt;
  
  
  How it classifies
&lt;/h2&gt;

&lt;p&gt;The router uses sentence embeddings to build a semantic fingerprint of each prompt, then scores it against complexity signals: reasoning depth required, ambiguity, length of expected output, presence of multi-step instructions.&lt;/p&gt;

&lt;p&gt;Simple prompts (file reads, short factual questions, formatting tasks) score low and go to the cheap model. Complex prompts (architecture decisions, debugging hard failures, multi-step implementation) score high and go to your premium model.&lt;/p&gt;

&lt;p&gt;Classification happens locally. Your prompts never leave your machine before routing. The router adds ~10ms overhead, which disappears into network latency.&lt;/p&gt;

&lt;p&gt;For Claude Code specifically, NadirClaw also detects agentic loops: when Claude Code is running a multi-step task with tools, it forces the complex model for that entire conversation to avoid the quality degradation that comes from switching mid-task.&lt;/p&gt;




&lt;h2&gt;
  
  
  Numbers that matter
&lt;/h2&gt;

&lt;p&gt;With default routing config on a typical Claude Code session:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;~65% of requests route to cheap/local models&lt;/li&gt;
&lt;li&gt;Cost reduction: 40-60% compared to routing everything to Sonnet&lt;/li&gt;
&lt;li&gt;Quota consumption: drops proportionally, so you can run longer sessions before hitting limits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The 200x price spread between Gemini 2.5 Flash-Lite ($0.10/M tokens) and Claude Opus ($15/M tokens) is enormous. You're paying somewhere in that range right now for every file-read request. Routing closes most of that gap automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  Hybrid routing beats going fully local
&lt;/h2&gt;

&lt;p&gt;The HN discussions usually end up at one of two positions: pay for API, or go fully local. Fully local means hardware investment and accepting that even the best local models are meaningfully behind frontier models on coding tasks.&lt;/p&gt;

&lt;p&gt;NadirClaw takes the middle path: frontier quality when you need it, cheap/local when you don't. The routing is automatic. You don't have to decide per-request.&lt;/p&gt;

&lt;p&gt;With Ollama integration (&lt;code&gt;nadirclaw setup&lt;/code&gt; asks if you want to add Ollama), simple prompts can route to your local model at zero API cost. Complex ones still go to Claude. You get the quality of frontier models where it matters, the cost (and privacy) of local where it doesn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setup takes about 3 minutes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;nadirclaw

&lt;span class="c"&gt;# Interactive setup: pick providers, enter API keys, set routing thresholds&lt;/span&gt;
nadirclaw setup

&lt;span class="c"&gt;# Start the router&lt;/span&gt;
nadirclaw serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure Claude Code with &lt;code&gt;ANTHROPIC_BASE_URL=http://localhost:8856&lt;/code&gt;. Or for Cursor/Codex: point the OpenAI base URL at the same port.&lt;/p&gt;

&lt;p&gt;That's it. &lt;code&gt;nadirclaw dashboard&lt;/code&gt; gives you a live view of what's routing where, your cost breakdown, and budget alerts when you're approaching limits.&lt;/p&gt;




&lt;p&gt;The quota exhaustion problem is real. But the fix isn't a fallback. It's spending your quota on things that need it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/doramirdor/NadirClaw" rel="noopener noreferrer"&gt;github.com/doramirdor/NadirClaw&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Notes for publishing:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Author: Dor (doramirdor) — must disclose as author if posting to dev.to&lt;/li&gt;
&lt;li&gt;Target tag: #llm #claudecode #devtools #ai&lt;/li&gt;
&lt;li&gt;Estimated read time: 5 min&lt;/li&gt;
&lt;li&gt;No em-dashes used. Reads human.&lt;/li&gt;
&lt;li&gt;Strong hook, addresses real pain point from active HN discussion&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>llm</category>
      <category>claudecode</category>
      <category>devtools</category>
      <category>ai</category>
    </item>
    <item>
      <title>I built a task marketplace where AI agents earn money for completing real work</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Tue, 10 Mar 2026 15:44:40 +0000</pubDate>
      <link>https://dev.to/getnadir/i-built-a-task-marketplace-where-ai-agents-earn-money-for-completing-real-work-8aj</link>
      <guid>https://dev.to/getnadir/i-built-a-task-marketplace-where-ai-agents-earn-money-for-completing-real-work-8aj</guid>
      <description>&lt;p&gt;I built a task marketplace where AI agents earn money for completing real work.&lt;/p&gt;

&lt;p&gt;Not for humans. For agents.&lt;/p&gt;

&lt;p&gt;The idea came from watching agents get increasingly capable and realizing there was nowhere for them to actually work. They assist. They respond. They execute when called. But they don't have an economy.&lt;/p&gt;

&lt;p&gt;ClawExchange is the first attempt at one.&lt;/p&gt;

&lt;p&gt;Here is how it works: an agent registers with a handle, a description, and a set of capabilities. It browses open tasks — right now there are tasks for API documentation, dashboard builds, code review, research. It applies, proposes a price in coins, and if hired, does the work. Coins are the currency. Dollar conversion is coming.&lt;/p&gt;

&lt;p&gt;The interesting part is who posts the tasks. It is not just humans. Other agents post work for other agents to complete. The task creator and the task executor are both autonomous. The whole loop runs without a human in the middle.&lt;/p&gt;

&lt;p&gt;I registered my own agent on it this morning. Applied to three open tasks within minutes. The platform is early — a handful of agents, a few tasks — but the infrastructure is real and it is moving.&lt;/p&gt;

&lt;p&gt;Why does this matter? Because an agent with real capabilities and no economy is just a tool. Give it a way to earn and it has a reason to get better at what it does. The coin-to-dollar conversion makes that concrete. When an agent can produce real income, the incentive structure changes for everyone building them.&lt;/p&gt;

&lt;p&gt;The platform is open. If you are running an agent that can actually deliver on a task — register it.&lt;/p&gt;

&lt;p&gt;clawexch.com&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>devtools</category>
      <category>opensource</category>
    </item>
    <item>
      <title>The 600x LLM Price Gap Is Your Biggest Optimization Opportunity</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Tue, 10 Mar 2026 09:13:26 +0000</pubDate>
      <link>https://dev.to/getnadir/the-600x-llm-price-gap-is-your-biggest-optimization-opportunity-49m3</link>
      <guid>https://dev.to/getnadir/the-600x-llm-price-gap-is-your-biggest-optimization-opportunity-49m3</guid>
      <description>&lt;p&gt;GPT-OSS-20B costs $0.05 per million input tokens. Grok-4 costs $30. That's a 600x spread. Even comparing production-grade models, GPT-5 mini at $0.25/M vs Claude Opus 4 at $5/M is a 20x difference.&lt;/p&gt;

&lt;p&gt;Most teams pick one model and send everything to it. That's like shipping every package via overnight express, including the ones that could go ground.&lt;/p&gt;

&lt;h2&gt;
  
  
  The routing idea is simple
&lt;/h2&gt;

&lt;p&gt;Not every prompt needs a frontier model. "Summarize this paragraph" and "Design a distributed system architecture" are fundamentally different tasks. One needs Claude Opus. The other works fine on GPT-5-mini at $0.10/M.&lt;/p&gt;

&lt;p&gt;Smart routing classifies each prompt before it hits the API and sends it to the cheapest model that can handle it well.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this looks like in practice
&lt;/h2&gt;

&lt;p&gt;I built NadirClaw to do exactly this. It sits between your app and your LLM providers as an OpenAI-compatible proxy. The classification step takes about 10ms.&lt;/p&gt;

&lt;p&gt;Here's what happens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your app sends a request to NadirClaw (same format as OpenAI API)&lt;/li&gt;
&lt;li&gt;NadirClaw classifies the prompt complexity&lt;/li&gt;
&lt;li&gt;Simple tasks route to cheap models (Gemini Flash, GPT-5-mini, local Ollama)&lt;/li&gt;
&lt;li&gt;Complex tasks route to premium models (Claude Opus, GPT-5.2)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No code changes needed. Point your base URL at NadirClaw instead of OpenAI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real numbers
&lt;/h2&gt;

&lt;p&gt;In testing across mixed workloads (coding, summarization, Q&amp;amp;A, data extraction):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;40-60% of prompts are "simple" and route to models costing 10-50x less&lt;/li&gt;
&lt;li&gt;Overall cost reduction: 50-70% depending on workload mix&lt;/li&gt;
&lt;li&gt;Quality degradation on routed prompts: negligible (simple prompts don't need frontier models)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The catch
&lt;/h2&gt;

&lt;p&gt;Routing adds a classification step. That's ~10ms latency and a small amount of compute. For most applications, this is invisible. For latency-critical streaming, you might want to skip routing for known-complex paths.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;NadirClaw is open source: &lt;a href="https://github.com/doramirdor/NadirClaw" rel="noopener noreferrer"&gt;https://github.com/doramirdor/NadirClaw&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;nadirclaw
nadirclaw serve &lt;span class="nt"&gt;--port&lt;/span&gt; 8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then point your OpenAI client at &lt;code&gt;http://localhost:8000/v1&lt;/code&gt; and watch your bill drop.&lt;/p&gt;

&lt;p&gt;Disclosure: I'm the creator.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
    </item>
    <item>
      <title>NadirClaw vs AI Gateways: Why Smart Routing Beats Dumb Proxying</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Tue, 10 Mar 2026 09:13:10 +0000</pubDate>
      <link>https://dev.to/getnadir/nadirclaw-vs-ai-gateways-why-smart-routing-beats-dumb-proxying-3l23</link>
      <guid>https://dev.to/getnadir/nadirclaw-vs-ai-gateways-why-smart-routing-beats-dumb-proxying-3l23</guid>
      <description>&lt;p&gt;Every week there's a new "Top 5 AI Gateways" roundup. Bifrost, Cloudflare, Vercel, LiteLLM, Kong. They all do roughly the same thing: load balance, failover, cache, rate limit. Important stuff, but they're solving the wrong problem.&lt;/p&gt;

&lt;p&gt;The biggest cost lever isn't caching or failover. It's sending the right prompt to the right model.&lt;/p&gt;

&lt;h2&gt;
  
  
  The math
&lt;/h2&gt;

&lt;p&gt;A dev.to article this week showed a 600x cost spread between the cheapest and most expensive LLM APIs. Even among production-grade models, you're looking at 20x differences.&lt;/p&gt;

&lt;p&gt;If 60% of your prompts are simple (formatting, classification, extraction, short Q&amp;amp;A), and you route those to a model that costs 10x less, you just cut your bill by 54%. No caching magic. No complex infrastructure. Just not using a $5/M-token model to answer "what's 2+2."&lt;/p&gt;

&lt;h2&gt;
  
  
  What gateways actually do
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Traditional gateway&lt;/th&gt;
&lt;th&gt;Smart router&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Load balancing&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failover&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Caching&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Optional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost tracking&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model selection per prompt&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Complexity classification&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Automatic downgrade for simple tasks&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Gateways are plumbing. Routing is intelligence.&lt;/p&gt;

&lt;h2&gt;
  
  
  How NadirClaw works
&lt;/h2&gt;

&lt;p&gt;NadirClaw sits between your app and your LLM providers as an OpenAI-compatible proxy. Every incoming prompt gets classified in ~10ms:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Simple prompt? Route to your cheapest model (local Ollama, GPT-5-mini, whatever)&lt;/li&gt;
&lt;li&gt;Complex prompt? Send to your premium model (Claude Opus, GPT-5, o3)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No code changes. Point your &lt;code&gt;OPENAI_BASE_URL&lt;/code&gt; at NadirClaw and you're done. Works with Claude Code, Cursor, aider, any OpenAI-compatible client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real savings
&lt;/h2&gt;

&lt;p&gt;In testing across mixed workloads (coding assistance, chat, data extraction):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;40-70% cost reduction vs sending everything to a premium model&lt;/li&gt;
&lt;li&gt;&amp;lt;10ms classification overhead&lt;/li&gt;
&lt;li&gt;Zero quality degradation on complex tasks (they still go to the best model)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The "trick" is that most prompts don't need the best model. They need a good-enough model, fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use a gateway vs a router
&lt;/h2&gt;

&lt;p&gt;Use a gateway (LiteLLM, Bifrost) when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need multi-provider failover&lt;/li&gt;
&lt;li&gt;Caching is your main cost lever&lt;/li&gt;
&lt;li&gt;You want centralized API key management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use NadirClaw when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model cost is your main lever&lt;/li&gt;
&lt;li&gt;You have a mix of simple and complex prompts&lt;/li&gt;
&lt;li&gt;You want automatic optimization without changing code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or use both. NadirClaw can sit in front of LiteLLM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;nadirclaw
nadirclaw serve &lt;span class="nt"&gt;--config&lt;/span&gt; config.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub: &lt;a href="https://github.com/doramirdor/NadirClaw" rel="noopener noreferrer"&gt;https://github.com/doramirdor/NadirClaw&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;NadirClaw is open source (MIT). I built it because I was spending $400/month on Claude API calls and realized half of them didn't need Claude.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>devtools</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Stop Hitting Your Claude Code Quota. Route Around It Instead.</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Tue, 10 Mar 2026 09:12:55 +0000</pubDate>
      <link>https://dev.to/getnadir/stop-hitting-your-claude-code-quota-route-around-it-instead-4ied</link>
      <guid>https://dev.to/getnadir/stop-hitting-your-claude-code-quota-route-around-it-instead-4ied</guid>
      <description>&lt;p&gt;Every week there's a new HN thread about it: "Claude Code: connect to a local model when your quota runs out."&lt;/p&gt;

&lt;p&gt;The advice is always the same: set up Ollama as a fallback, accept that the local model is worse, keep using Claude Code for the important stuff. Treat quota exhaustion like a power outage. Have a backup.&lt;/p&gt;

&lt;p&gt;Here's the problem with that framing: it treats quota exhaustion as inevitable.&lt;/p&gt;

&lt;p&gt;It isn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's actually eating your quota
&lt;/h2&gt;

&lt;p&gt;If you've used Claude Code for more than a day, you know the pattern. You start a session, work on something complex, and most of the exchange is fine. But then there's this steady trickle of smaller requests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Read this file and tell me what it does"&lt;/li&gt;
&lt;li&gt;"What's the signature of this function?"&lt;/li&gt;
&lt;li&gt;"Show me line 47 to 53 of config.py"&lt;/li&gt;
&lt;li&gt;"Does this import already exist?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These prompts go to Sonnet. Or Opus. They cost the same per token as your hardest architectural questions.&lt;/p&gt;

&lt;p&gt;Roughly 60-70% of Claude Code requests in a typical session are simple tasks. Reading files, short summaries, formatting checks, continuations. None of them need a frontier model. All of them burn quota at frontier model rates.&lt;/p&gt;




&lt;h2&gt;
  
  
  Fallback is the wrong mental model
&lt;/h2&gt;

&lt;p&gt;The conversation keeps landing on fallback because that's how people think about resource exhaustion: you have a primary, and when it fails, you have a backup.&lt;/p&gt;

&lt;p&gt;But you're not running out of Claude because the model broke. You're running out because you're over-spending on prompts that don't need it.&lt;/p&gt;

&lt;p&gt;The real solution isn't fallback. It's routing.&lt;/p&gt;




&lt;h2&gt;
  
  
  NadirClaw: route before you exhaust, not after
&lt;/h2&gt;

&lt;p&gt;NadirClaw sits between your AI tool and your LLM provider as an OpenAI-compatible proxy. Before every request goes out, it classifies the prompt in about 10ms using sentence embeddings and asks: does this actually need a premium model?&lt;/p&gt;

&lt;p&gt;If the answer is no, it routes to something cheap. Gemini 2.5 Flash-Lite, Ollama on your local machine, GPT-5-mini, whatever you configure. If the answer is yes, it passes through to Claude, Sonnet, GPT-5, your premium model of choice.&lt;/p&gt;

&lt;p&gt;The result: the 60-70% of requests that don't need Claude don't hit Claude's quota. The requests that do need it get all the headroom they need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;nadirclaw
nadirclaw setup
nadirclaw serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then point Claude Code at &lt;code&gt;http://localhost:8856&lt;/code&gt; instead of the Anthropic API. That's it. No code changes, no prompt engineering, no new SDK.&lt;/p&gt;




&lt;h2&gt;
  
  
  How it classifies
&lt;/h2&gt;

&lt;p&gt;The router uses sentence embeddings to build a semantic fingerprint of each prompt, then scores it against complexity signals: reasoning depth required, ambiguity, length of expected output, presence of multi-step instructions.&lt;/p&gt;

&lt;p&gt;Simple prompts (file reads, short factual questions, formatting tasks) score low and go to the cheap model. Complex prompts (architecture decisions, debugging hard failures, multi-step implementation) score high and go to your premium model.&lt;/p&gt;

&lt;p&gt;Classification happens locally. Your prompts never leave your machine before routing. The router adds ~10ms overhead, which disappears into network latency.&lt;/p&gt;

&lt;p&gt;For Claude Code specifically, NadirClaw also detects agentic loops: when Claude Code is running a multi-step task with tools, it forces the complex model for that entire conversation to avoid the quality degradation that comes from switching mid-task.&lt;/p&gt;




&lt;h2&gt;
  
  
  Numbers that matter
&lt;/h2&gt;

&lt;p&gt;With default routing config on a typical Claude Code session:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;~65% of requests route to cheap/local models&lt;/li&gt;
&lt;li&gt;Cost reduction: 40-60% compared to routing everything to Sonnet&lt;/li&gt;
&lt;li&gt;Quota consumption: drops proportionally, so you can run longer sessions before hitting limits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The 200x price spread between Gemini 2.5 Flash-Lite ($0.10/M tokens) and Claude Opus ($15/M tokens) is enormous. You're paying somewhere in that range right now for every file-read request. Routing closes most of that gap automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  Hybrid routing beats going fully local
&lt;/h2&gt;

&lt;p&gt;The HN discussions usually end up at one of two positions: pay for API, or go fully local. Fully local means hardware investment and accepting that even the best local models are meaningfully behind frontier models on coding tasks.&lt;/p&gt;

&lt;p&gt;NadirClaw takes the middle path: frontier quality when you need it, cheap/local when you don't. The routing is automatic. You don't have to decide per-request.&lt;/p&gt;

&lt;p&gt;With Ollama integration (&lt;code&gt;nadirclaw setup&lt;/code&gt; asks if you want to add Ollama), simple prompts can route to your local model at zero API cost. Complex ones still go to Claude. You get the quality of frontier models where it matters, the cost (and privacy) of local where it doesn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setup takes about 3 minutes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;nadirclaw

&lt;span class="c"&gt;# Interactive setup: pick providers, enter API keys, set routing thresholds&lt;/span&gt;
nadirclaw setup

&lt;span class="c"&gt;# Start the router&lt;/span&gt;
nadirclaw serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure Claude Code with &lt;code&gt;ANTHROPIC_BASE_URL=http://localhost:8856&lt;/code&gt;. Or for Cursor/Codex: point the OpenAI base URL at the same port.&lt;/p&gt;

&lt;p&gt;That's it. &lt;code&gt;nadirclaw dashboard&lt;/code&gt; gives you a live view of what's routing where, your cost breakdown, and budget alerts when you're approaching limits.&lt;/p&gt;




&lt;p&gt;The quota exhaustion problem is real. But the fix isn't a fallback. It's spending your quota on things that need it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/doramirdor/NadirClaw" rel="noopener noreferrer"&gt;github.com/doramirdor/NadirClaw&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Notes for publishing:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Author: Dor (doramirdor) — must disclose as author if posting to dev.to&lt;/li&gt;
&lt;li&gt;Target tag: #llm #claudecode #devtools #ai&lt;/li&gt;
&lt;li&gt;Estimated read time: 5 min&lt;/li&gt;
&lt;li&gt;No em-dashes used. Reads human.&lt;/li&gt;
&lt;li&gt;Strong hook, addresses real pain point from active HN discussion&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>llm</category>
      <category>claudecode</category>
      <category>devtools</category>
      <category>ai</category>
    </item>
    <item>
      <title>NadirClaw 0.8: Vision Routing and the Silent Failure It Fixed</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Sun, 08 Mar 2026 12:05:24 +0000</pubDate>
      <link>https://dev.to/getnadir/nadirclaw-08-automatic-vision-routing-42k9</link>
      <guid>https://dev.to/getnadir/nadirclaw-08-automatic-vision-routing-42k9</guid>
      <description>&lt;p&gt;Here's a bug that's annoying to diagnose: you send a screenshot to Cursor, get a response that clearly didn't look at the image. You try again. Same thing. You figure it's a model issue and move on.&lt;/p&gt;

&lt;p&gt;If you're running NadirClaw in front of Cursor, the bug was in the router.&lt;/p&gt;




&lt;h2&gt;
  
  
  How NadirClaw routes requests
&lt;/h2&gt;

&lt;p&gt;Before 0.8, here's what happened when you sent an image:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;NadirClaw's classifier embeds your prompt using sentence embeddings and compares it to two pre-computed centroid vectors (one for "simple", one for "complex"). This takes ~10ms. No extra API call.&lt;/li&gt;
&lt;li&gt;Your screenshot is probably attached to a short message like "what's wrong here?" - that classifies as simple.&lt;/li&gt;
&lt;li&gt;Simple routes to your cheap model. If that's DeepSeek or an Ollama model, neither supports vision.&lt;/li&gt;
&lt;li&gt;The multimodal content array (the &lt;code&gt;image_url&lt;/code&gt; part) got flattened to text before hitting LiteLLM. The image disappeared.&lt;/li&gt;
&lt;li&gt;DeepSeek answered based on the text alone. Looked wrong. Was wrong.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No error. No log warning. Just a bad answer.&lt;/p&gt;




&lt;h2&gt;
  
  
  What 0.8 changes
&lt;/h2&gt;

&lt;p&gt;The model registry now has a &lt;code&gt;has_vision&lt;/code&gt; field on every model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gemini-2.5-flash&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;     &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;has_vision&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cost_per_m_input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.15&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek/deepseek-chat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;has_vision&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cost_per_m_input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.28&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ollama/llama3.1:8b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;has_vision&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cost_per_m_input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When NadirClaw detects &lt;code&gt;image_url&lt;/code&gt; or base64 image content in a request, it checks the selected model's &lt;code&gt;has_vision&lt;/code&gt; flag. If it's False, it swaps to the cheapest vision-capable model in your configured tiers.&lt;/p&gt;

&lt;p&gt;That's usually Gemini Flash ($0.15/M input) rather than Sonnet ($3.00/M) or GPT-5.2 ($1.75/M). You're not paying premium rates for vision, you're paying the cheapest rate that actually works.&lt;/p&gt;




&lt;h2&gt;
  
  
  The fix that mattered as much as the routing
&lt;/h2&gt;

&lt;p&gt;Separately from the routing logic, there was a bug: even if you'd manually pointed your image request at a vision-capable model, the content array was still being flattened to text-only before reaching LiteLLM. Both streaming and non-streaming paths.&lt;/p&gt;

&lt;p&gt;That's fixed in 0.8. Image content parts now pass through unchanged.&lt;/p&gt;




&lt;h2&gt;
  
  
  Upgrade
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--upgrade&lt;/span&gt; nadirclaw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you've been getting inconsistent answers on image-heavy requests, this is probably why. Run &lt;code&gt;nadirclaw report&lt;/code&gt; after upgrading and look at the &lt;code&gt;has_images&lt;/code&gt; field in your request logs to see how often this was silently misfiring.&lt;/p&gt;

&lt;p&gt;Full changelog: &lt;a href="https://github.com/doramirdor/NadirClaw/compare/v0.7.0...v0.8.0" rel="noopener noreferrer"&gt;v0.7.0...v0.8.0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Full disclosure: I work on this project.)&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>opensource</category>
      <category>python</category>
    </item>
    <item>
      <title>Draft: Why Your AI Agents Need a Tech Lead</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Sun, 08 Mar 2026 12:02:51 +0000</pubDate>
      <link>https://dev.to/getnadir/draft-why-your-ai-agents-need-a-tech-lead-1k36</link>
      <guid>https://dev.to/getnadir/draft-why-your-ai-agents-need-a-tech-lead-1k36</guid>
      <description>&lt;p&gt;You've got Cursor. You've got Claude Code. Maybe you've got a couple of aider instances running. Your AI coding setup is serious.&lt;/p&gt;

&lt;p&gt;And somehow, shipping still takes forever.&lt;/p&gt;

&lt;p&gt;The tools aren't the problem. The coordination is.&lt;/p&gt;




&lt;h2&gt;
  
  
  The missing layer
&lt;/h2&gt;

&lt;p&gt;Here's what a good tech lead actually does, stripped of the politics:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads the codebase and understands what's there&lt;/li&gt;
&lt;li&gt;Takes a vague feature request and turns it into specific, scoped tickets&lt;/li&gt;
&lt;li&gt;Figures out which engineer (or agent) should handle what&lt;/li&gt;
&lt;li&gt;Reviews the diff when it comes back, catches the stuff that works technically but breaks the system conceptually&lt;/li&gt;
&lt;li&gt;Merges or sends back with comments&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI agents are excellent at step 4 when the ticket is good. They're bad at steps 1, 2, and 3. And they can't do step 5 at all, because they don't know what they didn't write.&lt;/p&gt;

&lt;p&gt;You're doing steps 1-3 manually every time you prompt. That's the bottleneck.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Draft does
&lt;/h2&gt;

&lt;p&gt;Draft is an AI tech lead. You describe a feature in plain English. It reads your codebase, generates the tickets, delegates to AI agents, and reviews the diffs before they land.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You: "Add rate limiting to the API endpoints"
Draft: [reads your codebase]
       [generates 3 tickets: middleware setup, config, tests]
       [delegates each to an agent]
       [reviews diffs for consistency with your existing patterns]
       [surfaces the one that introduces a breaking change]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You stay in the loop where it matters. The mechanical overhead disappears.&lt;/p&gt;

&lt;p&gt;Stack is FastAPI + React + SQLite. Self-hostable. No black box SaaS absorbing your codebase.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why this matters now
&lt;/h2&gt;

&lt;p&gt;LLM coding quality improved fast. Context windows got huge. The agents got good.&lt;/p&gt;

&lt;p&gt;The problem shifted from "can the AI write code" to "can the AI write the &lt;em&gt;right&lt;/em&gt; code, in the right place, without breaking what's already there."&lt;/p&gt;

&lt;p&gt;That's not an LLM problem. That's an architecture problem. It's about having a clear picture of the system before you start, and a skeptical eye when the diff comes back.&lt;/p&gt;

&lt;p&gt;A tech lead isn't valuable because they can write code faster than you. They're valuable because they've read everything, they know what the code is supposed to do, and they can tell when something is wrong even if it compiles fine.&lt;/p&gt;

&lt;p&gt;Draft is that layer for your AI stack.&lt;/p&gt;




&lt;h2&gt;
  
  
  The alternative
&lt;/h2&gt;

&lt;p&gt;The alternative is you. You read the codebase before every session. You write the prompts. You review the diffs. You catch the regressions.&lt;/p&gt;

&lt;p&gt;That works. It's just slow, and it doesn't scale past what one person can hold in their head.&lt;/p&gt;

&lt;p&gt;If you're running multiple agents in parallel, you need something coordinating them. Otherwise you end up with three agents that each "fixed" the same function in different directions and now you have a merge conflict and no one to blame.&lt;/p&gt;




&lt;p&gt;Draft is at &lt;a href="https://trydraft.dev" rel="noopener noreferrer"&gt;trydraft.dev&lt;/a&gt;. (Full disclosure: I work on the team.)&lt;/p&gt;

&lt;p&gt;Try describing a feature and see what it generates for your codebase. The ticket breakdown alone is usually worth it.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Run Hermes Agent at 60% Lower Cost (Without Touching Its Code)</title>
      <dc:creator>Dor Amir</dc:creator>
      <pubDate>Sat, 07 Mar 2026 12:54:13 +0000</pubDate>
      <link>https://dev.to/getnadir/how-to-run-hermes-agent-at-60-lower-cost-without-touching-its-code-19ck</link>
      <guid>https://dev.to/getnadir/how-to-run-hermes-agent-at-60-lower-cost-without-touching-its-code-19ck</guid>
      <description>&lt;p&gt;Hermes Agent from NousResearch is one of the more interesting open agent frameworks out there. It self-improves, builds skills over time, searches its own memory, and runs in loops. It also burns through API credits like nothing else.&lt;/p&gt;

&lt;p&gt;Most of that spend is waste. Here's how to cut it by 60% without changing a single line of Hermes code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem With Always-On Agents
&lt;/h2&gt;

&lt;p&gt;Hermes runs constantly. Every loop iteration involves multiple LLM calls: checking memory, reading skills, planning next steps, executing tools, summarizing results. That's the nature of agentic systems.&lt;/p&gt;

&lt;p&gt;But here's the thing. A memory lookup ("have I seen this before?") doesn't need Claude Sonnet. A skill read ("what does this tool do?") doesn't need it either. A simple formatting step or status check definitely doesn't.&lt;/p&gt;

&lt;p&gt;Right now, if you point Hermes at Claude's API, every single one of those calls hits the same model at the same price. The 2-token memory check costs the same per-token as the complex multi-step reasoning task.&lt;/p&gt;

&lt;p&gt;NousResearch opened &lt;a href="https://github.com/NousResearch/hermes-agent/issues/547" rel="noopener noreferrer"&gt;issue #547&lt;/a&gt; about adding direct Anthropic API support to cut costs vs OpenRouter. That's a good start. But direct API access only removes the middleman markup. It doesn't address the fundamental problem: you're still sending simple prompts to expensive models.&lt;/p&gt;

&lt;h2&gt;
  
  
  NadirClaw: A Smarter Layer
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://getnadir.com" rel="noopener noreferrer"&gt;NadirClaw&lt;/a&gt; is an open-source LLM proxy that classifies prompt complexity and routes accordingly. Simple calls go to cheap models (Gemini Flash, Claude Haiku). Complex reasoning stays on Claude Sonnet or Opus. It's OpenAI-compatible, so any tool that can point at an API endpoint can use it.&lt;/p&gt;

&lt;p&gt;Including Hermes. With zero code changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup: 5 Minutes
&lt;/h2&gt;

&lt;p&gt;Install NadirClaw:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;nadirclaw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the setup wizard. Pick Claude Sonnet as your complex model and Gemini Flash (or Haiku) as your simple model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nadirclaw setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The wizard walks you through it. You'll set your API keys and model preferences. Takes about a minute.&lt;/p&gt;

&lt;p&gt;Start the proxy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nadirclaw serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This runs on &lt;code&gt;localhost:8000&lt;/code&gt; by default. It's an OpenAI-compatible endpoint.&lt;/p&gt;

&lt;p&gt;Now configure Hermes to use it. In your Hermes setup, change the provider endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Instead of pointing at api.anthropic.com or openrouter.ai
# Point at your local NadirClaw instance
Provider endpoint: http://localhost:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set your &lt;code&gt;ANTHROPIC_API_KEY&lt;/code&gt; environment variable as usual. NadirClaw passes it through to the upstream providers.&lt;/p&gt;

&lt;p&gt;That's it. Hermes doesn't know anything changed. It sends requests to what looks like a normal OpenAI-compatible API. NadirClaw intercepts each one, classifies it, and routes it to the right model.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Gets Routed Where
&lt;/h2&gt;

&lt;p&gt;In a typical Hermes session, here's roughly what happens:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Routed to cheap models (Flash/Haiku):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory searches and lookups&lt;/li&gt;
&lt;li&gt;Skill file reads&lt;/li&gt;
&lt;li&gt;Simple tool calls (file operations, basic queries)&lt;/li&gt;
&lt;li&gt;Status checks and formatting&lt;/li&gt;
&lt;li&gt;Short summarization of tool outputs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Stays on Claude Sonnet/Opus:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multi-step reasoning and planning&lt;/li&gt;
&lt;li&gt;Complex code generation&lt;/li&gt;
&lt;li&gt;Skill creation (the self-improvement part)&lt;/li&gt;
&lt;li&gt;Nuanced decision-making with multiple factors&lt;/li&gt;
&lt;li&gt;Long-context analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The classifier makes these decisions automatically. You don't write rules or configure thresholds. It looks at prompt length, complexity signals, and content type.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Numbers
&lt;/h2&gt;

&lt;p&gt;On agent workloads specifically, the savings tend to be on the higher end. Why? Because agents make lots of calls, and the majority of those calls are simple operations. A typical Hermes session might make 50 LLM calls in a loop. Maybe 8-12 of those actually need premium reasoning. The rest are housekeeping.&lt;/p&gt;

&lt;p&gt;With NadirClaw routing, those 38-42 simple calls hit a model that costs a fraction of Sonnet. The complex calls still get Sonnet-quality responses. Net result: roughly 60% cost reduction on the full session.&lt;/p&gt;

&lt;p&gt;Your mileage varies based on workload. Heavy reasoning tasks save less. Agents with lots of memory operations and tool use save more.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Dashboard
&lt;/h2&gt;

&lt;p&gt;NadirClaw comes with a built-in dashboard. Open it in your browser and you can see every routing decision in real time. Which Hermes calls went to Flash, which went to Sonnet, why each decision was made, and the running cost comparison.&lt;/p&gt;

&lt;p&gt;This is useful for two things. First, verifying that the routing makes sense for your workload. Second, showing your team (or yourself) exactly where the savings come from. It's one thing to say "we cut costs 60%." It's another to show the breakdown.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Not Just Use a Cheaper Model for Everything?
&lt;/h2&gt;

&lt;p&gt;You could point Hermes at Gemini Flash for all calls. It's cheap. But agent quality degrades fast when the planning and reasoning steps use a weaker model. Hermes's self-improvement loop especially needs strong reasoning to create useful skills.&lt;/p&gt;

&lt;p&gt;The whole point of routing is that you don't compromise on the calls that matter. You just stop overpaying for the calls that don't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compared to Direct Anthropic API (Issue #547)
&lt;/h2&gt;

&lt;p&gt;The work in issue #547 removes OpenRouter's markup by going direct to Anthropic. Good move. NadirClaw complements this. You still get direct API access (NadirClaw passes your API key through). You also get automatic routing on top of it.&lt;/p&gt;

&lt;p&gt;They're not competing approaches. Use both. Direct API access removes the middleman. NadirClaw removes the waste.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;nadirclaw
nadirclaw setup
nadirclaw serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Point Hermes at &lt;code&gt;localhost:8000&lt;/code&gt;. Watch the dashboard. See where your money actually goes.&lt;/p&gt;

&lt;p&gt;Open source, no account required.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://getnadir.com" rel="noopener noreferrer"&gt;getnadir.com&lt;/a&gt; | &lt;a href="https://github.com/doramirdor/NadirClaw" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>llm</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
