<?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: Khang Nguyen</title>
    <description>The latest articles on DEV Community by Khang Nguyen (@im-khang).</description>
    <link>https://dev.to/im-khang</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%2F4097523%2F00c8a61b-e798-40f2-8606-e9bb1d907c39.png</url>
      <title>DEV Community: Khang Nguyen</title>
      <link>https://dev.to/im-khang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/im-khang"/>
    <language>en</language>
    <item>
      <title>I burned 684M tokens in 7 days and paid $7.35</title>
      <dc:creator>Khang Nguyen</dc:creator>
      <pubDate>Thu, 26 Nov 2026 23:43:48 +0000</pubDate>
      <link>https://dev.to/im-khang/i-burned-684m-tokens-in-7-days-and-paid-735-5a56</link>
      <guid>https://dev.to/im-khang/i-burned-684m-tokens-in-7-days-and-paid-735-5a56</guid>
      <description>&lt;p&gt;Most agent bills are routing problems wearing a pricing costume. I spent a week proving that on my own workload, and the invoice came back at $7.35 for 684 million tokens.&lt;/p&gt;

&lt;p&gt;I run coding agents all day: Claude Code, Codex, Hermes, a few homegrown loops. Last week I stopped juggling four separate API keys and pointed everything at one OpenAI-compatible endpoint. Then I let it run for seven days without touching the routing, and read the dashboard instead of guessing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The seven-day numbers
&lt;/h2&gt;

&lt;p&gt;I fixed the date range to 20-26 November 2026 so the figures could be checked later, rather than letting a rolling window drift under me.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.im-khang.com%2Fpost-images%2Fopengateway%2F01-usage.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.im-khang.com%2Fpost-images%2Fopengateway%2F01-usage.png" alt="OpenGateway analysis dashboard for 20-26 November 2026 showing 7.35 dollars spent, 5649 billed calls and 684060744 total tokens" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Spend was $7.35 against $11.43 the previous week, down 35.7 percent. Billed calls came in at 5,649 against 10,425, down 45.8 percent. Total tokens were 684,060,744 against 1,130,910,000, down 39.5 percent.&lt;/p&gt;

&lt;p&gt;Blended, that is roughly $1.07 per 100 million tokens. Same workload as the week before, by my own account. The drop did not come from doing less.&lt;/p&gt;

&lt;h2&gt;
  
  
  The row that explains everything
&lt;/h2&gt;

&lt;p&gt;Spend breaks down per model, and two rows carry almost all of it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.im-khang.com%2Fpost-images%2Fopengateway%2F04-keys-models.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.im-khang.com%2Fpost-images%2Fopengateway%2F04-keys-models.png" alt="Per-key and per-model spend breakdown showing the cheap model carrying 505 million tokens for 2.98 dollars while the expensive one carried 178 million tokens for 4.37 dollars" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The cheap model, deepseek-v4.1-flash-eco, absorbed 505.5 million tokens across 3,784 calls for $2.98. The fast tier, deepseek-v4.1-flash-ultrafast, took 178.5 million tokens across 1,856 calls for $4.37.&lt;/p&gt;

&lt;p&gt;Read that again in ratios instead of absolutes. The cheap model handled 74 percent of all tokens and 67 percent of all calls on 41 percent of the money. Its effective rate was $0.59 per 100 million tokens.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I actually changed
&lt;/h3&gt;

&lt;p&gt;Nothing clever. I moved the grunt work — file reads, diff summarising, log triage, retry loops, boilerplate generation — onto the cheapest model that could still do it, and kept the expensive one for planning, refactors and hard debugging.&lt;/p&gt;

&lt;p&gt;That single split, not the gateway, produced the 35 percent drop. It is also the only part of this that transfers to someone else's stack, because your token mix will not look like mine.&lt;/p&gt;

&lt;p&gt;Most teams I have seen do the opposite. One default model for everything, no per-model breakdown, and a bill nobody can attribute to a specific call path. Then the conversation turns into a hunt for a cheaper vendor when the answer was already sitting inside their own request distribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why one endpoint instead of four SDKs
&lt;/h2&gt;

&lt;p&gt;Before this I had OpenAI, Anthropic, xAI and a local vLLM wired separately. Every new experiment meant another key, another billing page, another variable in the environment file, and no shared place to see what anything cost.&lt;/p&gt;

&lt;p&gt;OpenGateway is OpenAI-compatible, so the migration is configuration rather than code. Point the base URL at the gateway, keep your SDK, and let the model name choose the model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://apis.opengateway.ai/v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"OPENGATEWAY_KEY"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"deepseek/deepseek-v4.1-flash-eco"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"summarise this diff"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&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;That is the whole change. No adapter layer, no proxy process to babysit, no rewrite of call sites.&lt;/p&gt;

&lt;p&gt;I also split my own traffic across four keys rather than pooling it. One key drives the orchestrator, two handle batch jobs on the cheap tier, one sits idle on a laptop. That is what makes the per-key table useful: it tells me which surface is expensive instead of leaving me to infer it from a total.&lt;/p&gt;

&lt;h2&gt;
  
  
  The discount that made the experiment obvious
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.im-khang.com%2Fpost-images%2Fopengateway%2F02-promo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.im-khang.com%2Fpost-images%2Fopengateway%2F02-promo.png" alt="OpenGateway model pricing cards showing deepseek-v4.1-flash-eco at 0.120 dollars output, minus 90 percent, alongside ultrafast at minus 50 percent" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;deepseek-v4.1-flash-eco is running at minus 90 percent right now: $0.120 per million output tokens against a $1.20 list price, $0.030 input, and $0.0006 per million cached input.&lt;/p&gt;

&lt;p&gt;That cached figure is the one worth staring at. At six ten-thousandths of a dollar per million, long repeated context — system prompts, repo maps, tool schemas, the preamble every agent resends on every turn — effectively stops appearing on your bill.&lt;/p&gt;

&lt;p&gt;There is a second option: deepseek-v4.1-flash-ultrafast at minus 50 percent now, $0.600 output and $0.150 input, with a further minus 70 percent flagged after midnight KST. glm-5.3-flash-ultrafast sits at minus 30 percent.&lt;/p&gt;

&lt;p&gt;These are promotional windows, not permanent prices. That matters more than the number: build your routing on the ratio between tiers, not on the promo rate, or your bill will jump when the discount closes and you will blame the vendor for your own architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you migrate
&lt;/h2&gt;

&lt;p&gt;Three caveats, because the point is usefulness rather than enthusiasm.&lt;/p&gt;

&lt;p&gt;It is a gateway, not a model. Availability and the machine each request lands on can shift with capacity, so pin the models you actually depend on and check which provider served the request.&lt;/p&gt;

&lt;p&gt;The model count is fuzzy. The landing page says 94 models while the models endpoint returned 114 active records, so count the ones you need rather than the headline.&lt;/p&gt;

&lt;p&gt;And this is one person's workload over seven days, not a benchmark. A local measurement on my own traffic says nothing about your latency tolerance, your context lengths, or your failure modes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do this week
&lt;/h2&gt;

&lt;p&gt;If you have been postponing a cheap-model trial on your agent's grunt work, the arithmetic is currently in your favour enough that the experiment costs less than the argument about it. Split your calls into cheap-tier and thinking-tier, measure both, and let the ratio tell you where the money actually goes.&lt;/p&gt;

&lt;p&gt;Start here: &lt;a href="https://opengateway.ai/?ref=HHAS5T79" rel="noopener noreferrer"&gt;https://opengateway.ai/?ref=HHAS5T79&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want the longer version of how I evaluate an agent system rather than an invoice, I wrote up &lt;a href="https://dev.to/blogs/how-i-evaluated-an-ecommerce-analytics-agent-answers-sql-tool-use-and-safety/"&gt;how I evaluated an ecommerce analytics agent&lt;/a&gt; and &lt;a href="https://dev.to/blogs/archify-codebase-maps-reviewed-technical-artifacts/"&gt;how codebase maps become reviewed artifacts&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>After a week of routing my agent projects through OpenGateway instead of juggling four separate API keys (OpenAI, Anthro</title>
      <dc:creator>Khang Nguyen</dc:creator>
      <pubDate>Thu, 26 Nov 2026 14:34:42 +0000</pubDate>
      <link>https://dev.to/im-khang/after-a-week-of-routing-my-agent-projects-through-opengateway-instead-of-juggling-four-separate-api-obb</link>
      <guid>https://dev.to/im-khang/after-a-week-of-routing-my-agent-projects-through-opengateway-instead-of-juggling-four-separate-api-obb</guid>
      <description>&lt;h2&gt;
  
  
  Decision in brief
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OpenGateway is an OpenAI-compatible gateway: change the base URL and model name, keep your SDK and code.&lt;/li&gt;
&lt;li&gt;The landing page says 94 models; I called the public &lt;code&gt;GET /v1/models&lt;/code&gt; on 26 Nov 2026 and got 114 active records — one model can expose multiple provider routes, so read the API, not the landing page.&lt;/li&gt;
&lt;li&gt;Referral: up to $100 from a referred team's first top-up (50% split), $10 per friend when their first payment is $20+, and 2.5% of their payments for 90 days. My account already earned $4.40 from an earlier invite.&lt;/li&gt;
&lt;li&gt;Worth it if you run multi-provider agents; skip it if you call one fixed model.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Per the official API reference, the base URL is &lt;code&gt;https://apis.opengateway.ai/v1&lt;/code&gt; with Bearer auth, and model IDs follow the &lt;code&gt;creator/model&lt;/code&gt; pattern (e.g. &lt;code&gt;openai/gpt-5-mini&lt;/code&gt;, &lt;code&gt;anthropic/claude-sonnet-4-6&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Real example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://apis.opengateway.ai/v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"OPENGATEWAY_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"openai/gpt-5-mini"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Ping!"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&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;h2&gt;
  
  
  Real cost for a small agent
&lt;/h2&gt;

&lt;p&gt;From the dashboard pricing table, gpt-5-mini is $0.25/1M input and $2/1M output (same on the Azure and OpenAI routes). My small agent (~2,000 tokens in + 500 out per call) costs about $0.0015 per call — roughly $1,500 per million calls. Output tokens remain the thing to watch.&lt;/p&gt;

&lt;h2&gt;
  
  
  The referral program, from the dashboard
&lt;/h2&gt;

&lt;p&gt;Source: my Referral dashboard, 26 Nov 2026. My account is on the Regular tier; there is an "Upgrade to partner" button whose requirements I have not checked.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First top-up pool: up to $100, split 50/50 between inviter and invitee.&lt;/li&gt;
&lt;li&gt;$10 each when the invitee's first payment is $20 or more.&lt;/li&gt;
&lt;li&gt;2.5% of their payments for 90 days.&lt;/li&gt;
&lt;li&gt;Credits are not automatic — you claim them as OG Credit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Caps exist (monthly cap, per-referred-team cap) and can differ per account — check your own dashboard before doing the math.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits of this review
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No latency or failover benchmarks; I verified routing and OpenAI-SDK-compatible responses, nothing more.&lt;/li&gt;
&lt;li&gt;Prices change; the numbers here are accurate as of 26 Nov 2026 only.&lt;/li&gt;
&lt;li&gt;I have not used the Images, Embeddings, or Decisions endpoints.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://opengateway.ai/" rel="noopener noreferrer"&gt;OpenGateway — official landing page&lt;/a&gt; (accessed 26 Nov 2026)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://opengateway.ai/docs/reference/guides/overview" rel="noopener noreferrer"&gt;OpenGateway API Reference — base URL, auth, model IDs&lt;/a&gt; (accessed 26 Nov 2026)&lt;/li&gt;
&lt;li&gt;My account's Models &amp;amp; Referral dashboards, screenshots taken 26 Nov 2026&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Read next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://im-khang.hashnode.dev/how-i-evaluated-an-ecommerce-analytics-agent-answers-sql-tool-use-and-safety" rel="noopener noreferrer"&gt;How I Evaluated an Ecommerce Analytics Agent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://im-khang.hashnode.dev/archify-codebase-maps-reviewed-technical-artifacts" rel="noopener noreferrer"&gt;How Archify Turns Codebase Maps Into Reviewed Technical Artifacts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Disclosure: the link below is my personal referral link; I recommend it because I use OpenGateway daily. Signing up at &lt;a href="https://opengateway.ai/" rel="noopener noreferrer"&gt;opengateway.ai&lt;/a&gt; directly works identically — nothing above depends on the link.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My invite link:&lt;/strong&gt; &lt;a href="https://opengateway.ai/?ref=HHAS5T79" rel="noopener noreferrer"&gt;https://opengateway.ai/?ref=HHAS5T79&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>api</category>
      <category>llm</category>
    </item>
    <item>
      <title>LLM Cache Is Not Your Agent’s KPI</title>
      <dc:creator>Khang Nguyen</dc:creator>
      <pubDate>Thu, 10 Sep 2026 10:33:52 +0000</pubDate>
      <link>https://dev.to/im-khang/llm-cache-is-not-your-agents-kpi-caj</link>
      <guid>https://dev.to/im-khang/llm-cache-is-not-your-agents-kpi-caj</guid>
      <description>&lt;p&gt;A high cache-hit rate can make an AI agent look efficient while it still burns time and money elsewhere.&lt;/p&gt;

&lt;p&gt;The metric I would rather track is &lt;strong&gt;cost per successful task&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;model price × tokens × cache economics × effort × tool calls × retries&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then put that number beside latency and success rate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cache is useful. It is not the finish line.
&lt;/h2&gt;

&lt;p&gt;Prompt caching is one of the best ways to cut repeated-input cost. Anthropic’s guidance is sensible: keep stable instructions and tool definitions before the volatile part of a request, so the reusable prefix stays byte-identical.&lt;/p&gt;

&lt;p&gt;But a good cache metric cannot tell you whether the agent made unnecessary tool calls, followed outdated rituals, or spent too long thinking about a task that already had a clear path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prompt cleanup is part of performance work
&lt;/h2&gt;

&lt;p&gt;Many prompts carry historical baggage: forced step-by-step procedures, manual scratchpads, duplicate rules, and repeated verification written to compensate for older models.&lt;/p&gt;

&lt;p&gt;With stronger models, those instructions can become friction. They may increase tokens, latency, and tool usage without improving the answer.&lt;/p&gt;

&lt;p&gt;The practical move is not “always use low effort” or “always use the strongest model.” It is to measure representative tasks, remove prompt anti-patterns, and choose model × effort × tools for the work in front of you.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to measure
&lt;/h2&gt;

&lt;p&gt;For each task class, ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did it finish correctly?&lt;/li&gt;
&lt;li&gt;How long did it take?&lt;/li&gt;
&lt;li&gt;How many tool calls and retries did it need?&lt;/li&gt;
&lt;li&gt;What did it cost end-to-end?&lt;/li&gt;
&lt;li&gt;Did higher effort improve the outcome enough to justify the extra time and spend?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cache belongs in that picture. It should not replace the picture.&lt;/p&gt;

&lt;p&gt;Duy /zuey’s source video, &lt;strong&gt;LLM Caching is a Lie!&lt;/strong&gt;, is a useful walkthrough of this trade-off: &lt;a href="https://www.youtube.com/watch?v=-ReK4Ag-6hE" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=-ReK4Ag-6hE&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anthropic’s cost-and-performance guidance: &lt;a href="https://claude.com/it/blog/reducing-cost-and-improving-performance-with-claude-platform" rel="noopener noreferrer"&gt;https://claude.com/it/blog/reducing-cost-and-improving-performance-with-claude-platform&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I write practical notes from building with AI tools at &lt;a href="https://im-khang.com" rel="noopener noreferrer"&gt;https://im-khang.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>performance</category>
    </item>
    <item>
      <title># Archify: Turn Your Codebase Into a Verified Interactive System Map</title>
      <dc:creator>Khang Nguyen</dc:creator>
      <pubDate>Fri, 04 Sep 2026 11:25:22 +0000</pubDate>
      <link>https://dev.to/im-khang/-archify-turn-your-codebase-into-a-verified-interactive-system-map-2f6b</link>
      <guid>https://dev.to/im-khang/-archify-turn-your-codebase-into-a-verified-interactive-system-map-2f6b</guid>
      <description>&lt;p&gt;When you’re learning technology by building real projects, understanding a codebase can become harder than writing it.&lt;/p&gt;

&lt;p&gt;You may know what each file does. You may even understand individual functions and services. But once data moves through APIs, workers, databases, queues, and user interfaces, the system becomes difficult to explain as a whole.&lt;/p&gt;

&lt;p&gt;This problem gets worse when working with AI coding tools. Cursor, Claude Code, Codex CLI, and OpenCode can help you move quickly, but fast code generation doesn’t automatically produce a clear mental model.&lt;/p&gt;

&lt;p&gt;Archify addresses this gap by turning a codebase or system description into a polished, interactive system map directly in chat.&lt;/p&gt;

&lt;p&gt;It is an MIT-licensed Node.js rendering and validation system designed for AI-assisted developers and indie developers who need practical architectural clarity without building diagram infrastructure from scratch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why system diagrams often fail
&lt;/h2&gt;

&lt;p&gt;A diagram can look useful and still be wrong.&lt;/p&gt;

&lt;p&gt;Common problems include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A service appears connected to a component it never calls.&lt;/li&gt;
&lt;li&gt;A route points to the wrong destination.&lt;/li&gt;
&lt;li&gt;Labels overlap lines and become hard to read.&lt;/li&gt;
&lt;li&gt;A layout looks acceptable in source data but breaks when rendered.&lt;/li&gt;
&lt;li&gt;A diagram describes an assumed dependency instead of an authored one.&lt;/li&gt;
&lt;li&gt;A “before and after” comparison suggests impact that the available data cannot prove.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For technical readers, visual polish matters. But correctness matters more.&lt;/p&gt;

&lt;p&gt;Archify treats a system map as a rendered and validated artifact, not as a loose visual sketch.&lt;/p&gt;

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

&lt;p&gt;Archify uses a two-stage process.&lt;/p&gt;

&lt;p&gt;First, an agent creates a typed JSON intermediate representation, or IR. This structure describes system entities, relationships, routes, roles, and other diagram information.&lt;/p&gt;

&lt;p&gt;Then Archify deterministically compiles that IR into self-contained HTML and SVG.&lt;/p&gt;

&lt;p&gt;This separation has an important benefit: the agent describes the system, while Archify handles rendering and validation through a predictable process.&lt;/p&gt;

&lt;p&gt;The result can be viewed as an interactive system map without requiring a separate diagram server or a complex frontend setup.&lt;/p&gt;

&lt;p&gt;The system supports several diagram types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Architecture diagrams for services, components, and dependencies&lt;/li&gt;
&lt;li&gt;Workflow diagrams for operational or business processes&lt;/li&gt;
&lt;li&gt;Sequence diagrams for ordered interactions&lt;/li&gt;
&lt;li&gt;Data-flow diagrams for movement between systems&lt;/li&gt;
&lt;li&gt;Lifecycle diagrams for state transitions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes Archify useful beyond traditional software architecture. An indie founder could map an onboarding flow, an ecommerce order process, an AI pipeline, or a product’s internal service structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interactive features for exploring complex systems
&lt;/h2&gt;

&lt;p&gt;Static diagrams are useful for presentations. Interactive maps are better for investigation.&lt;/p&gt;

&lt;p&gt;Archify artifacts support:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dark and light themes&lt;/li&gt;
&lt;li&gt;Search&lt;/li&gt;
&lt;li&gt;Exact authored route tracing&lt;/li&gt;
&lt;li&gt;Upstream and downstream reach&lt;/li&gt;
&lt;li&gt;Semantic-role comparison&lt;/li&gt;
&lt;li&gt;Guided stories&lt;/li&gt;
&lt;li&gt;PNG exports&lt;/li&gt;
&lt;li&gt;SVG exports&lt;/li&gt;
&lt;li&gt;WebM exports&lt;/li&gt;
&lt;li&gt;1200×630 share cards&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Search helps users find a component or service without scanning the entire map.&lt;/p&gt;

&lt;p&gt;Route tracing helps answer a more specific question: “What exact path connects these authored nodes?” This is different from inferring a relationship based on naming or visual proximity.&lt;/p&gt;

&lt;p&gt;Upstream and downstream reach supports impact exploration. You can inspect what feeds into a component and what depends on it.&lt;/p&gt;

&lt;p&gt;Semantic-role comparison adds another useful perspective. Two components may look similar structurally but serve different roles in a system. Comparing those roles helps explain why they exist separately.&lt;/p&gt;

&lt;p&gt;Guided stories provide a structured way to walk through a system rather than forcing every reader to interpret the map from scratch.&lt;/p&gt;

&lt;p&gt;Exports make the result useful outside the original chat workflow. SVG works well for documentation and editing. PNG supports common documents and presentations. WebM and share cards support demonstrations and project communication.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validation is part of the output
&lt;/h2&gt;

&lt;p&gt;Archify validates several layers of the artifact:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Schema&lt;/li&gt;
&lt;li&gt;Layout&lt;/li&gt;
&lt;li&gt;Rendering&lt;/li&gt;
&lt;li&gt;Routes&lt;/li&gt;
&lt;li&gt;Label-to-route clearance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Schema validation checks whether the intermediate representation follows the expected structure.&lt;/p&gt;

&lt;p&gt;Layout validation checks whether the generated map has usable positioning and geometry.&lt;/p&gt;

&lt;p&gt;Rendering validation checks the produced HTML/SVG artifact rather than stopping at source data.&lt;/p&gt;

&lt;p&gt;Route validation checks whether authored connections resolve correctly.&lt;/p&gt;

&lt;p&gt;Label-to-route clearance checks a practical visual problem: whether text collides with or obscures relationship lines.&lt;/p&gt;

&lt;p&gt;This approach is especially valuable when diagrams are generated from natural-language system descriptions. Natural language can leave gaps, introduce ambiguity, or encourage an agent to fill in details that were never provided.&lt;/p&gt;

&lt;p&gt;Validation cannot prove facts missing from the input. It can, however, catch structural and rendering problems before they become part of your documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture Delta without invented certainty
&lt;/h2&gt;

&lt;p&gt;Software systems change constantly. A useful architecture tool should help compare versions without pretending to know more than the snapshots contain.&lt;/p&gt;

&lt;p&gt;Archify’s Architecture Delta compares validated Before, Delta, and After snapshots.&lt;/p&gt;

&lt;p&gt;It reports authored:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Additions&lt;/li&gt;
&lt;li&gt;Removals&lt;/li&gt;
&lt;li&gt;Changes&lt;/li&gt;
&lt;li&gt;Moves&lt;/li&gt;
&lt;li&gt;Reroutes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important constraint is what it does not claim.&lt;/p&gt;

&lt;p&gt;Architecture Delta does not invent operational impact, merge safety, or downstream consequences when those facts are not provided in the snapshots.&lt;/p&gt;

&lt;p&gt;That makes the comparison more useful for technical communication. It can show how the authored architecture changed while keeping unsupported conclusions out of the report.&lt;/p&gt;

&lt;p&gt;For an indie developer, this creates a practical record of system evolution. You can document a migration, a service split, a new data path, or a changed workflow without turning a visual diff into an unreliable risk assessment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Useful for AI-assisted development
&lt;/h2&gt;

&lt;p&gt;AI coding tools are good at producing local changes. They are less reliable at maintaining a shared, human-readable model of an entire system.&lt;/p&gt;

&lt;p&gt;Archify fits around tools that developers already use:&lt;/p&gt;

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

&lt;p&gt;You can use an agent to inspect or describe a system, then produce an Archify map that gives the project a concrete visual structure.&lt;/p&gt;

&lt;p&gt;This creates a better review surface for questions such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where does request data enter the system?&lt;/li&gt;
&lt;li&gt;Which service owns this transformation?&lt;/li&gt;
&lt;li&gt;What depends on this database?&lt;/li&gt;
&lt;li&gt;Which route changed between two snapshots?&lt;/li&gt;
&lt;li&gt;Does the rendered diagram match the authored relationships?&lt;/li&gt;
&lt;li&gt;Can a new contributor follow the main workflow?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is not to replace source code, tests, or technical documentation. The goal is to make system structure easier to inspect and explain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Install Archify as a global skill with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx skills add tt-a1i/archify &lt;span class="nt"&gt;-g&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, use it with a supported AI coding environment to generate system maps from a codebase or system description.&lt;/p&gt;

&lt;p&gt;Archify is MIT-licensed, so you can inspect and adapt the project according to its license.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical workflow for indie developers
&lt;/h2&gt;

&lt;p&gt;A simple workflow keeps the tool useful:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with a focused system boundary.&lt;/li&gt;
&lt;li&gt;Ask the agent to describe only authored components and relationships.&lt;/li&gt;
&lt;li&gt;Generate the map.&lt;/li&gt;
&lt;li&gt;Review validation results.&lt;/li&gt;
&lt;li&gt;Use search and route tracing to inspect important paths.&lt;/li&gt;
&lt;li&gt;Export the artifact for documentation or project communication.&lt;/li&gt;
&lt;li&gt;Regenerate the map after meaningful architecture changes.&lt;/li&gt;
&lt;li&gt;Compare validated snapshots with Architecture Delta.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Avoid mapping everything at once. A smaller map that answers one real question is more valuable than a giant diagram nobody can read.&lt;/p&gt;

&lt;p&gt;For example, begin with an order fulfillment workflow instead of an entire ecommerce platform. Map the request, inventory check, payment event, warehouse action, and delivery update. Once that map is clear, expand the boundary when needed.&lt;/p&gt;

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

&lt;p&gt;Archify is built around a straightforward idea: system maps should be useful, inspectable, and honest about what they know.&lt;/p&gt;

&lt;p&gt;It combines AI-generated typed JSON IR with deterministic HTML/SVG rendering and validation. The result is an interactive system map that can support architecture review, onboarding, debugging, documentation, and change analysis.&lt;/p&gt;

&lt;p&gt;For developers learning through real projects, this matters. A clear map helps connect individual implementation details to system behavior.&lt;/p&gt;

&lt;p&gt;Explore the project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/tt-a1i/archify" rel="noopener noreferrer"&gt;https://github.com/tt-a1i/archify&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Interactive project site: &lt;a href="https://tt-a1i.github.io/archify/" rel="noopener noreferrer"&gt;https://tt-a1i.github.io/archify/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>software</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
