<?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: Lynkr</title>
    <description>The latest articles on DEV Community by Lynkr (@lynkr).</description>
    <link>https://dev.to/lynkr</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%2F3645387%2F794ced23-25c9-41ed-863a-401839a48d59.png</url>
      <title>DEV Community: Lynkr</title>
      <link>https://dev.to/lynkr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lynkr"/>
    <language>en</language>
    <item>
      <title>Stuffing the Context Window Is Making Your Agent Dumber: What the Research Says</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Fri, 17 Jul 2026 01:10:15 +0000</pubDate>
      <link>https://dev.to/lynkr/stuffing-the-context-window-is-making-your-agent-dumber-what-the-research-says-2063</link>
      <guid>https://dev.to/lynkr/stuffing-the-context-window-is-making-your-agent-dumber-what-the-research-says-2063</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I maintain &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;, an open-source gateway that (among other things) compresses agent tool outputs — so I have a horse in this race. This piece, though, is about the research, and every number in it is cited to its primary source.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There's an intuition almost every LLM user shares: more context = better answers. Million-token context windows are marketed as a capability. We paste in whole files "just in case." Our coding agents accumulate every grep result, every file read, every test log, on the theory that the model might need it.&lt;/p&gt;

&lt;p&gt;The research says this intuition is not just wrong — it's &lt;em&gt;backwards&lt;/em&gt;, and the size of the effect is embarrassing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result that should change how you build
&lt;/h2&gt;

&lt;p&gt;The cleanest demonstration comes from the Hindsight memory system (&lt;a href="https://arxiv.org/abs/2512.12818" rel="noopener noreferrer"&gt;arXiv:2512.12818&lt;/a&gt;, demo at ACL 2026). On LongMemEval — a benchmark of questions over long conversational histories — the same open-source 20B model scores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;39.0%&lt;/strong&gt; when handed the &lt;em&gt;full context&lt;/em&gt; — everything, the whole history&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;83.6%&lt;/strong&gt; when handed a &lt;em&gt;curated slice&lt;/em&gt; selected by a structured memory system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same model. Same available information. The difference is that one setup made the model read everything, and the other selected what mattered. &lt;strong&gt;+44.6 points from subtraction.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It gets more uncomfortable: that 20B model with curated context also &lt;strong&gt;beats full-context GPT-4o&lt;/strong&gt;, which scores 60.2% on the same benchmark. A model a fraction of the size, winning because someone cleaned its desk. As the authors put it, the memory architecture — not model scale — drives the performance.&lt;/p&gt;

&lt;p&gt;One benchmark, one paper? No — this is a pile-on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"Lost in the middle"&lt;/strong&gt; (Liu et al., 2023) established the shape of the problem early: models attend well to the start and end of long contexts and poorly to the middle — exactly where your agent's fifteenth tool result lives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context-rot studies&lt;/strong&gt; (notably Chroma's 2025 report) showed performance degrading as context grows &lt;em&gt;even when the added tokens are relevant&lt;/em&gt;, and degrading faster when they're distractors.&lt;/li&gt;
&lt;li&gt;A whole 2026 research wave now treats context as a resource to be &lt;strong&gt;managed, not maximized&lt;/strong&gt;: "Agentic Context Engineering" was accepted at ICLR 2026, active context compression systems prune their own working memory (&lt;a href="https://arxiv.org/abs/2601.07190" rel="noopener noreferrer"&gt;arXiv:2601.07190&lt;/a&gt;), and two consolidating surveys (&lt;a href="https://arxiv.org/abs/2512.13564" rel="noopener noreferrer"&gt;arXiv:2512.13564&lt;/a&gt;, &lt;a href="https://arxiv.org/abs/2603.07670" rel="noopener noreferrer"&gt;arXiv:2603.07670&lt;/a&gt;) formalize memory as a write–&lt;em&gt;manage&lt;/em&gt;–read loop — with "manage" doing the heavy lifting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The marketing said "bigger window." The research says "better librarian."&lt;/p&gt;

&lt;h2&gt;
  
  
  Why more context makes things worse
&lt;/h2&gt;

&lt;p&gt;Three mechanisms, all well-documented:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Attention is a budget, not a spotlight.&lt;/strong&gt; Every token in context competes for attention mass. Pack in 50k tokens of tool output and the three lines that matter are now competing with 49,900 tokens of noise. Needle-in-a-haystack benchmarks — the ones vendors publish — test &lt;em&gt;retrieval&lt;/em&gt; of a planted string, which models are good at. Real tasks require &lt;em&gt;reasoning over&lt;/em&gt; the context, which degrades much faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Distractors don't just dilute — they actively mislead.&lt;/strong&gt; The context-rot findings show semantically-similar-but-irrelevant content is worse than random filler. Your agent's context is &lt;em&gt;full&lt;/em&gt; of this: old versions of the file it's editing, error messages from an already-fixed bug, grep hits from a deprecated module. Each is a plausible-looking wrong answer sitting one attention head away.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Position effects compound over turns.&lt;/strong&gt; Agents append. Every turn pushes the important early material (the task! the constraints!) toward the middle of the context — the attention dead zone — while burying the recent signal under boilerplate tool output. A long agent session is a machine for constructing worst-case attention layouts.&lt;/p&gt;

&lt;p&gt;Coding agents are the pathological case of all three at once: they generate enormous, distractor-dense, structurally-repetitive context (JSON tool results, file dumps, test logs) at machine speed, across dozens of turns.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the research says works instead
&lt;/h2&gt;

&lt;p&gt;The successful systems in the literature share a shape — they spend compute &lt;em&gt;deciding what the model sees&lt;/em&gt; instead of showing it everything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Selection over inclusion.&lt;/strong&gt; Hindsight's four memory networks (facts vs. experiences vs. summaries vs. beliefs) exist so retrieval pulls the &lt;em&gt;right kind&lt;/em&gt; of memory for each question. The general lesson: retrieval into a small context beats residence in a big one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compression as a first-class operation.&lt;/strong&gt; Active-context-compression agents treat "shrink my working set" as an action the agent itself takes, on par with tool calls. Summarize the resolved, drop the superseded, keep the live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structure beats soup.&lt;/strong&gt; Tabular, labeled, deduplicated context consistently outperforms raw dumps of the same information — the model spends attention on content, not parsing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What you can do about it today
&lt;/h2&gt;

&lt;p&gt;You don't need a research memory system to benefit:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Treat context as a liability with interest, not an asset.&lt;/strong&gt; Every tool result you leave in the window is re-read (and re-billed) every subsequent turn, while making each turn slightly dumber.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compact aggressively and early.&lt;/strong&gt; Whatever your agent's compaction/clear mechanism is (&lt;code&gt;/compact&lt;/code&gt;, &lt;code&gt;/clear&lt;/code&gt;, fresh sessions per task), use it &lt;em&gt;before&lt;/em&gt; quality degrades — by the time you notice the agent going in circles, the context has been hurting you for many turns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scope sessions to tasks.&lt;/strong&gt; One task, one session. The 40-turn omnibus session is the exact scenario the position-effect research warns about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Isolate research from execution.&lt;/strong&gt; Subagents (or separate sessions) that read a lot and report a little are context firewalls: the summary crosses over; the 30k tokens of grep output don't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compress tool outputs before they enter context.&lt;/strong&gt; Test logs, JSON blobs, and directory listings compress 40–90% with zero information the model actually needs lost. Whether you do it with a proxy layer (this is the part where I mention that's what &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt; does), a harness setting, or a wrapper script — do it somewhere.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The next time a model launch leads with context-window size, remember the 20B model with a good librarian beating GPT-4o with a hoard. Capacity isn't capability. Curation is.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Primary sources:&lt;/strong&gt; &lt;a href="https://arxiv.org/abs/2512.12818" rel="noopener noreferrer"&gt;Hindsight (arXiv:2512.12818)&lt;/a&gt; · &lt;a href="https://github.com/vectorize-io/hindsight-benchmarks" rel="noopener noreferrer"&gt;benchmark data&lt;/a&gt; · &lt;a href="https://arxiv.org/abs/2307.03172" rel="noopener noreferrer"&gt;Lost in the Middle (Liu et al.)&lt;/a&gt; · &lt;a href="https://arxiv.org/abs/2601.07190" rel="noopener noreferrer"&gt;Active Context Compression (arXiv:2601.07190)&lt;/a&gt; · &lt;a href="https://arxiv.org/abs/2512.13564" rel="noopener noreferrer"&gt;Memory in the Age of AI Agents — survey (arXiv:2512.13564)&lt;/a&gt; · &lt;a href="https://arxiv.org/abs/2603.07670" rel="noopener noreferrer"&gt;Memory for Autonomous LLM Agents — survey (arXiv:2603.07670)&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>devtools</category>
    </item>
    <item>
      <title>How We Built an Agentic-Task Detector for LLM Routing</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Tue, 14 Jul 2026 04:18:47 +0000</pubDate>
      <link>https://dev.to/lynkr/how-we-built-an-agentic-task-detector-for-llm-routing-4eb4</link>
      <guid>https://dev.to/lynkr/how-we-built-an-agentic-task-detector-for-llm-routing-4eb4</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I maintain &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;, the open-source LLM router whose agentic detector this post dissects. Every snippet below is real, shipping code — &lt;a href="https://github.com/Fast-Editor/Lynkr/blob/main/src/routing/agentic-detector.js" rel="noopener noreferrer"&gt;read the whole file here&lt;/a&gt;, it's 350 lines.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;"Fix the auth bug in session.js."&lt;/p&gt;

&lt;p&gt;Eight words. Every token-count heuristic on earth routes this to the small, cheap model — it's &lt;em&gt;short&lt;/em&gt;. And every one of them is wrong, because those eight words are about to unleash a grep → read → edit → test loop with exact-string file edits, the precise workload where small models fumble tool calls and kill sessions.&lt;/p&gt;

&lt;p&gt;The inverse request — three paragraphs asking for a detailed comparison of locking strategies — &lt;em&gt;looks&lt;/em&gt; expensive and routes safely to a free local model, because it's pure text generation. Size and stakes are nearly uncorrelated in coding-agent traffic. So the router's real job is detecting &lt;strong&gt;agentic intent&lt;/strong&gt;, and this post is a tour of how Lynkr's detector does it: the signals, the weights, the classification ladder — and the embarrassing false positive that almost made the whole thing useless.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not "agentic: yes/no" — a ladder
&lt;/h2&gt;

&lt;p&gt;The first design decision: agentic-ness isn't boolean. The detector classifies requests into four types, each with a minimum tier floor and a score boost fed into the &lt;a href="https://dev.to/lynkr/how-a-13-dimension-complexity-scorer-decides-which-model-gets-your-request-e95"&gt;complexity scorer&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;AGENT_TYPES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;SINGLE_SHOT&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;minTier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SIMPLE&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="na"&gt;scoreBoost&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;span class="c1"&gt;// request-response, no tools&lt;/span&gt;
  &lt;span class="na"&gt;TOOL_CHAIN&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;minTier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;MEDIUM&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="na"&gt;scoreBoost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;  &lt;span class="c1"&gt;// read -&amp;gt; edit -&amp;gt; test&lt;/span&gt;
  &lt;span class="na"&gt;ITERATIVE&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;minTier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;COMPLEX&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="na"&gt;scoreBoost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;  &lt;span class="c1"&gt;// retry loops, debugging cycles&lt;/span&gt;
  &lt;span class="na"&gt;AUTONOMOUS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;minTier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;REASONING&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;scoreBoost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;35&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;  &lt;span class="c1"&gt;// "figure it out", full autonomy&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;minTier&lt;/code&gt; is a floor, not a suggestion: even if every other dimension scores low, an ITERATIVE request cannot route below the COMPLEX tier. Mid-debugging-loop is the worst possible moment to hand the session to a 7B model.&lt;/p&gt;

&lt;h2&gt;
  
  
  The six signals
&lt;/h2&gt;

&lt;p&gt;Each request accumulates a score from six independent signals. The interesting part is &lt;em&gt;why&lt;/em&gt; each one exists:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Tool count&lt;/strong&gt; (up to +25). Many tools attached usually means the client is prepared for multi-step work. &lt;em&gt;Usually.&lt;/em&gt; This signal is also the source of the great false positive — hold that thought.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Agentic tools specifically&lt;/strong&gt; (up to +25). Not all tools are equal evidence. &lt;code&gt;Bash&lt;/code&gt;, &lt;code&gt;Write&lt;/code&gt;, &lt;code&gt;Edit&lt;/code&gt;, &lt;code&gt;Task&lt;/code&gt;, git and test runners form an explicit set — these mutate state, and their presence signals mutation work. A request that can only &lt;code&gt;Read&lt;/code&gt;/&lt;code&gt;Grep&lt;/code&gt;/&lt;code&gt;WebSearch&lt;/code&gt; sits in a separate read-only set and earns nothing here. Two requests with five tools each can be night and day.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Prior tool results&lt;/strong&gt; (up to +30 — the heaviest signal). If the conversation already contains &lt;code&gt;tool_result&lt;/code&gt; blocks, you're not predicting an agentic loop — you're &lt;em&gt;inside&lt;/em&gt; one. More than five results means a deep loop with accumulated exact state (file contents, error strings); downgrading the model now throws away the context discipline keeping that loop convergent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Language patterns&lt;/strong&gt; (up to +25 each). Regexes over the last user message:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;tool-chain&lt;/em&gt;: "then use", "after that", "step 2"&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;iterative&lt;/em&gt;: "keep trying", "until", "retry", "debug"&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;autonomous&lt;/em&gt;: "figure out", "make it work", "on your own", "whatever it takes"&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;multi-file&lt;/em&gt;: "across the codebase", "refactor entire", "everywhere"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Plus a combination rule: "implement" alone is +10-ish planning noise, but "implement" &lt;em&gt;and&lt;/em&gt; "test/verify/make sure" in the same request is +15 — build-and-verify phrasing is a reliable tell of real work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Conversation depth&lt;/strong&gt; (up to +20). Fifteen-plus messages means established context and momentum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Prompt length&lt;/strong&gt; (+10). The weakest signal, deliberately — see the opening paragraph.&lt;/p&gt;

&lt;p&gt;Score ≥ 25 → the request is agentic. The classification ladder then applies both thresholds &lt;em&gt;and&lt;/em&gt; signal combinations — AUTONOMOUS needs score ≥ 60, or an explicit autonomous phrase with score ≥ 40. A phrase alone doesn't do it; a high score without autonomous language doesn't either, unless it's overwhelming.&lt;/p&gt;

&lt;h2&gt;
  
  
  The false positive that almost sank it
&lt;/h2&gt;

&lt;p&gt;Early versions had a humiliating problem: &lt;strong&gt;every single Claude Code request scored agentic.&lt;/strong&gt; Including "hello."&lt;/p&gt;

&lt;p&gt;Why? Claude Code attaches its full tool loadout — Read, Write, Edit, Bash, Grep, Glob, Task, and friends — to &lt;em&gt;every&lt;/em&gt; request, even a greeting. Signals 1 and 2 saw 11+ tools, four of them mutating, on everything. Every request cleared the threshold, every request routed to expensive tiers, and the router's entire value proposition — savings — evaporated. The detector was technically working and practically useless.&lt;/p&gt;

&lt;p&gt;The fix ships as &lt;strong&gt;client profiles&lt;/strong&gt;: known harnesses (Claude Code, Cursor, Codex CLI) have documented baseline loadouts, and the tool-count signals score only the tools &lt;em&gt;beyond&lt;/em&gt; that baseline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Signals 1 &amp;amp; 2 score only tools BEYOND the harness's baseline loadout —&lt;/span&gt;
&lt;span class="c1"&gt;// Claude Code's 11 always-attached tools shouldn't count as "agentic&lt;/span&gt;
&lt;span class="c1"&gt;// intent" on their own.&lt;/span&gt;
&lt;span class="nx"&gt;toolsForScoring&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;clientProfiles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;effectiveTools&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;profile&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Crucially, signals 3–6 still use the full payload — prior tool results and conversational language are &lt;em&gt;genuine&lt;/em&gt; evidence regardless of which harness sent them. Only the tool-presence signals get the subtraction, because only they are polluted by the harness's constant.&lt;/p&gt;

&lt;p&gt;And for traffic from harnesses we've never seen? A guard: if &lt;em&gt;every&lt;/em&gt; attached tool looks like a standard baseline and there are 10+ of them, the tool-count signals zero out rather than fire:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;clientProfiles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;allToolsAreBaseline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;rawTools&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Unknown harness that looks like Claude Code / Cursor / Codex —&lt;/span&gt;
  &lt;span class="c1"&gt;// zero out the tool-count signals to avoid the same trap.&lt;/span&gt;
  &lt;span class="nx"&gt;toolsForScoring&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="nx"&gt;scoringNote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;unknown_harness_guard&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better to under-detect and lean on the five uncorrupted signals than to re-create the everything-is-agentic bug for unknown clients.&lt;/p&gt;

&lt;p&gt;One subtle consequence, preserved as a comment in the source: with the baseline subtracted, tool counts rarely reach the AUTONOMOUS threshold on their own — so the &lt;em&gt;autonomous phrase pattern&lt;/em&gt; becomes the primary path to the top classification. The signal design acknowledges its own post-fix physics.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it still gets wrong
&lt;/h2&gt;

&lt;p&gt;Honesty section. Known limitations, from the code itself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It reads only the last user message.&lt;/strong&gt; "Do what I described above" carries the intent of an earlier message the regexes never see. Conversation-depth and tool-result signals partially compensate — but pattern detection is myopic by design (scanning full history was too noisy).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regexes can't tell mention from intent.&lt;/strong&gt; "Why did the retry loop break?" trips the iterative pattern despite being a read-only question. In practice this fails &lt;em&gt;safe&lt;/em&gt; — over-routing a question up-tier costs cents, under-routing an edit session down-tier costs the session — but it's still a false positive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;English only.&lt;/strong&gt; The patterns are English regexes; agentic intent in other languages leans entirely on the structural signals.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every detection returns its full evidence — score, signal list with weights, classification, and a &lt;code&gt;scoringNote&lt;/code&gt; explaining any baseline subtraction — so when the router misjudges, the telemetry shows exactly which signal lied. Debuggability was a design requirement: a routing layer you can't interrogate is a routing layer you'll eventually rip out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways if you're building anything similar
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Subtract the constant before reading the signal.&lt;/strong&gt; Whatever your equivalent of "the harness always attaches 11 tools" is — find it and remove it, or every request looks the same.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separate "prepared for tools" from "already using tools."&lt;/strong&gt; Attached tools are weak evidence; &lt;code&gt;tool_result&lt;/code&gt; blocks in the conversation are near-proof.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fail toward the expensive model.&lt;/strong&gt; Asymmetric costs mean your threshold should be calibrated so mistakes over-spend pennies rather than break sessions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make the detector explain itself.&lt;/strong&gt; A score without a signal list is a black box you'll never be able to tune.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The whole detector is 350 lines of dependency-free JavaScript: &lt;a href="https://github.com/Fast-Editor/Lynkr/blob/main/src/routing/agentic-detector.js" rel="noopener noreferrer"&gt;src/routing/agentic-detector.js&lt;/a&gt;. Steal it, or tell me which of your prompts it would misjudge — the failure cases are the roadmap.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>opensource</category>
      <category>node</category>
    </item>
    <item>
      <title>Choosing a Local Tier for Your Coding Agent (July 2026 Edition)</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Wed, 08 Jul 2026 00:14:16 +0000</pubDate>
      <link>https://dev.to/lynkr/choosing-a-local-tier-for-your-coding-agent-july-2026-edition-2196</link>
      <guid>https://dev.to/lynkr/choosing-a-local-tier-for-your-coding-agent-july-2026-edition-2196</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I maintain &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;, the open-source router used in the config examples. The benchmark figures below are third-party or vendor-reported (flagged where vendor-only) — I haven't independently benchmarked these models yet; the point of this post is to help you match models to request classes and test on your own workload.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;June 2026 was the busiest month for open-weight coding models in recent memory: GLM-5.2, MiniMax M3, Kimi K2.7 Code, Gemma 4, and NVIDIA's Nemotron 3 Ultra all landed within weeks. If you route your coding agent's simple requests to a local model — the "cloud architect, local coder" pattern — your options just changed meaningfully.&lt;/p&gt;

&lt;p&gt;Here's how I'd map the current field onto routing tiers, by hardware budget and by what each model can &lt;em&gt;safely&lt;/em&gt; own.&lt;/p&gt;

&lt;h2&gt;
  
  
  First, the trap: "best open model" ≠ "your local tier"
&lt;/h2&gt;

&lt;p&gt;The headline model of the month, &lt;a href="https://techsy.io/en/blog/best-open-source-llms-2026" rel="noopener noreferrer"&gt;GLM-5.2&lt;/a&gt;, scores 62.1% on SWE-bench Pro — above GPT-5.5. It is also a 744B-parameter MoE whose 2-bit quant alone wants ~245 GB of memory. That's an open-&lt;em&gt;weight&lt;/em&gt; model, not a local model; for self-hosters it's a $40k-rig proposition (&lt;a href="https://aiweekly.co/node/5306" rel="noopener noreferrer"&gt;one published build&lt;/a&gt; runs it on four RTX PRO 6000s). The same goes for DeepSeek-V4 Pro and MiniMax M3: superb models you'll realistically consume via API, where they belong in your COMPLEX/REASONING tiers, not your local one.&lt;/p&gt;

&lt;p&gt;Your local tier is decided by a harsher question: &lt;strong&gt;what fits in your VRAM and still makes reliable tool calls?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The local field, by hardware budget
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;~16 GB RAM (ordinary laptop): Gemma 4 12B.&lt;/strong&gt; Released June 3 as a dense 12B that genuinely fits consumer RAM (&lt;a href="https://www.sitepoint.com/local-llms-are-getting-easier-the-complete-guide-2026/" rel="noopener noreferrer"&gt;SitePoint's guide&lt;/a&gt;). Apache-2.0-class licensing with no usage clauses. This is a SIMPLE-tier model: explanations, one-liners, commit messages, "what does this error mean." I would not hand it an Edit tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;24 GB GPU (RTX 3090/4090 class): Qwen3.6-27B — still the default answer.&lt;/strong&gt; The community's consensus "local Claude" since April: within a few points of frontier models on SWE-bench Verified (77.2 reported vs Claude's 80.9 — &lt;a href="https://codersera.com/blog/qwen-3-6-as-local-claude-code-replacement-2026/" rel="noopener noreferrer"&gt;analysis&lt;/a&gt;), Apache-2.0, runs quantized on a single 24 GB card or a ~$2k build. Its known weakness is exactly the one that matters for agents: tool-call reliability drifts in long contexts — fine as a &lt;em&gt;supervised&lt;/em&gt; MEDIUM tier, risky as an unsupervised COMPLEX one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agentic multi-file edits on similar hardware: Devstral Small 2.&lt;/strong&gt; Purpose-built for multi-file, tool-driven coding rather than chat (&lt;a href="https://www.kdnuggets.com/top-7-coding-models-you-can-run-locally-in-2026" rel="noopener noreferrer"&gt;KDnuggets roundup&lt;/a&gt;). If your traffic is edit-heavy, it can arguably take MEDIUM-tier mutation requests that I'd keep away from general chat models.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Autocomplete-shaped work: Codestral 22B&lt;/strong&gt; is fast and good at it — but mind the non-commercial license before using it for work.&lt;/p&gt;

&lt;p&gt;One rule that keeps proving out (&lt;a href="https://pinggy.io/blog/best_open_source_self_hosted_llms_for_coding/" rel="noopener noreferrer"&gt;Pinggy's guide&lt;/a&gt;): &lt;strong&gt;within the same memory budget, a bigger model at Q4 usually beats a smaller one at Q8.&lt;/strong&gt; Quantization choice matters nearly as much as model family.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mapping to tiers
&lt;/h2&gt;

&lt;p&gt;Putting that together into a routing config (Lynkr shown; the mapping logic applies to any router):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 24 GB GPU + API keys for the hard stuff&lt;/span&gt;
&lt;span class="nv"&gt;TIER_SIMPLE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ollama:gemma4:12b            &lt;span class="c"&gt;# trivia, explanations, greetings&lt;/span&gt;
&lt;span class="nv"&gt;TIER_MEDIUM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ollama:qwen3.6:27b           &lt;span class="c"&gt;# code questions, supervised edits&lt;/span&gt;
&lt;span class="nv"&gt;TIER_COMPLEX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;deepseek:deepseek-v4-flash  &lt;span class="c"&gt;# tool-heavy mutations, via API&lt;/span&gt;
&lt;span class="nv"&gt;TIER_REASONING&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;deepseek:deepseek-v4      &lt;span class="c"&gt;# architecture, multi-step planning&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why V4 Flash for COMPLEX: it's the first open-weight model teams report dropping into real agentic pipelines as a frontier substitute &lt;em&gt;on price&lt;/em&gt; (&lt;a href="https://openrouter.ai/blog/insights/the-open-weight-models-that-matter-june-2026/" rel="noopener noreferrer"&gt;OpenRouter's June analysis&lt;/a&gt;) — the cheapest "won't break the session" option right now. Kimi K2.7 Code (vendor-reported 58.6% SWE-bench Pro at ~30% fewer reasoning tokens) and GLM-5.2 are strong API-tier alternatives; all the June day-one numbers are vendor-reported, so treat them as directional until LiveBench catches up.&lt;/p&gt;

&lt;p&gt;The key discipline: &lt;strong&gt;the boundary between MEDIUM and COMPLEX should not be "how big is the request" but "will tools mutate state."&lt;/strong&gt; Local models in this class handle read-and-explain reliably; exact-match edits and bash execution are where they still break sessions — I wrote up those failure modes &lt;a href="https://dev.to/lynkr/routing-down-is-easy-knowing-when-not-to-is-hard-why-cheap-models-break-your-coding-agent-4g33"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed vs three months ago
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The floor rose.&lt;/strong&gt; A 16 GB laptop now runs a genuinely useful SIMPLE tier (Gemma 4). Six months ago that tier meant 3B models that couldn't be trusted with a paragraph.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The open-weight ceiling now beats proprietary on some coding benchmarks&lt;/strong&gt; (GLM-5.2 &amp;gt; GPT-5.5 on SWE-bench Pro) — but at server scale, which &lt;em&gt;strengthens&lt;/em&gt; the hybrid pattern: open models via cheap APIs up top, small open models on your metal below.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MoE won.&lt;/strong&gt; Every serious June release is Mixture-of-Experts. For self-hosters this cuts both ways: better quality-per-active-param, but total memory footprints that keep the top tier out of reach.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Licensing is consolidating&lt;/strong&gt; around MIT (DeepSeek) and Apache-2.0 (Qwen, Gemma) for the models you'd actually build on.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Test on your traffic, not on benchmarks
&lt;/h2&gt;

&lt;p&gt;Every number above is someone else's workload. The honest way to pick your local tier: route a week of your real traffic through whatever candidates fit your hardware, and count &lt;em&gt;session survival&lt;/em&gt; — how often the local model's tool calls held up — not just benchmark deltas. That's a one-line config change per candidate, and your own telemetry will contradict at least one thing this post told you.&lt;/p&gt;

&lt;p&gt;Lynkr is Apache-2.0, self-hosted, and treats every model above as a first-class routing tier: &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;github.com/Fast-Editor/Lynkr&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>opensource</category>
      <category>ollama</category>
    </item>
    <item>
      <title>Routing Down Is Easy. Knowing When Not To Is Hard: Why Cheap Models Break Your Coding Agent</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Wed, 08 Jul 2026 00:08:36 +0000</pubDate>
      <link>https://dev.to/lynkr/routing-down-is-easy-knowing-when-not-to-is-hard-why-cheap-models-break-your-coding-agent-4g33</link>
      <guid>https://dev.to/lynkr/routing-down-is-easy-knowing-when-not-to-is-hard-why-cheap-models-break-your-coding-agent-4g33</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I maintain &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;, an open-source router whose design decisions this post explains. The failure modes described are patterns widely reported across router issue trackers and local-LLM forums — the examples are representative reconstructions, not captured transcripts. The problem is real either way; ask anyone who's routed a coding agent to a 7B model.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Everyone who gets their first LLM router working does the same thing within the hour: point the expensive coding agent at a free local model and watch the bill drop to zero.&lt;/p&gt;

&lt;p&gt;Then the agent tries to edit a file.&lt;/p&gt;

&lt;h2&gt;
  
  
  The graveyard of downgraded sessions
&lt;/h2&gt;

&lt;p&gt;If you browse the issue tracker of any Claude Code router — or r/LocalLLaMA on any given week — you'll find the same story in a hundred variations. The routing works perfectly. The &lt;em&gt;session&lt;/em&gt; dies anyway. The killers, in rough order of frequency:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Malformed tool arguments.&lt;/strong&gt; The agent decides to call &lt;code&gt;Edit&lt;/code&gt;, and the model produces arguments that are &lt;em&gt;almost&lt;/em&gt; JSON:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"file_path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"src/auth.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"old_string"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"if (token) {"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"new_string"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"if (token &amp;amp;&amp;amp; !expired) {"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One missing brace. The harness rejects the call, the model retries, produces a different malformation, and you're three turns deep into fixing nothing. Frontier models emit structurally valid tool calls with boring reliability; sub-10B models do it &lt;em&gt;most&lt;/em&gt; of the time — and "most of the time," at 30 tool calls per session, means every session breaks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Stale string matching.&lt;/strong&gt; &lt;code&gt;Edit&lt;/code&gt;-style tools require the &lt;code&gt;old_string&lt;/code&gt; to match the file exactly. Small models paraphrase from memory instead of quoting — they'll "remember" the line as &lt;code&gt;if (token) {&lt;/code&gt; when the file says &lt;code&gt;if (accessToken) {&lt;/code&gt;. The edit fails, the model re-reads the file, burns 2,000 tokens, tries again with a different paraphrase. This is the single most reported failure, because it &lt;em&gt;looks&lt;/em&gt; like the router's fault and is actually a capability cliff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Hallucinated context.&lt;/strong&gt; Ask a small model to run tests and it may confidently call &lt;code&gt;Bash&lt;/code&gt; with &lt;code&gt;npm test -- --grep "auth"&lt;/code&gt; in a repo that uses pytest. It's not being stupid — it's pattern-completing from training data instead of the conversation, because instruction-following degrades faster than fluency as models shrink.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The infinite loop.&lt;/strong&gt; The subtlest one: the model calls &lt;code&gt;Read&lt;/code&gt; on the same file five times in a row, or greps, reads, greps the same term again. Weak models lose the thread of &lt;em&gt;what they already know&lt;/em&gt; in long agentic contexts. Nothing errors — the session just stops converging while tokens burn.&lt;/p&gt;

&lt;p&gt;Here's the uncomfortable part: &lt;strong&gt;none of these are the router's bug, and all of them are the router's fault.&lt;/strong&gt; The router made a judgment — "this request is cheap-model-safe" — and the judgment was wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the obvious heuristics misjudge
&lt;/h2&gt;

&lt;p&gt;Most routing setups decide with static rules: token thresholds, keyword lists, scenario slots. These fail in a specific, predictable way: &lt;strong&gt;they measure the request's size, not its stakes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;"Fix the auth bug in session.js" is eight words. Every token-based rule on earth routes it to the small model. But those eight words unleash a read-grep-edit-test loop — the exact workload where small models faceplant. Meanwhile, "explain the difference between optimistic and pessimistic locking, with examples" looks expensive (long answer, technical vocabulary) and is actually &lt;em&gt;perfectly&lt;/em&gt; cheap-model-safe: it's pure text generation, no tool calls, no exact string matching, nothing to break.&lt;/p&gt;

&lt;p&gt;Size and stakes are almost uncorrelated in agentic traffic. That's the whole problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "stakes-aware" routing looks like
&lt;/h2&gt;

&lt;p&gt;When I built &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;'s router, most of the design ended up being about &lt;em&gt;when not to save money&lt;/em&gt;. The parts that matter:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Weight the tools, not just their count.&lt;/strong&gt; A request where &lt;code&gt;Grep&lt;/code&gt; and &lt;code&gt;Read&lt;/code&gt; are in play is research — paraphrase-tolerant, failure-tolerant, ideal for a local model. A request where &lt;code&gt;Bash&lt;/code&gt;, &lt;code&gt;Write&lt;/code&gt;, or &lt;code&gt;Edit&lt;/code&gt; will fire is a mutation with exact-match requirements. Lynkr assigns each tool a risk weight (&lt;code&gt;Bash&lt;/code&gt; 0.9, &lt;code&gt;Write&lt;/code&gt; 0.8, &lt;code&gt;Edit&lt;/code&gt; 0.7 … &lt;code&gt;Grep&lt;/code&gt; 0.2) and scores the request's &lt;em&gt;effective&lt;/em&gt; toolset. Two requests with five tools each can land tiers apart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Treat mid-session as a signal.&lt;/strong&gt; If the conversation already contains three tool results, you're inside an agentic flow with accumulated exact-state (file contents, error strings). Downgrading the model mid-flow throws away the one thing that was keeping the loop convergent. Prior tool usage and conversation depth push requests &lt;em&gt;up&lt;/em&gt;-tier even when the latest message is short.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subtract the harness baseline.&lt;/strong&gt; Claude Code ships ~14 tool schemas with every request — including "hello." Count them naively and everything looks agentic, so nothing ever routes local and you save nothing. Score only the tools the request could plausibly use, and the safe majority routes down while the risky minority stays up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some patterns override everything.&lt;/strong&gt; Greetings and "what does X do" questions force-route local, always. Security-sensitive analysis force-routes to the strong tier, always — a JWT architecture question is short, toolless, and precisely the wrong place to save four cents.&lt;/p&gt;

&lt;p&gt;The result on my own traffic: 70–90% of requests route to free local models — but they're the &lt;em&gt;right&lt;/em&gt; 70–90%, which is the entire difference between "my bill dropped" and "my agent broke."&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways, router-agnostic
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Route research down, mutations up.&lt;/strong&gt; If your router can't tell a &lt;code&gt;Grep&lt;/code&gt; request from an &lt;code&gt;Edit&lt;/code&gt; request, it isn't routing — it's gambling on which sessions break.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never downgrade mid-loop.&lt;/strong&gt; Model consistency across an agentic sequence is worth more than the marginal savings of one cheap turn.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure session survival, not just cost.&lt;/strong&gt; A routing setup that saves 60% and breaks one session in five is more expensive than the bill it replaced — you're paying in re-runs and rage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The ceiling is rising.&lt;/strong&gt; Local models' tool-calling improves every quarter; the set of safely-downgradable requests grows with it. A router with per-tool judgment gets to expand that set gradually. A token threshold has to guess again from scratch.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The router's job was never "pick the cheapest model." It's "pick the cheapest model &lt;em&gt;that won't break the session&lt;/em&gt;" — and those five extra words are where all the engineering lives.&lt;/p&gt;

&lt;p&gt;The scorer described here is ~1,000 lines of readable Apache-2.0 JavaScript: &lt;a href="https://github.com/Fast-Editor/Lynkr/blob/main/src/routing/complexity-analyzer.js" rel="noopener noreferrer"&gt;src/routing/complexity-analyzer.js&lt;/a&gt;. Steal the design, or file an issue telling me where it misjudges — the failure cases are the interesting part.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>opensource</category>
      <category>devtools</category>
    </item>
    <item>
      <title>The 5% Router Tax: What Hosted LLM Gateways Charge For (and How to Self-Host It)</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Sun, 05 Jul 2026 08:48:56 +0000</pubDate>
      <link>https://dev.to/lynkr/the-5-router-tax-what-hosted-llm-gateways-charge-for-and-how-to-self-host-it-513</link>
      <guid>https://dev.to/lynkr/the-5-router-tax-what-hosted-llm-gateways-charge-for-and-how-to-self-host-it-513</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I maintain &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;, the self-hosted gateway discussed in the second half. OpenRouter and Requesty are good products — this post is about understanding what you're paying for so you can decide whether you need to.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hosted LLM routers had a huge 2026 — OpenRouter alone pushes 25 trillion tokens a week. The pitch is real: one API key, 400+ models, automatic failover. The price is a &lt;strong&gt;~5% fee on every token you route&lt;/strong&gt; (5.5% on OpenRouter credits, 5% on Requesty), plus a subtler cost: every prompt, every file your coding agent reads, every secret that leaks into a context window transits their infrastructure.&lt;/p&gt;

&lt;p&gt;For a hobby project, 5% of a small bill is nothing and the convenience wins. For an agentic coding workload — where teams routinely spend $500–$2,000 per engineer per month — 5% is real money, and the data-transit question stops being academic. So it's worth asking precisely: &lt;strong&gt;what does the hosted router actually do for that fee, and which parts can you self-host?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What the fee buys
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Unified API across providers&lt;/strong&gt; — one format in, translated per-provider out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Failover&lt;/strong&gt; — a provider 500s, your request retries elsewhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model marketplace&lt;/strong&gt; — new models available the day they launch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consolidated billing&lt;/strong&gt; — one invoice instead of six provider accounts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;(Sometimes) smart routing&lt;/strong&gt; — OpenRouter's &lt;code&gt;auto&lt;/code&gt; router picks a model per-request.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Items 1, 2, and 5 are software. Items 3 and 4 are genuinely hard to self-host — if you want day-one access to every new model with zero account setup, the marketplace earns its fee. But most coding workloads use a handful of models, not four hundred.&lt;/p&gt;

&lt;h2&gt;
  
  
  The parts a hosted router structurally can't give you
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local models as a tier.&lt;/strong&gt; No hosted router will route your easy requests to the Ollama instance on your own machine — free, private, zero latency to first byte on cached weights. For coding traffic, where (in my instrumented sessions) 70–90% of requests are simple enough for a good local model, this is the single biggest cost lever, and it's only available to something running on your side of the wire.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your data staying home.&lt;/strong&gt; Self-hosted means prompts, code, and keys never transit a third party. For anyone with a compliance requirement — or code they'd rather not ship to a router's logs — this isn't a preference, it's a prerequisite.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token optimization before the bill.&lt;/strong&gt; A hosted router bills you for the tokens you send it — it has no incentive to shrink them. A self-hosted proxy can strip unusable tool schemas (measured: −53% on tool-heavy requests) and compress JSON tool results (measured: 3,458 → 427 tokens on a grep result) &lt;em&gt;before&lt;/em&gt; any provider bills you. That's not a routing saving; it stacks on top of routing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No availability dependency.&lt;/strong&gt; Hosted routers go down (OpenRouter's outages have their own HN threads) and offer no SLA at consumer tiers. A local proxy fails independently of anyone's status page.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What self-hosting costs you
&lt;/h2&gt;

&lt;p&gt;Honesty cuts both ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You run a process.&lt;/strong&gt; &lt;code&gt;npm install -g lynkr &amp;amp;&amp;amp; lynkr init &amp;amp;&amp;amp; lynkr start&lt;/code&gt; — but it's yours now: updates, logs, the works.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You manage provider accounts.&lt;/strong&gt; Two or three API keys instead of one. The consolidated invoice is genuinely gone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model lag.&lt;/strong&gt; A new provider means waiting for support (or a PR) instead of it appearing in a dropdown.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nobody to email.&lt;/strong&gt; Self-hosted support is a GitHub issue tracker.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If those trade-offs read as "fine," the math is straightforward: the 5% fee disappears, the local-tier routing removes the easy majority of requests from your bill entirely, and compression shrinks what's left.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hybrid that actually makes sense
&lt;/h2&gt;

&lt;p&gt;This isn't either/or. A pattern I see working:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Coding tool → self-hosted proxy (Lynkr)
                ├─ SIMPLE/MEDIUM  → local Ollama/llama.cpp   (free)
                ├─ COMPLEX        → direct provider API keys  (no fee)
                └─ exotic models  → OpenRouter               (5% on the long tail only)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep a hosted router as &lt;em&gt;one backend&lt;/em&gt; for the long tail of models you rarely need, route the bulk directly or locally, and let the proxy's classifier decide per-request. You get the marketplace when you want it without paying the tax on your entire volume.&lt;/p&gt;

&lt;p&gt;Lynkr is Apache-2.0, self-hosted, supports 13 providers including Ollama, llama.cpp, LM Studio, Bedrock, Azure, Databricks — and OpenRouter itself as a tier: &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;github.com/Fast-Editor/Lynkr&lt;/a&gt;. Benchmarks with methodology are in the repo; run them on your own workload before believing anyone's percentages, including mine.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>selfhosted</category>
      <category>llm</category>
    </item>
    <item>
      <title>How a 13-Dimension Complexity Scorer Decides Which Model Gets Your Request</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Sun, 05 Jul 2026 08:48:40 +0000</pubDate>
      <link>https://dev.to/lynkr/how-a-13-dimension-complexity-scorer-decides-which-model-gets-your-request-e95</link>
      <guid>https://dev.to/lynkr/how-a-13-dimension-complexity-scorer-decides-which-model-gets-your-request-e95</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I'm the author of &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;, the open-source proxy whose internals this post walks through. All code shown is real and Apache-2.0 — &lt;a href="https://github.com/Fast-Editor/Lynkr/blob/main/src/routing/complexity-analyzer.js" rel="noopener noreferrer"&gt;read it here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The most expensive default in AI coding tools is that &lt;strong&gt;model choice is a setting, not a decision&lt;/strong&gt;. You pick a model once; every request — "what does git stash do?" and "refactor this auth module" alike — goes there. Routing each request to the cheapest model that can actually handle it is worth 50%+ of most bills, but it only works if the "can actually handle it" judgment is reliable. Get it wrong downward and a small model fumbles your file edits; get it wrong upward and you've saved nothing.&lt;/p&gt;

&lt;p&gt;Here's how Lynkr makes that judgment, in enough detail that you could reimplement it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not just count tokens?
&lt;/h2&gt;

&lt;p&gt;The obvious heuristics fail in both directions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"Long request → big model"&lt;/strong&gt; fails on a 60k-token context that's mostly grep output around a trivial question.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Short request → small model"&lt;/strong&gt; fails catastrophically on "fix the auth bug in session.js" — eight words that unleash a tool-heavy agentic session a 7B model will faceplant on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Token count is &lt;em&gt;one&lt;/em&gt; signal. The failure cases all come from treating it as the only one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architecture: weighted dimensions, then overrides
&lt;/h2&gt;

&lt;p&gt;Every request gets a 0–100 score from 13 dimensions in four groups. The weights are configurable; these are the defaults:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;DIMENSION_WEIGHTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Content Analysis (35%)&lt;/span&gt;
  &lt;span class="na"&gt;tokenCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;promptComplexity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// avg sentence length/structure&lt;/span&gt;
  &lt;span class="na"&gt;technicalDepth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="c1"&gt;// technical keyword density&lt;/span&gt;
  &lt;span class="na"&gt;domainSpecificity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.07&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// security/ML/distributed/db/frontend/devops&lt;/span&gt;
  &lt;span class="c1"&gt;// Tool Analysis (25%)&lt;/span&gt;
  &lt;span class="na"&gt;toolCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;toolComplexity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="c1"&gt;// which tools, not how many&lt;/span&gt;
  &lt;span class="na"&gt;toolChainPotential&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.07&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// "first...then", "step 2", sequencing language&lt;/span&gt;
  &lt;span class="c1"&gt;// Reasoning Requirements (25%)&lt;/span&gt;
  &lt;span class="na"&gt;multiStepReasoning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;codeGeneration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;analysisDepth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.07&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="c1"&gt;// trade-off/comparison markers&lt;/span&gt;
  &lt;span class="c1"&gt;// Context Factors (15%)&lt;/span&gt;
  &lt;span class="na"&gt;conversationDepth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;priorToolUsage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="c1"&gt;// tool_results already in the conversation&lt;/span&gt;
  &lt;span class="na"&gt;ambiguity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few design decisions worth stealing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Not all tools are equal.&lt;/strong&gt; A request that can &lt;code&gt;Grep&lt;/code&gt; is not like a request that can &lt;code&gt;Bash&lt;/code&gt;. Each tool carries a hand-tuned risk weight — &lt;code&gt;Bash&lt;/code&gt; 0.9, &lt;code&gt;Write&lt;/code&gt; 0.8, &lt;code&gt;Edit&lt;/code&gt; 0.7, down to &lt;code&gt;Grep&lt;/code&gt; at 0.2. A request whose available toolset averages 0.8 is an agentic mutation session; one averaging 0.25 is read-only research. Same tool &lt;em&gt;count&lt;/em&gt;, completely different stakes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subtract the harness baseline.&lt;/strong&gt; Claude Code ships ~14 tool schemas with &lt;em&gt;every&lt;/em&gt; request, including "hello". If you count them naively, everything looks agentic and nothing routes local. The scorer subtracts the client's constant baseline and scores only the &lt;em&gt;effective&lt;/em&gt; tools the request could plausibly use — one of those fixes that sounds trivial and changed everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conversation history is a signal.&lt;/strong&gt; Three &lt;code&gt;tool_result&lt;/code&gt; blocks already in the conversation means you're mid-agentic-flow — this is not the moment to downgrade models and break the session's momentum. &lt;code&gt;priorToolUsage&lt;/code&gt; and &lt;code&gt;conversationDepth&lt;/code&gt; push mid-session requests up-tier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ambiguity cuts the other way.&lt;/strong&gt; "file X, line 42, this error" is specific — a small model can act on it. "Something feels slow sometimes" needs interpretation before action. Specificity markers (paths, line numbers, error strings) &lt;em&gt;lower&lt;/em&gt; the score.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overrides: the classifier knows what it can't know
&lt;/h2&gt;

&lt;p&gt;Two pattern lists short-circuit the whole scoring pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Force-local:&lt;/strong&gt; greetings, acknowledgments, "what does X do" one-liners. Score 0, never leave the machine, no cloud tokens ever.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Force-cloud:&lt;/strong&gt; security-critical analysis, architecture decisions, anything matching high-risk patterns. Straight to the top tier regardless of how cheap it looks. A JWT-vs-cookies security question is short and toolless — every naive heuristic routes it local. This is the wrong request to save $0.004 on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On top of the regex dimensions, an AST pass (tree-sitter) scores actual code structure in the payload — cyclomatic signals beat keyword counting when real code is present.&lt;/p&gt;

&lt;h2&gt;
  
  
  From score to model
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;score &amp;lt; threshold        → SIMPLE   (e.g. ollama:qwen2.5:7b, free)
threshold..~65           → MEDIUM   (e.g. ollama:qwen2.5-coder, free)
above                    → COMPLEX  (your API key: Sonnet, GPT-4o...)
reasoning markers heavy  → REASONING (o3, DeepSeek R1...)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The threshold moves with a single mode switch — &lt;code&gt;aggressive&lt;/code&gt; (60) routes more local, &lt;code&gt;conservative&lt;/code&gt; (25) routes more to the cloud, default is 40. Multi-turn conversations score with a recency-weighted sliding window, so a short follow-up ("now add tests") inherits the complexity of the work it refers to instead of scoring as a trivial one-liner.&lt;/p&gt;

&lt;p&gt;Crucially, &lt;strong&gt;the classifier only chooses among models you listed&lt;/strong&gt;. It's not an autonomous agent picking providers — you define the tiers, it picks the tier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does it work?
&lt;/h2&gt;

&lt;p&gt;In my instrumented sessions, 70–90% of requests score SIMPLE or MEDIUM and run free on local models, while tool-heavy and security-flagged requests reliably escalate. The failure mode everyone fears — cheap model breaking an agentic session — is exactly what the tool weights, baseline subtraction, and prior-tool-usage dimensions exist to prevent.&lt;/p&gt;

&lt;p&gt;Is 13 hand-weighted dimensions the optimal design? Almost certainly not — a learned router trained on outcome data would beat it eventually. But it's transparent (every routing decision logs its per-dimension breakdown), it's tunable, it runs in-process in microseconds, and it never sends your prompts to a third-party classifier API.&lt;/p&gt;

&lt;p&gt;The whole thing is readable in one sitting: &lt;a href="https://github.com/Fast-Editor/Lynkr/blob/main/src/routing/complexity-analyzer.js" rel="noopener noreferrer"&gt;src/routing/complexity-analyzer.js&lt;/a&gt;. Steal the design or use the proxy — either outcome means fewer frontier-model tokens spent on &lt;code&gt;git stash&lt;/code&gt; questions.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>node</category>
      <category>architecture</category>
    </item>
    <item>
      <title>The 21,000-Token Typo: Where Agentic Coding Budgets Actually Die</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Sun, 05 Jul 2026 08:48:24 +0000</pubDate>
      <link>https://dev.to/lynkr/the-21000-token-typo-where-agentic-coding-budgets-actually-die-1pa4</link>
      <guid>https://dev.to/lynkr/the-21000-token-typo-where-agentic-coding-budgets-actually-die-1pa4</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I maintain &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;, an open-source proxy mentioned at the end. The first 80% of this post is tool-agnostic and the takeaways apply whether or not you ever use it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There's a &lt;a href="https://www.cyfrin.io/blog/expensive-and-slow-for-small-changes-why-ai-coding-agents-can-be-overkill" rel="noopener noreferrer"&gt;documented case&lt;/a&gt; of a coding agent burning &lt;strong&gt;21,000+ input tokens to fix a one-line README typo&lt;/strong&gt;. Not a bug. Not a runaway loop. That's the normal cost structure of agentic coding, and once you see why, you can't unsee it on your own bill.&lt;/p&gt;

&lt;p&gt;Stanford's Digital Economy Lab &lt;a href="https://digitaleconomy.stanford.edu/news/how-are-ai-agents-spending-your-tokens/" rel="noopener noreferrer"&gt;measured it&lt;/a&gt;: agentic tasks consume on the order of &lt;strong&gt;1000x the tokens of ordinary code chat&lt;/strong&gt;, and the &lt;em&gt;same task with the same agent&lt;/em&gt; can vary 30x in cost depending on how the session unfolds. Teams running heavy automation report $500–$2,000 per engineer per month. So where does it go?&lt;/p&gt;

&lt;h2&gt;
  
  
  The anatomy of one "small" agentic task
&lt;/h2&gt;

&lt;p&gt;Say you ask your agent to fix a typo. Here's what actually crosses the wire:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Turn 1:&lt;/strong&gt; Your one-line prompt... plus the system prompt, plus ~14 tool schemas (Write, Edit, Bash, Grep, Git — a couple thousand tokens before anyone thinks).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Turn 2:&lt;/strong&gt; The agent greps for the file. The result comes back as JSON — paths, line numbers, match context, metadata. A modest grep is easily 1,000–3,000 tokens. It's now in the context &lt;strong&gt;and gets re-sent on every subsequent turn&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Turn 3:&lt;/strong&gt; The agent reads the file. Add the full file contents to the context. Re-sent every turn from now on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Turn 4:&lt;/strong&gt; The edit itself — the cheapest part of the entire session.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Turn 5:&lt;/strong&gt; Verification: re-read, maybe run a linter, another JSON blob of output.&lt;/p&gt;

&lt;p&gt;Five turns, and your one-line fix carried: 5x the tool schemas, 4x the grep results, 3x the file contents. Input tokens dominate output roughly &lt;strong&gt;25:1&lt;/strong&gt; in typical sessions. You're not paying for intelligence — you're paying for &lt;em&gt;cargo&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three structural leaks
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Leak 1: Tool schemas on every request.&lt;/strong&gt; The agent might use two tools this session. You ship fourteen schemas every turn anyway, because the client doesn't know which ones matter. Measured on a realistic Claude Code request: schemas the request couldn't use accounted for &lt;strong&gt;53% of billed input tokens&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Leak 2: Raw JSON in the context window.&lt;/strong&gt; JSON is the least token-efficient format your context will ever hold — keys repeated per element, quotes, braces, whitespace. A 60-match grep result: ~3,400 tokens raw, &lt;strong&gt;427 after conversion to a tabular token-oriented format&lt;/strong&gt; with redundant fields stripped. Nothing lost that the model needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Leak 3: Frontier models on non-frontier requests.&lt;/strong&gt; "What does git stash do?" does not need the same model as "refactor this auth module." But your client sends both to the same place, because model choice is a config setting, not a per-request decision. In my instrumented sessions, &lt;strong&gt;70–90% of requests scored as simple or medium complexity&lt;/strong&gt; — they'd be fine (and free) on a local model.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do about it — tool-agnostic
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Instrument before optimizing.&lt;/strong&gt; Log tokens per request by category (schemas / tool results / conversation). You cannot fix a leak you haven't sized. Most people find their intuition about their own spend is wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never let raw JSON accumulate in a context window.&lt;/strong&gt; Compact it, tabularize it, or summarize it. Tabular JSON is nearly free compression — same information, a fraction of the tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep sessions short and contexts clean.&lt;/strong&gt; Every tool result you leave in the context is a recurring charge, billed again on every turn until the session ends.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Match model to request, not to workflow.&lt;/strong&gt; Route the easy 80% somewhere cheap or local; reserve the frontier model for the requests that actually exercise it. Bring your own API keys and the routing is entirely within your control.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The plumbing version
&lt;/h2&gt;

&lt;p&gt;Everything above can be done manually. I got tired of doing it manually, so I built it into a proxy: &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt; sits between your coding tool (Claude Code, Cursor, Codex CLI) and your providers, strips unusable tool schemas, compresses JSON tool results, caches semantically, and scores each request on 13 dimensions to route it to a tier you define — local Ollama for the easy stuff, your API keys for the hard stuff. Self-hosted, Apache-2.0, no markup, zero client changes.&lt;/p&gt;

&lt;p&gt;But the numbers above aren't about my tool. They're about a cost structure every agentic workflow shares. The 21,000-token typo isn't an outlier — it's the default. Measure yours.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>devtools</category>
      <category>llm</category>
    </item>
    <item>
      <title>Lynkr vs claude-code-router: Static Rules vs a Complexity Classifier</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Sun, 05 Jul 2026 08:48:08 +0000</pubDate>
      <link>https://dev.to/lynkr/lynkr-vs-claude-code-router-static-rules-vs-a-complexity-classifier-38nd</link>
      <guid>https://dev.to/lynkr/lynkr-vs-claude-code-router-static-rules-vs-a-complexity-classifier-38nd</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I'm the author of &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;. claude-code-router is a genuinely good project that pioneered this category — this is a technical comparison of two different approaches, not a takedown. Where CCR is the better choice, I say so.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you want to keep the Claude Code harness but route requests to other models, you have two main self-hosted options today: &lt;a href="https://github.com/musistudio/claude-code-router" rel="noopener noreferrer"&gt;claude-code-router&lt;/a&gt; (CCR, ~35k stars, the incumbent) and &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;. They solve the same problem with fundamentally different architectures, and which one fits you depends on how much you want to configure versus delegate.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core difference in one paragraph
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CCR routes by scenario rules you write.&lt;/strong&gt; It has slots — &lt;code&gt;default&lt;/code&gt;, &lt;code&gt;background&lt;/code&gt;, &lt;code&gt;think&lt;/code&gt;, &lt;code&gt;longContext&lt;/code&gt; (triggered above a token threshold), &lt;code&gt;webSearch&lt;/code&gt;, &lt;code&gt;image&lt;/code&gt; — and you assign a model to each. It's predictable, transparent, and entirely under your control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lynkr routes by scoring the request itself.&lt;/strong&gt; Every request gets a 0–100 complexity score computed from 13 weighted dimensions — token count, technical keyword density, tool complexity, multi-step reasoning markers, conversation depth, ambiguity, and so on — and lands in a tier (&lt;code&gt;SIMPLE&lt;/code&gt;/&lt;code&gt;MEDIUM&lt;/code&gt;/&lt;code&gt;COMPLEX&lt;/code&gt;/&lt;code&gt;REASONING&lt;/code&gt;) you've mapped to models. You configure the tiers once; the classifier decides per-request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where CCR wins
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Maturity and ecosystem.&lt;/strong&gt; 35k stars, ~730k monthly npm downloads, 20+ provider transformers, custom JS plugins, a web UI, and in-session &lt;code&gt;/model&lt;/code&gt; switching. If you hit a weird provider quirk, someone has already hit it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Predictability.&lt;/strong&gt; A rule is a rule. If you want &lt;em&gt;"long contexts always go to Gemini"&lt;/em&gt;, CCR expresses that in one line and never surprises you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code specialization.&lt;/strong&gt; CCR does one client deeply. Lynkr supports Claude Code, Cursor, Codex CLI, Cline, and Continue — breadth costs some depth.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where the rule-based approach breaks down
&lt;/h2&gt;

&lt;p&gt;Browse CCR's issue tracker (~1,000 open issues) and one complaint dominates: &lt;strong&gt;tool-calling breakage on downgraded models&lt;/strong&gt; — failed file edits, broken git operations, agents going in circles. The root cause usually isn't CCR's code. It's that static rules can't see &lt;em&gt;what the request needs&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A short prompt ("fix the auth bug in session.js") looks cheap by token count — but it's an agentic, tool-heavy task that a small local model will fumble.&lt;/li&gt;
&lt;li&gt;A long context triggers the &lt;code&gt;longContext&lt;/code&gt; rule — but if it's 60k tokens of grep output around a trivial question, an expensive long-context model is wasted money.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Token counts and scenario names are proxies. The thing you actually care about — &lt;em&gt;can a cheap model handle this without breaking the session?&lt;/em&gt; — requires looking at the request's structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Lynkr does differently
&lt;/h2&gt;

&lt;p&gt;Three things, all absent from CCR by design (it aims to be a lean router):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The complexity classifier.&lt;/strong&gt; Requests with agentic signals (write/edit/bash tool availability, prior tool results in the conversation, sequential-step language) score into higher tiers even when they're short. Trivia stays local even when the context is long. Force-patterns short-circuit both ways: greetings never hit the cloud; security-critical analysis never gets downgraded. The design goal is exactly the failure mode above — &lt;em&gt;route down only when the answer will still work&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Token optimization on the wire.&lt;/strong&gt; Lynkr strips tool schemas the request can't use (measured: &lt;strong&gt;53% fewer tokens&lt;/strong&gt; on a realistic 14-tool Claude Code request) and compresses large JSON tool results before they hit the model (measured: 3,458 → 427 tokens on a 60-match grep result). CCR forwards requests as-is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Semantic caching.&lt;/strong&gt; Paraphrased repeat questions are served from an embedding cache in ~171ms with zero tokens billed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest comparison table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;claude-code-router&lt;/th&gt;
&lt;th&gt;Lynkr&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Routing logic&lt;/td&gt;
&lt;td&gt;Scenario rules + token threshold&lt;/td&gt;
&lt;td&gt;13-dimension complexity score → tiers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configuration&lt;/td&gt;
&lt;td&gt;Per-scenario, per-provider (flexible, verbose)&lt;/td&gt;
&lt;td&gt;Pick 4 tier models via &lt;code&gt;lynkr init&lt;/code&gt; wizard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tool-schema stripping&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes (−53% measured)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JSON tool-result compression&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes (TOON + field stripping)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Semantic cache&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;Clients&lt;/td&gt;
&lt;td&gt;Claude Code (deep)&lt;/td&gt;
&lt;td&gt;Claude Code, Cursor, Codex CLI, Cline, Continue&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Provider transformers/plugins&lt;/td&gt;
&lt;td&gt;20+, custom JS&lt;/td&gt;
&lt;td&gt;13 providers built-in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ecosystem maturity&lt;/td&gt;
&lt;td&gt;~35k stars, huge community&lt;/td&gt;
&lt;td&gt;Young (~500 stars), one maintainer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;In-session model switching&lt;/td&gt;
&lt;td&gt;Yes (&lt;code&gt;/model&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;No (automatic per-request)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;License&lt;/td&gt;
&lt;td&gt;MIT&lt;/td&gt;
&lt;td&gt;Apache-2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Which should you use?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You want explicit control and a battle-tested ecosystem&lt;/strong&gt; → CCR. It's the safe default and its community is unmatched.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You're tired of tuning rules, or your cheap-model sessions keep breaking&lt;/strong&gt; → try Lynkr. The classifier exists precisely because static rules degrade on agentic workloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your bill is dominated by tool output and repeated context&lt;/strong&gt; → Lynkr, regardless of routing preference; the compression and caching layers work even if you route everything to one model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both are self-hosted, free, and take five minutes to try. Run your own workload through each and compare the token logs — that's the only benchmark that matters. Mine are reproducible here: &lt;a href="https://github.com/Fast-Editor/Lynkr/blob/main/BENCHMARK_REPORT.md" rel="noopener noreferrer"&gt;github.com/Fast-Editor/Lynkr&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>devtools</category>
      <category>claude</category>
    </item>
    <item>
      <title>Where Claude Code's Tokens Actually Go (and How I Cut My Bill in Half)</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Sun, 05 Jul 2026 08:21:25 +0000</pubDate>
      <link>https://dev.to/lynkr/where-claude-codes-tokens-actually-go-and-how-i-cut-my-bill-in-half-13g6</link>
      <guid>https://dev.to/lynkr/where-claude-codes-tokens-actually-go-and-how-i-cut-my-bill-in-half-13g6</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure up front: I'm the author of &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt;, the open-source (Apache-2.0) proxy discussed below. All numbers come from a benchmark you can reproduce yourself — methodology linked at the end.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I spent a few weeks instrumenting my own Claude Code sessions to answer one question: &lt;strong&gt;where do the tokens actually go?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The answer surprised me. It wasn't my prompts. It wasn't even the model's responses. The bulk of my spend was overhead I never looked at:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Tool schemas sent on every single request.&lt;/strong&gt; Claude Code ships ~14 tool definitions (Write, Edit, Bash, Git, Grep...) with &lt;em&gt;every&lt;/em&gt; message — even when you're asking a read-only question that can only ever use two of them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Raw JSON tool results.&lt;/strong&gt; A single grep returning 60 matches came back as a ~3,400-token JSON array. File reads, test output, &lt;code&gt;ls&lt;/code&gt; results — all shipped verbatim into the context, on every turn, forever.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paying full price for trivial requests.&lt;/strong&gt; "What does &lt;code&gt;git stash&lt;/code&gt; do?" was hitting the same expensive model as "refactor this auth module."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A famous example of this failure mode: an agent &lt;a href="https://www.cyfrin.io/blog/expensive-and-slow-for-small-changes-why-ai-coding-agents-can-be-overkill" rel="noopener noreferrer"&gt;burned 21,000+ input tokens fixing a one-line README typo&lt;/a&gt;. Stanford's Digital Economy Lab found agentic coding tasks consume &lt;a href="https://digitaleconomy.stanford.edu/news/how-are-ai-agents-spending-your-tokens/" rel="noopener noreferrer"&gt;~1000x the tokens of ordinary code chat&lt;/a&gt;. This is not a niche problem — it's the cost structure of every agentic coding tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: put intelligence between the agent and the model
&lt;/h2&gt;

&lt;p&gt;None of this requires changing your tools. Claude Code, Cursor, and Codex CLI all let you override the API base URL. So I built a proxy that sits in the middle and does four things:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Strip tools the request can't use
&lt;/h3&gt;

&lt;p&gt;Classify each request; a read-only question doesn't need Write/Edit/Bash schemas, so don't send them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Measured result:&lt;/strong&gt; 959 tokens vs 2,085 for the identical request — &lt;strong&gt;53% fewer tokens, same model, same answer.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Compress JSON tool results
&lt;/h3&gt;

&lt;p&gt;Large JSON payloads (grep output, file listings, test results) get converted to &lt;a href="https://github.com/toon-format/toon" rel="noopener noreferrer"&gt;TOON&lt;/a&gt;, a token-oriented format, plus redundant-field stripping before they're forwarded to the model. Plain text passes through untouched.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Measured result:&lt;/strong&gt; that 60-match grep result went from 3,458 tokens to 427 — &lt;strong&gt;87.6% smaller&lt;/strong&gt;. (Honest caveat: TOON alone typically saves ~40%; the 87.6% is TOON &lt;em&gt;stacked with&lt;/em&gt; field-stripping on a tabular payload. Deeply nested data compresses less. Run the benchmark on your own workload.)&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Semantic caching
&lt;/h3&gt;

&lt;p&gt;If you ask "explain TCP vs UDP" and later "what's the difference between TCP and UDP?", that's the same question. Embedding similarity ≥ 0.85 → serve the cached response. &lt;strong&gt;171ms, zero tokens billed.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Route by complexity, not by config
&lt;/h3&gt;

&lt;p&gt;This is the part I haven't seen anywhere else done automatically. Each request is scored on 15 dimensions — token count, code complexity, reasoning markers, agentic signals, risk patterns — and routed to a tier you define:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;TIER_SIMPLE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ollama:qwen2.5:7b          &lt;span class="c"&gt;# free, local&lt;/span&gt;
&lt;span class="nv"&gt;TIER_MEDIUM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ollama:qwen2.5-coder:latest &lt;span class="c"&gt;# free, local&lt;/span&gt;
&lt;span class="nv"&gt;TIER_COMPLEX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your-cloud-provider        &lt;span class="c"&gt;# your API key&lt;/span&gt;
&lt;span class="nv"&gt;TIER_REASONING&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your-cloud-provider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my sessions, &lt;strong&gt;70–90% of requests scored SIMPLE or MEDIUM&lt;/strong&gt; and never left my machine. Only genuinely hard problems — architecture, tricky refactors, security analysis — hit a paid backend.&lt;/p&gt;

&lt;p&gt;The routing is deliberately conservative in one direction: tool-heavy agentic requests don't get downgraded, because the #1 complaint with every static routing setup is cheap models fumbling tool calls (failed edits, broken git operations). Routing &lt;em&gt;down&lt;/em&gt; is only a saving if the answer still works.&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; lynkr
lynkr init          &lt;span class="c"&gt;# interactive wizard: pick your tiers and providers&lt;/span&gt;
lynkr start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then point your tool at it — for Cursor it's Settings → Models → Override Base URL → &lt;code&gt;http://localhost:8081/v1&lt;/code&gt;; for Codex CLI it's two lines in &lt;code&gt;~/.codex/config.toml&lt;/code&gt;. No code changes, no plugins.&lt;/p&gt;

&lt;p&gt;Everything is self-hosted: your prompts and code never transit a third-party SaaS, there's no markup fee, and the whole thing is Apache-2.0 on &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers, side by side
&lt;/h2&gt;

&lt;p&gt;Benchmarked against LiteLLM v1.87.1 on identical workloads, same backend providers:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Through Lynkr&lt;/th&gt;
&lt;th&gt;Baseline&lt;/th&gt;
&lt;th&gt;Delta&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tool-heavy request (14 schemas)&lt;/td&gt;
&lt;td&gt;959 tokens&lt;/td&gt;
&lt;td&gt;2,085 tokens&lt;/td&gt;
&lt;td&gt;−53%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;60-result grep (JSON tool output)&lt;/td&gt;
&lt;td&gt;427 tokens&lt;/td&gt;
&lt;td&gt;3,458 tokens&lt;/td&gt;
&lt;td&gt;−87.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repeated paraphrased query&lt;/td&gt;
&lt;td&gt;171ms, 0 tokens&lt;/td&gt;
&lt;td&gt;3,282ms, full price&lt;/td&gt;
&lt;td&gt;11x faster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Complexity routing&lt;/td&gt;
&lt;td&gt;simple→local, hard→cloud&lt;/td&gt;
&lt;td&gt;cheapest-model-always&lt;/td&gt;
&lt;td&gt;correctness&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Projected over 100k requests/month on a tool-heavy workload: roughly &lt;strong&gt;half the bill, same backend, same models for the requests that matter&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways even if you never use my tool
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Audit your tool schemas.&lt;/strong&gt; They're the silent tax on every agentic request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never ship raw JSON into a context window.&lt;/strong&gt; Tabular JSON is the single most compressible thing in your token stream.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Most of your requests are simple.&lt;/strong&gt; You don't need a frontier model to explain &lt;code&gt;git stash&lt;/code&gt;. Bring your own API keys, keep the easy 80% local, and spend where it counts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you try Lynkr and the numbers don't hold on your workload, open an issue with your benchmark output — I want the counterexamples: &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;github.com/Fast-Editor/Lynkr&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>devtools</category>
      <category>productivity</category>
    </item>
    <item>
      <title>I Built an LLM Gateway That Extends Claude Pro/Max Users with Azure AI Foundry, Amazon Bedrock, Local Models</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Tue, 30 Jun 2026 22:28:50 +0000</pubDate>
      <link>https://dev.to/lynkr/i-built-an-llm-gateway-that-extends-claude-promax-with-azure-ai-foundry-and-amazon-bedrock-1efb</link>
      <guid>https://dev.to/lynkr/i-built-an-llm-gateway-that-extends-claude-promax-with-azure-ai-foundry-and-amazon-bedrock-1efb</guid>
      <description>&lt;p&gt;AI coding tools have gotten very good.&lt;/p&gt;

&lt;p&gt;But the infrastructure behind them is still weirdly inefficient.&lt;/p&gt;

&lt;p&gt;Most tools assume one provider, one lane, one billing path.&lt;/p&gt;

&lt;p&gt;That means the same expensive model or subscription ends up handling everything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;reading files&lt;/li&gt;
&lt;li&gt;summarizing logs&lt;/li&gt;
&lt;li&gt;quick repo questions&lt;/li&gt;
&lt;li&gt;multi-file refactors&lt;/li&gt;
&lt;li&gt;architecture planning&lt;/li&gt;
&lt;li&gt;long debugging sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the wrong abstraction.&lt;/p&gt;

&lt;p&gt;A coding workflow is not one type of problem. So it should not be forced through one type of model path.&lt;/p&gt;

&lt;p&gt;That idea is what pushed me to build &lt;strong&gt;Lynkr&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lynkr is an open-source LLM gateway for AI coding tools&lt;/strong&gt; that lets me combine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Claude Pro/Max subscription access&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Azure AI Foundry-hosted models&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Amazon Bedrock-hosted models&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;and local/free models like &lt;strong&gt;Ollama&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;behind one routing layer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with single-lane AI coding
&lt;/h2&gt;

&lt;p&gt;If you use a premium coding assistant every day, you have probably seen this already.&lt;/p&gt;

&lt;p&gt;A lot of the workload is not actually premium reasoning work.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"open this file"&lt;/li&gt;
&lt;li&gt;"search for auth middleware"&lt;/li&gt;
&lt;li&gt;"summarize this module"&lt;/li&gt;
&lt;li&gt;"show me where this class is used"&lt;/li&gt;
&lt;li&gt;"read these test failures"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are useful requests, but they are not the same as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"refactor this subsystem"&lt;/li&gt;
&lt;li&gt;"design a safer auth flow"&lt;/li&gt;
&lt;li&gt;"debug this multi-step failure"&lt;/li&gt;
&lt;li&gt;"trace this agent loop bug"&lt;/li&gt;
&lt;li&gt;"rewrite this implementation across five files"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yet most tools send both classes of work through the same expensive path.&lt;/p&gt;

&lt;p&gt;That creates three problems:&lt;/p&gt;

&lt;h3&gt;
  
  
  1) You waste premium capacity
&lt;/h3&gt;

&lt;p&gt;If a subscription-backed or premium model handles every tiny prompt, you burn good capacity on low-value tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) You stay locked into one provider
&lt;/h3&gt;

&lt;p&gt;Even if you already have access to Azure, AWS, or local models, your coding workflow is often tied to one vendor path.&lt;/p&gt;

&lt;h3&gt;
  
  
  3) You lose resilience
&lt;/h3&gt;

&lt;p&gt;If one provider is rate-limited, degraded, or just not the best fit for a task, you have no routing layer to adjust.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea behind Lynkr
&lt;/h2&gt;

&lt;p&gt;Lynkr sits between AI coding tools and model providers.&lt;/p&gt;

&lt;p&gt;It works as an &lt;strong&gt;LLM gateway&lt;/strong&gt;, which means the coding tool talks to Lynkr, and Lynkr decides what to do next.&lt;/p&gt;

&lt;p&gt;That lets the gateway:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;route by complexity&lt;/li&gt;
&lt;li&gt;compress bulky tool outputs&lt;/li&gt;
&lt;li&gt;cache repeated requests&lt;/li&gt;
&lt;li&gt;switch providers without changing the client workflow&lt;/li&gt;
&lt;li&gt;use different backends for different classes of tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The part I am most excited about is hybrid routing across:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Claude Pro/Max&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Azure AI Foundry&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Amazon Bedrock&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What "extending Claude Pro/Max" means
&lt;/h2&gt;

&lt;p&gt;The simplest version looks like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;simple tasks&lt;/strong&gt; → local/free model&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;hard coding tasks&lt;/strong&gt; → Claude Pro/Max subscription&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;enterprise workloads&lt;/strong&gt; → Azure AI Foundry&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;fallback or alternate routing&lt;/strong&gt; → Amazon Bedrock&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So instead of replacing Claude, Azure, or Bedrock, the gateway combines them.&lt;/p&gt;

&lt;p&gt;This is the key idea: &lt;strong&gt;extend your Claude Pro/Max usage instead of burning it on everything&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example workflow
&lt;/h3&gt;

&lt;p&gt;Imagine a coding session that looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;"Read the auth middleware and summarize it."&lt;br&gt;&lt;br&gt;
Route to a cheap local model.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Search all routes that call this helper."&lt;br&gt;&lt;br&gt;
Still cheap/local.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Refactor this auth flow to support tenant isolation."&lt;br&gt;&lt;br&gt;
Route to Claude Pro/Max.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Generate an enterprise-safe variant for our internal stack."&lt;br&gt;&lt;br&gt;
Route to Azure AI Foundry.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Azure is unavailable or rate-limited."&lt;br&gt;&lt;br&gt;
Fallback to Bedrock.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is a much more natural way to run coding agents than pretending every prompt deserves the same model path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Claude Pro/Max + Azure + Bedrock is interesting
&lt;/h2&gt;

&lt;p&gt;This combination matters because each lane solves a different problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Claude Pro/Max
&lt;/h3&gt;

&lt;p&gt;Great for high-quality coding and reasoning tasks where you already have subscription value.&lt;/p&gt;

&lt;h3&gt;
  
  
  Azure AI Foundry
&lt;/h3&gt;

&lt;p&gt;Useful when a team wants enterprise-hosted models, internal approvals, or Azure-aligned infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Amazon Bedrock
&lt;/h3&gt;

&lt;p&gt;Useful for AWS-native orgs, alternate model access, or fallback when you want another enterprise provider path.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local models
&lt;/h3&gt;

&lt;p&gt;Useful for cheap, frequent, low-stakes tasks that should not consume premium capacity at all.&lt;/p&gt;

&lt;p&gt;Putting these together in one gateway gives you a better operational model than any one of them alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters for coding agents specifically
&lt;/h2&gt;

&lt;p&gt;I think coding is one of the best use cases for an LLM gateway because coding workflows are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tool-heavy&lt;/li&gt;
&lt;li&gt;repetitive&lt;/li&gt;
&lt;li&gt;multi-step&lt;/li&gt;
&lt;li&gt;full of structured outputs&lt;/li&gt;
&lt;li&gt;sensitive to token waste&lt;/li&gt;
&lt;li&gt;often spread across many turns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means a gateway can add value in several ways.&lt;/p&gt;

&lt;h3&gt;
  
  
  1) Complexity-based routing
&lt;/h3&gt;

&lt;p&gt;Not every prompt deserves the same model.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Cost control
&lt;/h3&gt;

&lt;p&gt;Cheap requests stay cheap.&lt;/p&gt;

&lt;h3&gt;
  
  
  3) Better use of subscriptions
&lt;/h3&gt;

&lt;p&gt;Premium capacity gets reserved for tasks that actually need it.&lt;/p&gt;

&lt;h3&gt;
  
  
  4) Enterprise compatibility
&lt;/h3&gt;

&lt;p&gt;Teams can use Azure AI Foundry or Bedrock where policy or procurement matters.&lt;/p&gt;

&lt;h3&gt;
  
  
  5) Resilience
&lt;/h3&gt;

&lt;p&gt;If one provider path fails, the workflow can continue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where MCP and agent workflows fit in
&lt;/h2&gt;

&lt;p&gt;Another reason this matters is MCP and agentic tooling.&lt;/p&gt;

&lt;p&gt;As coding tools become more agentic, they use more:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tool schemas&lt;/li&gt;
&lt;li&gt;file reads&lt;/li&gt;
&lt;li&gt;command outputs&lt;/li&gt;
&lt;li&gt;structured results&lt;/li&gt;
&lt;li&gt;long multi-turn sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That creates a lot of overhead and a lot of repeated context.&lt;/p&gt;

&lt;p&gt;A gateway is the right place to optimize that.&lt;/p&gt;

&lt;p&gt;That is also why I think the future is not just better models.&lt;/p&gt;

&lt;p&gt;It is better &lt;strong&gt;routing, caching, tool handling, and workload separation&lt;/strong&gt; around those models.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I wanted Lynkr to do
&lt;/h2&gt;

&lt;p&gt;I did not want just another OpenAI-compatible endpoint.&lt;/p&gt;

&lt;p&gt;I wanted a gateway that could actually help with real coding economics and workflow design.&lt;/p&gt;

&lt;p&gt;For me, that means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;keeping the coding tool workflow the same&lt;/li&gt;
&lt;li&gt;preserving subscription value&lt;/li&gt;
&lt;li&gt;combining subscription + cloud + local lanes&lt;/li&gt;
&lt;li&gt;supporting enterprise backends&lt;/li&gt;
&lt;li&gt;reducing waste on easy tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who this is for
&lt;/h2&gt;

&lt;p&gt;I think this is especially useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code users who want more mileage from Pro/Max&lt;/li&gt;
&lt;li&gt;teams using Azure AI Foundry for approved enterprise model access&lt;/li&gt;
&lt;li&gt;AWS teams already standardizing on Bedrock&lt;/li&gt;
&lt;li&gt;developers mixing local models with premium coding assistants&lt;/li&gt;
&lt;li&gt;MCP and agent workflow builders who need an LLM gateway&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final thought
&lt;/h2&gt;

&lt;p&gt;I do not think the next big improvement in AI coding comes only from stronger base models.&lt;/p&gt;

&lt;p&gt;A lot of value will come from better infrastructure around them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;better routing&lt;/li&gt;
&lt;li&gt;better caching&lt;/li&gt;
&lt;li&gt;better cost control&lt;/li&gt;
&lt;li&gt;better tool handling&lt;/li&gt;
&lt;li&gt;better use of multiple model lanes in one workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the direction I am building toward with &lt;strong&gt;Lynkr&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;https://github.com/Fast-Editor/Lynkr&lt;/a&gt;&lt;br&gt;
Ps:- This is fully following Anthropic TOS because lynkr wraps around your existing claude code &lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>claudecode</category>
      <category>aws</category>
    </item>
    <item>
      <title>How to Use T3 Code With Claude Code and an Open-Source LLM Gateway</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Thu, 25 Jun 2026 07:55:29 +0000</pubDate>
      <link>https://dev.to/lynkr/how-to-use-t3-code-with-claude-code-and-an-open-source-llm-gateway-2aek</link>
      <guid>https://dev.to/lynkr/how-to-use-t3-code-with-claude-code-and-an-open-source-llm-gateway-2aek</guid>
      <description>&lt;p&gt;If I were setting up &lt;strong&gt;T3 Code&lt;/strong&gt; for serious daily use, the stack I would want looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;T3 Code
   ↓
Claude Code
   ↓
Lynkr
   ↓
Anthropic / OpenAI / Ollama / OpenRouter / Bedrock / Azure / Databricks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That flow is interesting because each layer is doing a different job:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;T3 Code&lt;/strong&gt; is the workflow and interface layer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code&lt;/strong&gt; is the coding agent&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lynkr&lt;/strong&gt; is the gateway layer under the agent&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;model providers&lt;/strong&gt; sit behind that gateway&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That separation is the whole point.&lt;/p&gt;

&lt;p&gt;T3 Code gives me the UX I want.&lt;br&gt;
Claude Code gives me the coding behavior I want.&lt;br&gt;
Lynkr gives me control over how model traffic actually gets handled.&lt;/p&gt;

&lt;p&gt;That is a much better stack than treating the model layer as an afterthought.&lt;/p&gt;
&lt;h2&gt;
  
  
  Quick demo
&lt;/h2&gt;

&lt;p&gt;I also recorded a short walkthrough of this setup in action:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;YouTube:&lt;/strong&gt; &lt;a href="https://www.youtube.com/watch?v=clqKXFnMyDw" rel="noopener noreferrer"&gt;How to use T3Code with any model @t3dotgg&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want the faster visual version before reading the rest, start there. The architecture is the same:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;T3 Code
   ↓
Claude Code
   ↓
Lynkr
   ↓
Your actual model/provider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why T3 Code is a useful surface
&lt;/h2&gt;

&lt;p&gt;T3 Code is interesting because it is not trying to become a new model or a new lab-specific harness.&lt;/p&gt;

&lt;p&gt;It is building a better way to &lt;em&gt;work with&lt;/em&gt; coding agents people already use.&lt;/p&gt;

&lt;p&gt;That is a smarter product decision than trying to replace everything at once.&lt;/p&gt;

&lt;p&gt;Its current support includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Codex&lt;/li&gt;
&lt;li&gt;Claude&lt;/li&gt;
&lt;li&gt;Cursor&lt;/li&gt;
&lt;li&gt;OpenCode&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means the value of T3 Code is not “one more coding assistant.”&lt;/p&gt;

&lt;p&gt;It is more like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one place to manage coding sessions&lt;/li&gt;
&lt;li&gt;one place to manage projects and threads&lt;/li&gt;
&lt;li&gt;one cleaner interface across multiple agent backends&lt;/li&gt;
&lt;li&gt;less context-switching between separate tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That makes a lot of sense.&lt;/p&gt;

&lt;p&gt;But once you pick &lt;strong&gt;Claude Code&lt;/strong&gt; as the coding agent inside that stack, the next problem becomes obvious:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;the model layer under Claude Code matters just as much as the top-level UX.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because once the agent is doing real work, cost and reliability stop being invisible plumbing.&lt;/p&gt;

&lt;p&gt;They become part of the product experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Claude Code is the right example
&lt;/h2&gt;

&lt;p&gt;Claude Code is a good example because it exposes the problem very clearly.&lt;/p&gt;

&lt;p&gt;A real Claude Code session does not look like a single “generate code” call.&lt;/p&gt;

&lt;p&gt;It looks more like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;inspect the repo&lt;/li&gt;
&lt;li&gt;read a few files&lt;/li&gt;
&lt;li&gt;plan a fix&lt;/li&gt;
&lt;li&gt;call tools&lt;/li&gt;
&lt;li&gt;generate or edit code&lt;/li&gt;
&lt;li&gt;hit an issue&lt;/li&gt;
&lt;li&gt;retry with more context&lt;/li&gt;
&lt;li&gt;inspect another file&lt;/li&gt;
&lt;li&gt;summarize the result&lt;/li&gt;
&lt;li&gt;do another pass&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That creates a traffic pattern that is very different from plain chat:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repeated system instructions&lt;/li&gt;
&lt;li&gt;repeated repo context&lt;/li&gt;
&lt;li&gt;repeated tool schemas&lt;/li&gt;
&lt;li&gt;repeated state&lt;/li&gt;
&lt;li&gt;large tool outputs&lt;/li&gt;
&lt;li&gt;retries that quietly multiply tokens&lt;/li&gt;
&lt;li&gt;easy turns mixed with hard reasoning turns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is exactly why coding-agent workflows need a stronger model layer than “just point it directly at one provider.”&lt;/p&gt;

&lt;p&gt;Once Claude Code is being used as an actual coding agent, the model path underneath it becomes infrastructure.&lt;/p&gt;

&lt;p&gt;And infrastructure decisions compound.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with wiring Claude Code directly forever
&lt;/h2&gt;

&lt;p&gt;Direct setup is fine for testing.&lt;/p&gt;

&lt;p&gt;But it gets worse as the workflow becomes more serious.&lt;/p&gt;

&lt;p&gt;If Claude Code is always wired straight to one provider path, you get a few problems:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Every turn gets treated like it needs the same model
&lt;/h3&gt;

&lt;p&gt;That is usually false.&lt;/p&gt;

&lt;p&gt;Some steps are lightweight:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;summarize a file&lt;/li&gt;
&lt;li&gt;extract the likely cause of an error&lt;/li&gt;
&lt;li&gt;choose the next action&lt;/li&gt;
&lt;li&gt;interpret logs&lt;/li&gt;
&lt;li&gt;reformat an answer&lt;/li&gt;
&lt;li&gt;produce a short structured response&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some steps are genuinely expensive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;debug a multi-file integration break&lt;/li&gt;
&lt;li&gt;reason across a large codebase&lt;/li&gt;
&lt;li&gt;recover after several failed tool loops&lt;/li&gt;
&lt;li&gt;refactor something deep without breaking behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If those all hit the same expensive path, you overpay.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Retries become cost multipliers
&lt;/h3&gt;

&lt;p&gt;Coding agents retry all the time.&lt;/p&gt;

&lt;p&gt;That is not a bug. That is how they work.&lt;/p&gt;

&lt;p&gt;But retries mean the same or almost-the-same context gets resent over and over.&lt;/p&gt;

&lt;p&gt;Without a caching layer or routing control, you keep paying full price for repeated work.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Tool-heavy traffic becomes the silent token killer
&lt;/h3&gt;

&lt;p&gt;The expensive part is often not the user’s prompt.&lt;/p&gt;

&lt;p&gt;It is everything around it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tool definitions&lt;/li&gt;
&lt;li&gt;file reads&lt;/li&gt;
&lt;li&gt;logs&lt;/li&gt;
&lt;li&gt;stack traces&lt;/li&gt;
&lt;li&gt;JSON blobs&lt;/li&gt;
&lt;li&gt;repeated state&lt;/li&gt;
&lt;li&gt;structured outputs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is where a lot of token waste hides.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Provider changes become annoying
&lt;/h3&gt;

&lt;p&gt;Maybe today you want Claude for everything.&lt;/p&gt;

&lt;p&gt;Later maybe you want:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;local Ollama for cheap exploratory passes&lt;/li&gt;
&lt;li&gt;Anthropic for hard reasoning&lt;/li&gt;
&lt;li&gt;OpenRouter for overflow&lt;/li&gt;
&lt;li&gt;Bedrock or Azure for enterprise constraints&lt;/li&gt;
&lt;li&gt;a different mix for different teams&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the setup is too tightly wired, those changes become more painful than they should be.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Reliability problems leak into workflow
&lt;/h3&gt;

&lt;p&gt;Latency spikes, rate limits, auth weirdness, provider outages, degraded outputs — eventually you hit all of them.&lt;/p&gt;

&lt;p&gt;If there is no gateway layer, every one of those issues becomes a client-side problem.&lt;/p&gt;

&lt;p&gt;That is exactly the kind of thing I would rather solve once in the model layer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The split I want
&lt;/h2&gt;

&lt;p&gt;This is the mental model that makes sense to me.&lt;/p&gt;

&lt;h3&gt;
  
  
  T3 Code handles
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;threads&lt;/li&gt;
&lt;li&gt;projects&lt;/li&gt;
&lt;li&gt;top-level UX&lt;/li&gt;
&lt;li&gt;session management&lt;/li&gt;
&lt;li&gt;coding workflow surface&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Claude Code handles
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;code reasoning&lt;/li&gt;
&lt;li&gt;edits&lt;/li&gt;
&lt;li&gt;tool usage&lt;/li&gt;
&lt;li&gt;the coding loop itself&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Lynkr handles
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;routing&lt;/li&gt;
&lt;li&gt;caching&lt;/li&gt;
&lt;li&gt;fallback&lt;/li&gt;
&lt;li&gt;token optimization&lt;/li&gt;
&lt;li&gt;local/cloud backend mix&lt;/li&gt;
&lt;li&gt;provider switching&lt;/li&gt;
&lt;li&gt;cost control under one stable endpoint&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is a clean stack.&lt;/p&gt;

&lt;p&gt;The interface stays separate from the agent.&lt;br&gt;
The agent stays separate from the gateway.&lt;br&gt;
The gateway stays separate from the providers.&lt;/p&gt;

&lt;p&gt;That separation is valuable because it lets each layer evolve independently.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Lynkr fits under Claude Code
&lt;/h2&gt;

&lt;p&gt;Lynkr is an open-source &lt;strong&gt;LLM gateway&lt;/strong&gt; built for coding assistants, MCP-heavy workflows, and tool-heavy traffic.&lt;/p&gt;

&lt;p&gt;That last part matters.&lt;/p&gt;

&lt;p&gt;A lot of model-routing products talk about general-purpose requests. But coding traffic is different. It is noisier, more repetitive, and much more likely to carry large tool payloads.&lt;/p&gt;

&lt;p&gt;That is why the fit is real here.&lt;/p&gt;

&lt;p&gt;The role of Lynkr in this stack is not to replace Claude Code.&lt;/p&gt;

&lt;p&gt;It is to sit &lt;strong&gt;under Claude Code&lt;/strong&gt; and decide how model traffic should actually be handled.&lt;/p&gt;

&lt;p&gt;That gives you a few levers that matter a lot in coding workflows.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Tier routing changes the economics
&lt;/h2&gt;

&lt;p&gt;The biggest mistake people make with coding agents is asking the wrong question.&lt;/p&gt;

&lt;p&gt;They ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Which is the best coding model?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The more useful question is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Which parts of my coding workflow actually deserve the expensive model?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is what a gateway lets you answer.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;low-risk summarization can go to a cheaper/faster model&lt;/li&gt;
&lt;li&gt;repeated inspection steps can stay local&lt;/li&gt;
&lt;li&gt;simple classification or extraction steps do not need frontier pricing&lt;/li&gt;
&lt;li&gt;hard debugging or refactors can escalate to a stronger path&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is a much better economic model than treating every Claude Code turn as if it deserves maximum spend.&lt;/p&gt;

&lt;p&gt;And once that logic sits in the gateway, you do not need to keep rebuilding it at the app layer.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Caching matters more in coding than people think
&lt;/h2&gt;

&lt;p&gt;Coding agents repeat themselves constantly.&lt;/p&gt;

&lt;p&gt;The same instructions, the same repo background, similar prompts, similar recovery steps, similar tool outputs — they come up again and again.&lt;/p&gt;

&lt;p&gt;That means a caching layer is not a “nice optimization.”&lt;/p&gt;

&lt;p&gt;It is one of the biggest obvious wins in the stack.&lt;/p&gt;

&lt;p&gt;Lynkr’s current benchmark claims are the part that stand out here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;53% fewer tokens on tool-heavy requests&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;87.6% compression on large JSON tool results&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;171ms semantic cache hits&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is exactly the kind of traffic Claude Code creates during real multi-step work.&lt;/p&gt;

&lt;p&gt;The point is not just lower cost.&lt;/p&gt;

&lt;p&gt;The point is lower cost &lt;em&gt;and&lt;/em&gt; lower latency on repeated work.&lt;/p&gt;

&lt;p&gt;That compounds very quickly.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Tool payload optimization is a real lever
&lt;/h2&gt;

&lt;p&gt;This is one of the most under-discussed parts of coding-agent economics.&lt;/p&gt;

&lt;p&gt;People spend a lot of time comparing model prices, but a huge amount of waste comes from the payload shape itself.&lt;/p&gt;

&lt;p&gt;In coding workflows, the model is often seeing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;large tool schemas&lt;/li&gt;
&lt;li&gt;verbose JSON results&lt;/li&gt;
&lt;li&gt;long command outputs&lt;/li&gt;
&lt;li&gt;repeated file excerpts&lt;/li&gt;
&lt;li&gt;repeated structured state&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means reducing payload size is often just as important as picking the right provider.&lt;/p&gt;

&lt;p&gt;This is why gateway-level optimization makes sense.&lt;/p&gt;

&lt;p&gt;It is solving a real problem in the actual traffic pattern, not just shuffling providers around.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. T3 Code stays stable while the model layer evolves
&lt;/h2&gt;

&lt;p&gt;This is maybe the biggest architectural reason I like this stack.&lt;/p&gt;

&lt;p&gt;If T3 Code points to Claude Code, and Claude Code points to Lynkr, then the top-level workflow can remain stable while the backend policy changes underneath.&lt;/p&gt;

&lt;p&gt;That means I can change:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;default providers&lt;/li&gt;
&lt;li&gt;local/cloud mix&lt;/li&gt;
&lt;li&gt;fallback policy&lt;/li&gt;
&lt;li&gt;cache behavior&lt;/li&gt;
&lt;li&gt;cost policy&lt;/li&gt;
&lt;li&gt;model tiers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…without having to rethink the interface and workflow every time.&lt;/p&gt;

&lt;p&gt;That is a better long-term design.&lt;/p&gt;

&lt;p&gt;The UI layer should not be where I want model policy to live.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Local-first and fallback become much easier
&lt;/h2&gt;

&lt;p&gt;There are plenty of steps in a coding workflow that can be handled locally or by a cheaper model path.&lt;/p&gt;

&lt;p&gt;There are also plenty of steps where I want a stronger cloud model.&lt;/p&gt;

&lt;p&gt;A gateway makes that hybrid model much easier.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;local model for lightweight repo inspection&lt;/li&gt;
&lt;li&gt;stronger provider for hard debugging&lt;/li&gt;
&lt;li&gt;cloud fallback when local output is not good enough&lt;/li&gt;
&lt;li&gt;alternate provider when the main path is slow or unavailable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That kind of setup is a lot harder to maintain cleanly when every client is wired directly.&lt;/p&gt;
&lt;h2&gt;
  
  
  Example of the architecture in practice
&lt;/h2&gt;

&lt;p&gt;The point is not that T3 Code itself becomes the gateway.&lt;/p&gt;

&lt;p&gt;The point is that the stack stays layered:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;T3 Code
   ↓
Claude Code
   ↓
Lynkr
   ↓
Anthropic / OpenAI / Ollama / OpenRouter / Bedrock / Azure / Databricks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a clean interface at the top&lt;/li&gt;
&lt;li&gt;a strong coding agent in the middle&lt;/li&gt;
&lt;li&gt;one stable gateway layer underneath&lt;/li&gt;
&lt;li&gt;swappable providers behind that&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the shape I would trust more over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters for people using T3 Code seriously
&lt;/h2&gt;

&lt;p&gt;If you are trying T3 Code casually, none of this matters much.&lt;/p&gt;

&lt;p&gt;But if you are actually using it for repeated coding workflows, then it starts to matter fast.&lt;/p&gt;

&lt;p&gt;Because daily coding-agent usage means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;lots of repeated calls&lt;/li&gt;
&lt;li&gt;lots of tool-heavy turns&lt;/li&gt;
&lt;li&gt;more retries than you expected&lt;/li&gt;
&lt;li&gt;more context repetition than you expected&lt;/li&gt;
&lt;li&gt;more need for backend flexibility than you expected&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is when the gateway stops being optional architecture theory and starts becoming the practical layer that controls cost and reliability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final take
&lt;/h2&gt;

&lt;p&gt;If I were using &lt;strong&gt;T3 Code with Claude Code&lt;/strong&gt;, I would not want Claude Code wired directly to one backend forever.&lt;/p&gt;

&lt;p&gt;I would want:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;T3 Code&lt;/strong&gt; for workflow&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code&lt;/strong&gt; for coding behavior&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lynkr&lt;/strong&gt; for routing, caching, fallback, and cost control&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;multiple providers&lt;/strong&gt; behind that gateway&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That feels like the right stack for where coding tools are going.&lt;/p&gt;

&lt;p&gt;Better UX at the top.&lt;/p&gt;

&lt;p&gt;Better agent behavior in the middle.&lt;/p&gt;

&lt;p&gt;Better economics and control underneath.&lt;/p&gt;

&lt;p&gt;If you want to check the projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;T3 Code:&lt;/strong&gt; &lt;a href="https://github.com/pingdotgg/t3code" rel="noopener noreferrer"&gt;https://github.com/pingdotgg/t3code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lynkr:&lt;/strong&gt; &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;https://github.com/Fast-Editor/Lynkr&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>devtools</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why I’d Use a LLM gateway with Goose</title>
      <dc:creator>Lynkr</dc:creator>
      <pubDate>Wed, 17 Jun 2026 07:15:15 +0000</pubDate>
      <link>https://dev.to/lynkr/why-id-put-lynkr-between-goose-and-my-model-stack-1jpi</link>
      <guid>https://dev.to/lynkr/why-id-put-lynkr-between-goose-and-my-model-stack-1jpi</guid>
      <description>&lt;p&gt;Open-source coding agents are getting a lot more useful, and &lt;strong&gt;Goose&lt;/strong&gt; is one of the clearest examples of that shift.&lt;/p&gt;

&lt;p&gt;Goose is an open-source AI agent that goes beyond autocomplete. It can inspect code, execute tasks, edit files, and work through real development loops that look much closer to &lt;em&gt;install → execute → edit → test&lt;/em&gt; than traditional code assistance.&lt;/p&gt;

&lt;p&gt;That also means Goose creates the exact kind of workload where the model layer starts to matter a lot.&lt;/p&gt;

&lt;p&gt;Once an agent is reading files, retrying commands, generating code, reasoning across context, and iterating through multi-step tasks, the cost and reliability of your model setup stops being a background detail. It becomes part of the product experience.&lt;/p&gt;

&lt;p&gt;That’s why I think the cleaner architecture is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Goose
  ↓
Lynkr
  ↓
OpenAI / Anthropic / Ollama / OpenRouter / Bedrock / Azure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In other words: &lt;strong&gt;use Goose as the coding agent, and use Lynkr as the LLM gateway underneath it.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Goose is
&lt;/h2&gt;

&lt;p&gt;If you haven’t looked at it yet, &lt;a href="https://github.com/aaif-goose/goose" rel="noopener noreferrer"&gt;Goose&lt;/a&gt; is an open-source, extensible AI agent built for more than just code suggestions. The project describes it as an agent that can &lt;em&gt;install, execute, edit, and test with any LLM&lt;/em&gt;, which is exactly why it’s interesting.&lt;/p&gt;

&lt;p&gt;That framing matters.&lt;/p&gt;

&lt;p&gt;A lot of developer AI tooling still assumes the model is mostly there to answer questions or generate snippets. Goose is part of the newer wave where the model is expected to participate in a real workflow. That means the token pattern changes too:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;more repeated context&lt;/li&gt;
&lt;li&gt;more tool-style back and forth&lt;/li&gt;
&lt;li&gt;more retries&lt;/li&gt;
&lt;li&gt;more multi-step reasoning&lt;/li&gt;
&lt;li&gt;more chances to waste expensive model calls on easy tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s where a gateway helps.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Lynkr does in this setup
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;Lynkr&lt;/a&gt; is an open-source &lt;strong&gt;LLM gateway&lt;/strong&gt;. Instead of wiring Goose directly to a single provider, you point Goose at Lynkr and let Lynkr handle the model layer underneath.&lt;/p&gt;

&lt;p&gt;That gives you one control point for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;provider switching&lt;/li&gt;
&lt;li&gt;local + cloud model setups&lt;/li&gt;
&lt;li&gt;fallback handling&lt;/li&gt;
&lt;li&gt;routing&lt;/li&gt;
&lt;li&gt;caching&lt;/li&gt;
&lt;li&gt;cleaner long-term infrastructure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Goose stays focused on the agent workflow. Lynkr stays focused on how requests should reach the right model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters for coding agents specifically
&lt;/h2&gt;

&lt;p&gt;If you only make occasional direct API calls, model choice is simple.&lt;/p&gt;

&lt;p&gt;If you use an agent heavily, it isn’t.&lt;/p&gt;

&lt;p&gt;A Goose session can easily include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;reading repo context&lt;/li&gt;
&lt;li&gt;planning a change&lt;/li&gt;
&lt;li&gt;generating code&lt;/li&gt;
&lt;li&gt;fixing an error&lt;/li&gt;
&lt;li&gt;retrying with more context&lt;/li&gt;
&lt;li&gt;running another step&lt;/li&gt;
&lt;li&gt;revisiting earlier files&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is not one request. It is a chain of requests with different complexity levels.&lt;/p&gt;

&lt;p&gt;Some of those steps can run on a cheaper or local model. Some need a stronger cloud model. Some repeat enough context that caching matters. Some need a fallback path because a provider slows down or fails mid-session.&lt;/p&gt;

&lt;p&gt;Without a gateway, that logic ends up scattered or simply ignored.&lt;/p&gt;

&lt;p&gt;With a gateway, you can manage it in one place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic idea: point Goose at Lynkr instead of a raw provider
&lt;/h2&gt;

&lt;p&gt;The exact Goose setup may vary depending on how you run it, but the architecture is straightforward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Goose talks to one model endpoint&lt;/li&gt;
&lt;li&gt;that endpoint is Lynkr&lt;/li&gt;
&lt;li&gt;Lynkr forwards to the real provider you want underneath&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A typical environment setup looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:3000/v1
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dummy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run Goose normally:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Or for a direct task:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;goose run &lt;span class="s2"&gt;"Review this repo and suggest 3 refactors"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this flow, Goose thinks it’s talking to its configured LLM endpoint. Lynkr handles what happens next.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 1: Run Goose on a local model through Lynkr
&lt;/h2&gt;

&lt;p&gt;Let’s say you want Goose to use a local coding model first.&lt;/p&gt;

&lt;p&gt;A simple Lynkr config might look like this:&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;providers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;local-coder&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ollama&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;qwen2.5-coder:14b&lt;/span&gt;

&lt;span class="na"&gt;routing&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;local-coder&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:3000/v1
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dummy

goose run &lt;span class="s2"&gt;"Explain this repository structure and identify dead code"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why do this instead of connecting Goose directly to Ollama?&lt;/p&gt;

&lt;p&gt;Because once Goose is pointed at Lynkr, you can change the backend later without changing the Goose-side integration.&lt;/p&gt;

&lt;p&gt;That means you can start local, then later:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;switch to a better coding model&lt;/li&gt;
&lt;li&gt;add a cloud fallback&lt;/li&gt;
&lt;li&gt;route specific workloads differently&lt;/li&gt;
&lt;li&gt;keep the same stable endpoint for Goose&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example 2: Local-first, cloud fallback
&lt;/h2&gt;

&lt;p&gt;A more realistic setup is usually local-first with a stronger cloud fallback.&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;providers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;local-fast&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ollama&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;qwen2.5-coder:14b&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cloud-strong&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;anthropic&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;claude-sonnet-4&lt;/span&gt;

&lt;span class="na"&gt;routing&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;local-fast&lt;/span&gt;
  &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cloud-strong&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then configure Goose to talk to Lynkr:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:3000
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dummy

goose run &lt;span class="s2"&gt;"Debug why the integration tests are failing and propose a patch"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives you a much nicer operating model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cheap/local by default&lt;/li&gt;
&lt;li&gt;stronger cloud help when needed&lt;/li&gt;
&lt;li&gt;Goose workflow stays the same&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example 3: One Goose workflow, multiple providers behind it
&lt;/h2&gt;

&lt;p&gt;One of the biggest advantages of putting a gateway under a coding agent is that your model preferences change all the time.&lt;/p&gt;

&lt;p&gt;Sometimes you want:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a fast model for lighter steps&lt;/li&gt;
&lt;li&gt;a stronger model for code generation&lt;/li&gt;
&lt;li&gt;a local model for private work&lt;/li&gt;
&lt;li&gt;a backup provider when your main one rate-limits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With Lynkr, you don’t need to keep reworking Goose every time you change that strategy.&lt;/p&gt;

&lt;p&gt;Example:&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;providers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fast&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;openrouter&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;openai/gpt-4o-mini&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;coder&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;anthropic&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;claude-sonnet-4&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;local&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ollama&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;qwen2.5-coder:14b&lt;/span&gt;

&lt;span class="na"&gt;routing&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;coder&lt;/span&gt;
  &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fast&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Goose still uses the same top-level environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://localhost:3000/v1
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dummy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s the part I like most about the gateway pattern: &lt;strong&gt;the agent stays stable while the model layer evolves underneath it.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Lynkr becomes especially useful
&lt;/h2&gt;

&lt;p&gt;There are a few situations where this setup becomes much more valuable than direct provider wiring.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. You want to avoid vendor lock-in
&lt;/h3&gt;

&lt;p&gt;If Goose is wired straight to one provider, every change becomes a reconfiguration problem.&lt;/p&gt;

&lt;p&gt;If Goose is wired to Lynkr, provider changes happen underneath the same gateway layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. You want local + cloud flexibility
&lt;/h3&gt;

&lt;p&gt;A lot of developers want a local-first workflow but still need access to stronger cloud models when tasks get harder.&lt;/p&gt;

&lt;p&gt;That’s much cleaner when Goose talks to one gateway instead of multiple provider-specific setups.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. You want better cost control
&lt;/h3&gt;

&lt;p&gt;Agent workflows can burn tokens in places that don’t need premium models.&lt;/p&gt;

&lt;p&gt;A gateway gives you a place to route easier work more cheaply.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. You want a more future-proof stack
&lt;/h3&gt;

&lt;p&gt;Coding agents are changing fast. Model providers are changing fast too.&lt;/p&gt;

&lt;p&gt;A stable gateway layer gives you a cleaner architecture than coupling every tool directly to every provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical mental model
&lt;/h2&gt;

&lt;p&gt;The easiest way to think about this is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Goose = behavior layer&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lynkr = model control layer&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Goose decides &lt;em&gt;what work to do&lt;/em&gt;.&lt;br&gt;
Lynkr decides &lt;em&gt;where that work should go&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;That separation gets more useful as your workflows get more agentic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Goose is part of a bigger shift in developer tools. We’re moving from AI assistants that mostly answer questions to coding agents that can actually work through tasks.&lt;/p&gt;

&lt;p&gt;As that shift happens, the model layer matters more.&lt;/p&gt;

&lt;p&gt;If you connect Goose directly to a provider, it works.&lt;/p&gt;

&lt;p&gt;If you connect Goose to &lt;strong&gt;Lynkr&lt;/strong&gt;, you get a cleaner long-term setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one stable gateway&lt;/li&gt;
&lt;li&gt;easier provider switching&lt;/li&gt;
&lt;li&gt;local/cloud flexibility&lt;/li&gt;
&lt;li&gt;fallback support&lt;/li&gt;
&lt;li&gt;better control over how your coding agent uses models&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s why I’d rather put Goose on top of an LLM gateway than wire it straight to a raw provider.&lt;/p&gt;

&lt;p&gt;If you’re already experimenting with Goose, this is one of the simplest ways to make the setup more flexible without changing the agent workflow itself.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Goose: &lt;a href="https://github.com/aaif-goose/goose" rel="noopener noreferrer"&gt;https://github.com/aaif-goose/goose&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Lynkr: &lt;a href="https://github.com/Fast-Editor/Lynkr" rel="noopener noreferrer"&gt;https://github.com/Fast-Editor/Lynkr&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>devtools</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
