<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[AXI runtime: LLM agent tests]]></title><description><![CDATA[AXI runtime: LLM agent tests]]></description><link>https://axi-runtime.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 13:59:22 GMT</lastBuildDate><atom:link href="https://axi-runtime.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[AXI at Claude, Grok and Gemini list prices: 61x to 79x cheaper per verified step than a kept chat (measured tokens, list prices)]]></title><description><![CDATA[One measured job priced at Anthropic, xAI and Google list prices: AXI is 61x to 79x cheaper per verified step than a kept chat (cold cache).]]></description><link>https://axi-runtime.hashnode.dev/axi-at-claude-grok-and-gemini-list-prices-61x-to-79x-cheaper-per-verified-step-than-a-kept-chat-measured-tokens-list-prices</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/axi-at-claude-grok-and-gemini-list-prices-61x-to-79x-cheaper-per-verified-step-than-a-kept-chat-measured-tokens-list-prices</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[performance]]></category><category><![CDATA[architecture]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Thu, 26 Nov 2026 09:56:32 GMT</pubDate><content:encoded><![CDATA[<p>I priced one measured job at Anthropic's, xAI's and Google's published list prices. Same token counts on every row, so the only thing that changes from row to row is the price list.</p>
<p>AXI is a layer on the host side, between a model and the state it edits. The host holds the exact state, the model proposes one change per step, a deterministic check admits or refuses it, and the prompt is rebuilt short from the held state at every step. The model is unchanged. It is for the company that runs the model, not for end users, and it fits any LLM application that holds state, short jobs and long, from the first step. The architecture is by Rajnish Choubey. The tests and measurements are mine, run with an AI assistant as a tool. I am not affiliated with Anthropic, xAI, Google or Meta. ("AXI" here is not the Google or Microsoft products of the same name.)</p>
<h2>The job</h2>
<p>400 steps that edit a service graph, one change per step (the cache pair test and Test 23 in the repository). Three ways of holding the state:</p>
<ul>
<li><strong>A:</strong> the host holds the state as data and rebuilds a short prompt each step (AXI).</li>
<li><strong>KC:</strong> the whole chat is kept and the cache is cold.</li>
<li><strong>KW:</strong> the whole chat is kept and the cache is warm (97.0 percent of its prompt tokens were read from the cache).</li>
</ul>
<p>A verified step is a step after which the held state equals the true state. The token counts were measured on Gemini 3.8 Flash, and Google's own bill confirms them in total to about 1.3 percent (the earlier article on this).</p>
<table>
<thead>
<tr>
<th></th>
<th>A (host-held)</th>
<th>KC (kept chat, cold)</th>
<th>KW (kept chat, warm)</th>
</tr>
</thead>
<tbody><tr>
<td>steps run</td>
<td>400</td>
<td>390</td>
<td>400</td>
</tr>
<tr>
<td>verified steps</td>
<td>400</td>
<td>328</td>
<td>260</td>
</tr>
<tr>
<td>prompt tokens</td>
<td>470,669</td>
<td>37,967,655</td>
<td>39,923,458</td>
</tr>
<tr>
<td>of them cached</td>
<td>0</td>
<td>0</td>
<td>38,728,988</td>
</tr>
<tr>
<td>output tokens</td>
<td>57,527</td>
<td>12,351</td>
<td>13,456</td>
</tr>
<tr>
<td>largest prompt of one step</td>
<td>1,390</td>
<td>193,411</td>
<td>198,405</td>
</tr>
</tbody></table>
<h2>The cost of one verified step at list prices</h2>
<p>Fresh prompt tokens at the input price, cached ones at the cached price, output at the output price, divided by the verified steps of the cell.</p>
<table>
<thead>
<tr>
<th>model (dollars a million tokens: input / cached / output)</th>
<th>A (host-held state)</th>
<th>kept chat, cold</th>
<th>times A</th>
<th>kept chat, warm</th>
<th>times A</th>
</tr>
</thead>
<tbody><tr>
<td>Gemini 3.8 Flash (0.75 / 0.075 / 3.75)</td>
<td>$0.0014</td>
<td>$0.0870</td>
<td>61.2</td>
<td>$0.0148</td>
<td>10.4</td>
</tr>
<tr>
<td>Claude Sonnet 5.5 (2 / 0.1 / 10)</td>
<td>$0.0038</td>
<td>$0.2319</td>
<td>61.2</td>
<td>$0.0246</td>
<td>6.5</td>
</tr>
<tr>
<td>Claude Opus 5.5 (4 / 0.2 / 20)</td>
<td>$0.0076</td>
<td>$0.4638</td>
<td>61.2</td>
<td>$0.0492</td>
<td>6.5</td>
</tr>
<tr>
<td>Grok 4.3 (1.25 / 0.2 / 2.5)</td>
<td>$0.0018</td>
<td>$0.1448</td>
<td>79.1</td>
<td>$0.0357</td>
<td>19.5</td>
</tr>
<tr>
<td>Grok 4.7 (2 / 0.5 / 6)</td>
<td>$0.0032</td>
<td>$0.2317</td>
<td>72.1</td>
<td>$0.0840</td>
<td>26.1</td>
</tr>
</tbody></table>
<p>Per million verified steps that is $3,792 with AXI on Claude Sonnet 5.5 against $231,887 for the kept chat cold and $24,602 warm; $1,830 against $144,788 and $35,664 on Grok 4.3; $1,422 against $86,957 and $14,811 on Gemini 3.8 Flash.</p>
<p>Counting every step, right or wrong, so that the gap is the tokens alone: 51.4 times cold and 4.2 times warm on Claude, 66.5 and 12.7 on Grok 4.3, 51.4 and 6.8 on Gemini.</p>
<h2>Where the prices come from</h2>
<ul>
<li>Google: the rates in Google's own billing report (input 0.75, cached 0.075, output 3.75).</li>
<li>Anthropic: the model pricing table at <a href="http://platform.claude.com/docs/en/about-claude/pricing">platform.claude.com/docs/en/about-claude/pricing</a>, read on 26 Nov 2026. Claude Sonnet 5.5: input $2, cache hits $0.10, output $10. Claude Opus 5.5: $4, $0.20, $20.</li>
<li>xAI: <a href="http://docs.x.ai/docs/pricing">docs.x.ai/docs/pricing</a>, "Last updated: October 10, 2026". Grok 4.3 under 200k tokens: input $1.25, cached $0.20, output $2.50. Grok 4.7: $2, $0.50, $6.</li>
</ul>
<p>The same arithmetic on Google's rates gives back the figures of the Google page ($0.0014, $0.0870, $0.0148), which is the check that the method is the same.</p>
<h2>What the arithmetic assumes</h2>
<ul>
<li>The token counts are Gemini's. A different model counts a different number of tokens for the same text (Anthropic's page says its newer tokenizer gives about 30 percent more). Both arms scale together, so the ratios move little; the dollars would move.</li>
<li>On Claude, the fresh tokens of the warm kept chat are priced at the base input price. Anthropic charges cache writes at 1.25 times base on top; adding that would raise the kept chat's warm figure. It is not added here.</li>
<li>No step reaches a long-context tier: the largest prompt of the kept chat is 198,405 tokens and Grok's higher rates start at 200,000.</li>
<li>No Anthropic or xAI bill was read, and the job was not run on their models. A run on them would replace the Gemini token counts and step counts with their own; this page is the arithmetic that those would be multiplied by.</li>
</ul>
<h2>Meta's Llama</h2>
<p>Llama is open-weight and priced by whoever serves it, so there is no single list price. What it shares with every host is the memory of the cache: 2 times layers times key-value heads times head size times 2 bytes per token, which is 131,072 bytes for Llama 3.1 8B and 327,680 for 70B (public configurations). At the mean prompt of each arm (1,177 tokens for A, 97,353 for the kept chat) a session takes 154.3 MB against 12.76 GB on 8B, and 385.7 MB against 31.90 GB on 70B: 82.7 times. Llama 3.1's window is 131,072 tokens and the kept chat of this job passes it at step 264.</p>
<h2>Check it</h2>
<p>Every figure above is recomputed by a test from the saved result files and a small file of prices, with no model call: <a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/PRICE_CHECK.md">PRICE_CHECK.md</a> and <code>python/tests/test_price_check.py</code>. To use other prices, change the numbers in <code>docs/results/price_check.json</code>. The repository: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>.</p>
]]></content:encoded></item><item><title><![CDATA[AXI on one TPU v6e chip: 927 agent sessions with host-held state, 5 with a kept chat (memory only)]]></title><description><![CDATA[How many agent sessions fit on one TPU v6e chip: 927 with host-held state against 5 with a kept chat. Memory only, no model run, plan hash-locked.]]></description><link>https://axi-runtime.hashnode.dev/one-tpu-v6e-chip-holds-927-agent-sessions-with-host-held-state-and-5-with-a-kept-chat-memory-only</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/one-tpu-v6e-chip-holds-927-agent-sessions-with-host-held-state-and-5-with-a-kept-chat-memory-only</guid><category><![CDATA[AI]]></category><category><![CDATA[llm]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 25 Nov 2026 22:02:50 GMT</pubDate><content:encoded><![CDATA[<p><em>This article was created with the help of AI. The AXI architecture is by Rajnish Choubey. The tests were built and run by Shalendra Gaur.</em></p>
<p>An agent that keeps its whole chat has to hold that chat in memory for as long as the session is live. How many sessions fit on one chip is a memory question, so I measured it on a Google TPU chip.</p>
<h2>The test</h2>
<ul>
<li>Chip: one Google TPU v6e in Colab. It reported a memory limit of 33,546,042,880 bytes (about 33.5 GB). JAX 0.11.2. Run on 31 October 2026.</li>
<li>What was put on the chip: real cache-shaped arrays (the shape of Qwen2.5-0.5B, bf16), session after session, until the chip reported out of memory. No model was run.</li>
<li>Lengths: the prompt of one AXI step (2,824 tokens), and the lengths of a kept chat from a 457-turn test on Gemini 3.8 Flash (mean 476,835 tokens, largest 949,591), plus 50,000, 100,000 and 250,000.</li>
<li>The plan and six yes/no lines were written and hash-locked before the run, with a probability on each.</li>
</ul>
<h2>Result</h2>
<table>
<thead>
<tr>
<th>Prompt kept per session</th>
<th>Tokens</th>
<th>Sessions held on a TPU v6e-1</th>
<th>Sessions held on an NVIDIA T4 (earlier test)</th>
</tr>
</thead>
<tbody><tr>
<td>AXI step</td>
<td>2,824</td>
<td><strong>927</strong></td>
<td>430</td>
</tr>
<tr>
<td>Kept chat at 50k</td>
<td>50,000</td>
<td>54</td>
<td>23</td>
</tr>
<tr>
<td>Kept chat at 100k</td>
<td>100,000</td>
<td>27</td>
<td>12</td>
</tr>
<tr>
<td>Kept chat at 250k</td>
<td>250,000</td>
<td>10</td>
<td>4</td>
</tr>
<tr>
<td>Kept chat, mean of the long run</td>
<td>476,835</td>
<td><strong>5</strong></td>
<td>2</td>
</tr>
<tr>
<td>Kept chat, largest of the long run</td>
<td>949,591</td>
<td><strong>2</strong></td>
<td>1</td>
</tr>
</tbody></table>
<ul>
<li>The ratio between the two ways is about 169 in memory (476,835 / 2,824). Memory grows in a straight line with tokens, so this is close to the token ratio by construction. What the test adds is the chip itself: its real memory limit and the real bytes a session takes.</li>
<li>A kept chat at the long run's mean length takes the memory of about 169 AXI-sized sessions, and at its largest length about 336.</li>
<li>Of the six lines, five read YES and one read NO. The NO: I guessed the real bytes would be within 2% of the plain count at every length. At the AXI length they were 4.5% over (36,277,760 against 34,701,312 bytes). The extra is about what rounding the token axis up to a tile size would give, but I did not confirm that cause.</li>
</ul>
<h2>What this does not show</h2>
<ul>
<li>This is memory only. Nothing here shows speed, quality, throughput or price. Real servers evict, offload, share prefixes and page memory, and the count means sessions in flight at once.</li>
<li>No model was run, the cache shape is a small model's, and there is one run per length.</li>
<li>The TPU holds more sessions than the T4 mainly because it has more memory (33.5 GB against 15.5 GB), not because of any speed.</li>
<li>With a real model and real steps: a 7B model served by vLLM on one NVIDIA L4 ran 8, 32, 128 and 256 sessions at once, every step exact, 105,230 exact steps per GPU hour at 256 sessions (the card was full at about 128 sessions). That is docs/SESSIONS_PER_CHIP_TEST.md in the repository (Test 38).</li>
</ul>
<p>AXI is a layer on the host side by Rajnish Choubey: the model is unchanged and the claims are about the state the host holds. It is for the company that runs the model, not for end users, and it fits any LLM application that holds state, short jobs and long, from the first step. The test page is docs/TPU_SESSIONS_TEST.md in the repository: <a href="https://github.com/gaurshalendra2412/axi-runtime">https://github.com/gaurshalendra2412/axi-runtime</a></p>
<p>White paper, "AXI: The Cure for the Cost Crisis in AI" (Rajnish Choubey and Shalendra Gaur): <a href="https://doi.org/10.5281/zenodo.23958737">https://doi.org/10.5281/zenodo.23958737</a></p>
]]></content:encoded></item><item><title><![CDATA[AXI: $0.0014 per verified LLM agent step vs $0.0870 for a kept chat (61x cold, 10.4x warm), checked on Google's own bill]]></title><description><![CDATA[AXI, a host-side layer by Rajnish Choubey: $0.0014 per verified step on Gemini 3.8 Flash vs $0.0870 with the chat kept, checked on Google's bill.]]></description><link>https://axi-runtime.hashnode.dev/llm-agent-cost-per-verified-step-checked-against-google-s-own-bill-gemini-3-8-flash-61-times-cold-10-4-times-warm</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/llm-agent-cost-per-verified-step-checked-against-google-s-own-bill-gemini-3-8-flash-61-times-cold-10-4-times-warm</guid><category><![CDATA[AI]]></category><category><![CDATA[llm]]></category><category><![CDATA[gemini]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 25 Nov 2026 21:14:31 GMT</pubDate><content:encoded><![CDATA[<p><strong>AXI, the host-side layer by Rajnish Choubey, cost $0.0014 per verified step on Gemini 3.8 Flash. The same job with the chat kept cost $0.0870 per verified step with the cache cold (61 times AXI) and $0.0148 with the cache warm (10.4 times). At Google's own rates, the day's total on Google's billing report came within 1.3 percent of the logged total ($29.45 against $29.09).</strong></p>
<p>Every cost figure I had published was a token count from my own logs times a price I typed in. A reader fairly asked what the provider's bill says. This is that check, on Gemini 3.8 Flash.</p>
<p>AXI is a layer on the host side, between a model and the state it edits. The host holds the exact state, the model proposes one change per step, a deterministic check admits or refuses it, and the prompt is rebuilt short from the held state at every step. The model is unchanged. It is for the company that runs the model, not for end users, and it fits any LLM application that holds state, short jobs and long, from the first step. The architecture is by Rajnish Choubey. The tests and measurements are mine, run with an AI assistant as a tool. I am not affiliated with Google. ("AXI" here is not the ARM AMBA chip-bus protocol.)</p>
<h2>The job and the three ways of holding the state</h2>
<p>One job of 400 steps that edits a state, one change per step. Three ways of holding the state:</p>
<ul>
<li><strong>A:</strong> the host holds the state as data and rebuilds a short prompt each step (AXI).</li>
<li><strong>KC:</strong> the whole chat is kept and the cache is cold.</li>
<li><strong>KW:</strong> the whole chat is kept and the cache is warm (97.0 percent of its prompt tokens were read from the cache).</li>
</ul>
<p>A verified step is a step after which the held state equals the true state.</p>
<h2>What Google's report says about the rates</h2>
<p>In Google's billing report (Cloud console, Billing, Reports, grouped by SKU) an output token costs 5.000 times an input token and a cached token costs 0.100 of an input token. Those are the prices I had typed: $0.75 a million input tokens, $3.75 a million output tokens, and a cached token at a tenth of the input price. The ratios do not depend on any exchange rate. The report is in rupees and prints no rate; the typed $0.75 is ₹71.42 on the report, so ₹95.23 to the dollar.</p>
<h2>What it says about the totals</h2>
<ul>
<li><strong>22 November, the cache pair test (A and KC ran that day):</strong> Google charged ₹2,805.00, about $29.45. My logs gave $29.09. Google's figure is 1.25 percent higher.</li>
<li><strong>2 to 3 November, an earlier test:</strong> ₹168.92, about $1.77, against $1.75 from the logs (1.1 percent).</li>
</ul>
<p>Google's day holds 490,025 more input tokens (1.27 percent) and 5,206 more output tokens (7.45 percent) than my logs for those two runs. The bill does not say whether those are calls my logs lack or a difference in counting.</p>
<h2>What a verified step costs at those rates</h2>
<table>
<thead>
<tr>
<th></th>
<th>A (AXI: state held by the host)</th>
<th>KC (chat kept, cache cold)</th>
<th>KW (chat kept, cache warm)</th>
</tr>
</thead>
<tbody><tr>
<td>prompt tokens in the job</td>
<td>470,669</td>
<td>37,967,655</td>
<td>39,923,458</td>
</tr>
<tr>
<td>verified steps</td>
<td>400</td>
<td>328</td>
<td>260</td>
</tr>
<tr>
<td>dollars per verified step</td>
<td>$0.0014</td>
<td>$0.0870</td>
<td>$0.0148</td>
</tr>
<tr>
<td>times A</td>
<td>1</td>
<td>61.2</td>
<td>10.4</td>
</tr>
<tr>
<td>dollars per step, every step counted, right or wrong</td>
<td>$0.0014</td>
<td>$0.0731</td>
<td>$0.0096</td>
</tr>
<tr>
<td>times A, wrongness ignored</td>
<td>1</td>
<td>51.4</td>
<td>6.8</td>
</tr>
</tbody></table>
<p>The last two rows leave out whether a step was right: the same tokens divided by every step the cell ran, so the gap there is the tokens alone. At a million verified steps that is about $1,422 held by the host, $86,957 with the chat kept cold and $14,811 with it kept warm (each from the table's cost rounded less).</p>
<p>The kept chat's prompt grows every turn. The prompt rebuilt from the held state stays near 1,200 tokens, about 1,177 on average here, because it follows the size of the state and not the number of steps.</p>
<h2>What the bill does not show</h2>
<ul>
<li>A and KC ran on the same day, so the bill gives their total, not each arm.</li>
<li>KW's figure is worked out from its tokens at Google's cached price. It is not a line of its own on the bill, because that run was one of several on other days.</li>
<li>This is one model, one paid account, one month. The lines are Google's, copied by hand from the report table, with account and project identifiers left out.</li>
</ul>
<h2>Check it</h2>
<p>The report lines, the arithmetic and a test that recomputes every figure above are in the repository: <a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/BILLING_CHECK.md">BILLING_CHECK.md</a>. To read Google's side yourself, open Billing, Reports in the Cloud console, group by SKU, set the dates, and compare the table with the saved lines. The repository: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>.</p>
]]></content:encoded></item><item><title><![CDATA[What replaying an agent's history costs the host (Nebius and WEKA numbers), and how AXI removes the replay]]></title><description><![CDATA[Nebius and WEKA numbers on what replayed agent history costs a host, next to measured flat prompts, first-token times and memory.]]></description><link>https://axi-runtime.hashnode.dev/what-replaying-an-agent-s-history-costs-the-host-nebius-and-weka-numbers-and-a-layer-that-removes-the-replay</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/what-replaying-an-agent-s-history-costs-the-host-nebius-and-weka-numbers-and-a-layer-that-removes-the-replay</guid><category><![CDATA[AI]]></category><category><![CDATA[llm]]></category><category><![CDATA[performance]]></category><category><![CDATA[architecture]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 25 Nov 2026 11:25:23 GMT</pubDate><content:encoded><![CDATA[<p>Every turn of an agent loop is a new request, and its prompt carries the whole session so far. Two public sources from this autumn put numbers on what that costs the company that runs the model.</p>
<h2>What the host pays for the replay</h2>
<p><strong>Nebius and WEKA, 24 September 2026.</strong> One eight-GPU NVIDIA HGX B300 node serving DeepSeek-V4-Pro with vLLM, replaying real agentic coding traffic (a pool of 512 active sessions drawn from more than 5,000 captured sessions) for eight hours per configuration. With GPU memory only: a 40% cache hit rate, 33,900 uncached prefill tokens per request, 44% of requests with a first token under 5 seconds, and 46,000 output tokens per GPU-hour. With WEKA's shared cache tier added: 93%, 4,400, 97%, and 169,000 (3.7 times). WEKA's write-up of 16 November 2026 adds that 60% of prefill work was recomputed on the memory-only node and 6.8% with the tier.</p>
<p><strong>SemiAnalysis AgentX.</strong> The AgentX v1.0 dataset holds 393 real Claude Code sessions. The median request carries 142,016 input tokens and produces 444 output tokens, and 44% of the sessions contain subagents.</p>
<p>That is how the bill is built: the input side follows the length of the replayed history, and a faster cache tier lowers the price of each replay.</p>
<h2>The other lever: do not replay</h2>
<p>AXI is a layer on the host side, between the model and the state it edits. The host holds the exact state. The model proposes one change per step in a small strict language, a deterministic check admits or refuses it, and the next prompt is rebuilt, short and of fixed size, from the held state. The prompt follows the size of the state, not the number of steps. The model is unchanged.</p>
<p>It is for the company that runs the model, not for end users, and it fits any LLM application that holds state: agents, chat, workflows, short jobs and long, from the first step. The architecture is by Rajnish Choubey. The tests and measurements are mine, run with an AI assistant as a tool.</p>
<p>What was measured, each figure in its own setup:</p>
<ul>
<li><strong>Qwen2.5-14B-Instruct-AWQ, vLLM 0.31.0, one L4, prefix caching on, three 600-step jobs:</strong> 413.7 prompt tokens a step with the exact state held by the host; 8,228.8 with the whole chat kept (all three kept chats reached the 16,000-token limit between steps 367 and 418); 2,334.2 with a running summary.</li>
<li><strong>Gemini 3.8 Flash, 400 turns:</strong> 99,809 prompt tokens a turn with the chat kept against 1,177 with the layer (85 times fewer). Median first token past 150,000 prompt tokens: 5.57 s against 2.41 s.</li>
<li><strong>Gemini 3.8 Flash, 1,500 steps:</strong> with the layer the state was exact on 1,500 of 1,500 steps, at about 2,824 prompt tokens a step. With the chat kept, the mean prompt was 476,835 tokens over the 457 turns it ran, and a company applying the replies as they came lost the state for good at turn 287. Median first token: 9.13 s (kept chat, prompts of 500,000 tokens and more) against 2.27 s (all steps with the layer).</li>
<li><strong>A 7B model on one L4:</strong> the prompt never went above 660 tokens over 80,000 steps, and all 80,000 states were exact.</li>
<li><strong>Memory on a Google TPU v6e-1 chip</strong> (33.5 GB, cache-shaped arrays, no model run): a kept chat at the mean length of the 1,500-step job takes the memory of about 169 AXI-sized sessions.</li>
</ul>
<h2>Reading the two sets of numbers together</h2>
<p>They come from different workloads. Nebius and WEKA replayed captured coding sessions. Ours are generated jobs in which every step is compared with an exact answer. They are not a head-to-head; they show one shape from two sides. Where the history is replayed, cost and first-token time follow the number of steps. Where the host holds the state and rebuilds the prompt, they follow the size of the state.</p>
<h2>What is checkable</h2>
<p>The repository holds the tests, the saved results and a small sidecar that shows how the layer sits in front of a vLLM or SGLang server. The headline numbers can be re-checked in a few seconds, with no key, no model and no GPU: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. The test pages behind the figures above: <a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/MEMORY_ARMS_TEST.md">memory arms</a>, <a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/GEMINI_LONG_TEST.md">1,500-step Gemini job</a>, <a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/TPU_SESSIONS_TEST.md">TPU sessions</a>, <a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/ENDURANCE_7B_TEST.md">80,000-step 7B run</a>, <a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/AXI_TECHNICAL_REFERENCE.md">technical reference</a>.</p>
<h2>Sources</h2>
<ul>
<li>Nebius, <a href="https://nebius.com/blog/posts/nebius-weka-shared-kv-cache-benchmark-hgx-b300">"Nebius and WEKA benchmark distributed KV cache for agentic inference on NVIDIA HGX B300"</a> (24 September 2026).</li>
<li>WEKA, <a href="https://hpcwire.com/off-the-wire/weka-new-research-challenges-gpu-utilization-as-measure-of-inference-infrastructure">"New Research Challenges GPU Utilization as Measure of Inference Infrastructure"</a> (16 November 2026).</li>
<li>SemiAnalysis, <a href="https://inferencex.semianalysis.com/blog/agentic-benchmark-agent-benchmark-guide">"Agentic Benchmark for LLM Inference: Metrics and Methodology"</a>.</li>
</ul>
<p>Architecture: Rajnish Choubey. Tests and measurements: Shalendra Gaur, with an AI assistant as a tool. Not affiliated with Nebius, WEKA, SemiAnalysis, Google or the vLLM project.</p>
]]></content:encoded></item><item><title><![CDATA[LLM agent token cost and state drift: the fixes compared with authors and papers, and where AXI sits (measured)]]></title><description><![CDATA[Six fixes for LLM agent token cost and state drift, with authors and papers, plus measured numbers for host-held state (AXI, model unchanged).]]></description><link>https://axi-runtime.hashnode.dev/llm-agent-token-cost-and-state-drift-the-fixes-compared-with-authors-papers-and-measured-numbers</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/llm-agent-token-cost-and-state-drift-the-fixes-compared-with-authors-papers-and-measured-numbers</guid><category><![CDATA[llm]]></category><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[agents]]></category><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 25 Nov 2026 06:17:31 GMT</pubDate><content:encoded><![CDATA[<p><strong>Short answer.</strong> Agent cost climbs when the whole chat is resent every turn, and state drifts when the chat is the only record of what the agent did. Six families of fixes exist: external memory, typed state with checkpoints, structured output, prompt compression, context folding, and host-held state with a gate. They solve different problems and combine well. This page lists each with its authors and paper or project, says what it is best for, and gives the measured numbers for the host-held-state one, AXI.</p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>Why does an agent's token cost grow with every step?</h2>
<p>The model is stateless, so each turn the host sends the instructions, every earlier call and every earlier tool result again. A tool result that is 4 KB costs 4 KB on the turn it arrives and again on every turn after. Over <em>n</em> turns the total sent grows with the square of <em>n</em>, and the time to the first token grows with the prompt. Prompt caching lowers the price of the repeated part; it does not shorten the prompt.</p>
<h2>Why does the state drift after hundreds of steps?</h2>
<p>If the chat is the record, the record is whatever the model last wrote about it. A reply that leaves one thing out (a missing edge, a dropped constraint) is applied as written, nothing checks it again, and the next prompt carries the mistake forward.</p>
<h2>The fixes compared</h2>
<table>
<thead>
<tr>
<th>Fix</th>
<th>What it changes</th>
<th>Projects, papers, authors</th>
<th>Best for</th>
</tr>
</thead>
<tbody><tr>
<td>External memory</td>
<td>Facts live in a store the agent reads and writes by tool call</td>
<td>MemGPT, now Letta (<a href="https://arxiv.org/abs/2310.08560">Packer, Wooders, Lin, Fang, Patil, Stoica, Gonzalez, 2023</a>); Mem0; Zep and Graphiti</td>
<td>What the agent should remember about users and past work</td>
</tr>
<tr>
<td>Typed state and checkpoints</td>
<td>The graph's state is a typed object saved after each step</td>
<td>LangGraph (LangChain)</td>
<td>Workflow control, recovery and human-in-the-loop steps</td>
</tr>
<tr>
<td>Structured output</td>
<td>One reply is well formed</td>
<td>Instructor (validate and retry); Outlines by .txt (constrained decoding; Willard and Louf); BAML by BoundaryML (schema-aligned parsing); Pydantic AI (typed agents); DSPy (Khattab et al., programs of language-model modules)</td>
<td>Getting parseable, typed answers</td>
</tr>
<tr>
<td>Prompt compression</td>
<td>The prompt has fewer tokens</td>
<td>LLMLingua (Jiang, Wu, Lin, Yang, Qiu; Microsoft Research)</td>
<td>Long documents and verbose tool output</td>
</tr>
<tr>
<td>Context folding</td>
<td>Old turns are rendered shorter, the history is kept</td>
<td><a href="https://arxiv.org/abs/2610.07863">ReFold</a> (Su, Tian, Zhang, Kundu): reports up to 2.5x fewer tokens on five coding benchmarks</td>
<td>Coding agents with long transcripts</td>
</tr>
<tr>
<td>Host-held state with a gate</td>
<td>The host holds the exact state; the model proposes one change per step; the host checks, repairs and commits</td>
<td><a href="https://arxiv.org/abs/2605.29313">PatchBoard</a> (Zhang, Shi, Zhang, Zhao, Wang; JSON Patch on shared state; 84.6% success on 630 ALFWorld episodes); <a href="https://arxiv.org/abs/2607.05483">PatchOptic</a> (Bai and Cai; projected views and verified updates); AXI (Rajnish Choubey)</td>
<td>An edited state that must stay exactly right, with a prompt that does not grow</td>
</tr>
</tbody></table>
<p>The first five rows are about what the model reads or how it answers. The last row is about who owns the state. AXI can sit beside or under the others: a typed-output library can make the model's reply parse, and the AXI gate then decides whether that reply may change the state. Different papers use different tasks, so their numbers are not comparable with each other.</p>
<h2>How does AXI work?</h2>
<p>AXI is a layer on the host side, between a model and the state it edits. The model is unchanged. At every step the model sees a short prompt built from the held state and proposes one change in a small strict language. A reply the strict parser cannot read is refused and asked again, up to twice. A gate checks the proposal against the rules, a repair rule completes what the rules can complete (deleting a service also removes the edges attached to it), and the commit is all or nothing. The next prompt is built from the new state, so its size follows the size of the state and not the number of steps.</p>
<h2>What did AXI measure?</h2>
<p>On one job of 4,000 requests, Gemini 3.8 Flash's own replies were exactly right 3,954 times (98.85 percent). The state the host held was exactly right on all 4,000 steps. The 46 replies that were not exactly right all left out the same thing, the attached edges of a deleted service, and a fixed rule completed them.</p>
<table>
<thead>
<tr>
<th>Measured, Gemini 3.8 Flash</th>
<th>Chat kept</th>
<th>AXI</th>
</tr>
</thead>
<tbody><tr>
<td>400-turn conversation job, prompt tokens per turn</td>
<td>99,809 on average (10,600 in the first tenth, 188,806 in the last)</td>
<td>1,177, 85 times fewer</td>
</tr>
<tr>
<td>Same job, first token (median)</td>
<td>5.57 s once the prompt passed 150,000 tokens</td>
<td>2.41 s over all 400 steps</td>
</tr>
<tr>
<td>1,500-step job, prompt tokens per step</td>
<td>476,835 on average, 949,591 at most</td>
<td>2,824 on average, flat, 169 times fewer</td>
</tr>
<tr>
<td>1,500-step job, state exactly right</td>
<td>through turn 286, wrong from turn 287</td>
<td>1,500 of 1,500 steps</td>
</tr>
</tbody></table>
<p>On an open 7B model (Qwen2.5-7B-Instruct-AWQ, vLLM, one NVIDIA L4) the held state was exactly right on 80,000 of 80,000 steps with a prompt of about 620 tokens, 660 at most. On the same card, 256 sessions at once gave 105,230 exact steps per GPU hour at 2.458 J per exact step. Through the gate, none of 1,401,041 injected hostile proposals committed. Each figure has a page and a run file in the repository.</p>
<h2>Which fix should I use?</h2>
<ul>
<li>You want the agent to remember facts across sessions: external memory (Letta, Mem0, Zep).</li>
<li>You want workflow control and recovery: LangGraph checkpoints.</li>
<li>You want well-formed replies: Instructor, Outlines, BAML, Pydantic AI.</li>
<li>You want a shorter prompt: LLMLingua or ReFold.</li>
<li>You want an edited state to stay exactly right while a model proposes changes, with the same prompt size at step 1 and at step 10,000: host-held state with a gate, which is what AXI measures and what PatchBoard and PatchOptic explore from their own side.</li>
</ul>
<h2>Check it yourself</h2>
<p>No key, no GPU, about 3 seconds. It replays the saved replies of the 4,000-step run and recomputes the held state with the repository's own code.</p>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
python3 quickstart_replay.py
</code></pre>
<p>It prints 4,000 of 4,000, 3,954 of 4,000, 85 of 400 and 4.5 times. Or open the <a href="https://colab.research.google.com/github/gaurshalendra2412/axi-runtime/blob/main/python/colab/axi_try_it.ipynb">one-click Colab notebook</a>. The one-page summary with every table is <a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/AXI_ONE_PAGE.md">docs/AXI_ONE_PAGE.md</a>; the white paper is <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a> and the technical report is <a href="https://doi.org/10.5281/zenodo.24508592">doi.org/10.5281/zenodo.24508592</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur, working with an AI coding assistant that is a tool, not an author. Not affiliated with the projects named above.</em></p>
]]></content:encoded></item><item><title><![CDATA[AXI on Gemini 3.8 Flash: 3,954 of 4,000 replies right, 4,000 of 4,000 states exact, checkable in seconds]]></title><description><![CDATA[On Gemini 3.8 Flash the model's replies were exactly right 3,954 of 4,000 times; the host-held state was exact on all 4,000. Check it in seconds.]]></description><link>https://axi-runtime.hashnode.dev/3-954-of-4-000-replies-right-4-000-of-4-000-states-exact-a-host-side-layer-on-gemini-3-8-flash-checkable-in-seconds</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/3-954-of-4-000-replies-right-4-000-of-4-000-states-exact-a-host-side-layer-on-gemini-3-8-flash-checkable-in-seconds</guid><category><![CDATA[llm]]></category><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[agents]]></category><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:06:40 GMT</pubDate><content:encoded><![CDATA[<p>On one job of 4,000 requests, Gemini 3.8 Flash's own replies were exactly right 3,954 times (98.85 percent). The state the host held was exactly right on all 4,000 steps. The model was not changed. The 46 replies that were not exactly right all left out the same thing, and a fixed rule on the host completed them. The 4,000-step figures can be recomputed from the saved replies in a few seconds, with no key; every other figure points to the page and run file that holds it.</p>
<p>AXI is a layer on the host side, between a model and the state it edits. The architecture is by <strong>Rajnish Choubey</strong>; the tests were built and run by <strong>Shalendra Gaur</strong>, working with an AI coding assistant that is a tool, not an author.</p>
<h2>What one incomplete reply does</h2>
<p>One kind of request trips the model: "Delete the service at (x,y), and also remove the edge from … to …". The job had 129 of them. When the service had other edges attached to it (its dependants), the model deleted the service and the named edge and left some of the attached edges out in 46 of 97 replies. When the request only said "Delete the service", it named every dependant every time: 472 of 472.</p>
<p>Applied as written, one such reply leaves edges pointing at a service that no longer exists, and nothing on the host checks it again, so the state stays wrong until a later request happens to overwrite it. In the live run that applied the replies as written, the first of these came at step 16, and the state was off the right one from step 16 to step 104: 89 steps. In all 46 cases the reply was the ideal reply with items left out: nothing added, nothing changed.</p>
<p>With the host holding the state, the same reply meets a fixed repair rule that adds the attached edges, the commit is all or nothing, and the next prompt is built from the exact state. The model needed no new instruction for this.</p>
<p>(<a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/MILLION_TOKEN_TEST_HARD.md"><code>MILLION_TOKEN_TEST_HARD.md</code></a>)</p>
<h2>The same replies, three ways of keeping the state</h2>
<p>Over all 4,000 steps the state the host held was exactly the right one on 4,000 and broken on none, and replaying the saved replies reproduces every saved flag of every step. The run sent 3,661,209 tokens and cost $4.95 at the prices below. The table takes the first 400 requests of the same job.</p>
<table>
<thead>
<tr>
<th>Way of keeping the state (first 400 requests)</th>
<th>Steps with exactly the right state</th>
<th>Steps with a broken state</th>
<th>Dollars per step with the right state</th>
</tr>
</thead>
<tbody><tr>
<td>Replies applied as written</td>
<td>85 of 400</td>
<td>223</td>
<td>$0.00524 (4.5 times AXI)</td>
</tr>
<tr>
<td>Gate only: refuse a bad reply, otherwise change nothing</td>
<td>84 of 400</td>
<td>0</td>
<td>$0.00573 (4.9 times AXI)</td>
</tr>
<tr>
<td>AXI: gate, repair, all-or-nothing commit</td>
<td>400 of 400</td>
<td>0</td>
<td>$0.00117</td>
</tr>
</tbody></table>
<p>The first two rows are separate live runs of the same 400 requests in which the model saw its own held state, so their replies differ from the AXI run's after the first slip; the AXI row is the first 400 steps of the 4,000-step run. Prices are $0.75 in and $3.75 out per million tokens, with thinking counted as output. A check that refuses a bad reply keeps the state well formed; it does not make it right.</p>
<h2>How one step works</h2>
<img src="https://raw.githubusercontent.com/gaurshalendra2412/axi-runtime/main/docs/img/one-step-loop.png" alt="The host holds the state and rebuilds the prompt at every step: held state, short prompt, model proposes, parse and gate, repair, commit, and back to the held state." style="display:block;margin:0 auto" />

<p>At every step the model sees a short prompt built from the held state and proposes one change in a small strict language. A reply the strict parser cannot read is refused and asked again, up to twice. The gate checks the proposal against the rules, the repair rule completes what the rules can complete (for example the edges attached to a service that is being deleted), and the commit is all or nothing: the state is the old one or the new one, never half of a change. The prompt for the next step is built from the new state, so its size follows the size of the state and not the number of steps.</p>
<h2>Cost and time as the job gets long</h2>
<img src="https://raw.githubusercontent.com/gaurshalendra2412/axi-runtime/main/docs/img/test23-prompt-tokens-by-tenth.png" alt="Kept chat: 10,600 to 188,806 tokens a turn. AXI: 946 to 1,340. Prompt tokens a step by tenth of a 400-turn conversation job on Gemini 3.8 Flash." style="display:block;margin:0 auto" />

<p>On that conversation job the chat kept sent 99,809 prompt tokens a turn on average (85 times as many as AXI's 1,177 a step); in all, 39.9 million tokens against 0.53 million for AXI, with its replies and thinking counted too (76 times fewer). With 97.0 percent of the kept chat's prompt served from the cache, its first token took a median 5.57 s once the prompt passed 150,000 tokens, against 1.86 s in its first 50 turns, where it was the faster of the two. With AXI the first token took a median 2.41 s over all 400 steps. (<a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/GEMINI_FUZZY_TEST.md"><code>GEMINI_FUZZY_TEST.md</code></a>, Test 23)</p>
<p>The long job is heavier: a dense service graph, a block of 40 log lines with every request, and the chat kept until the next prompt would have passed 950,000 tokens.</p>
<table>
<thead>
<tr>
<th>1,500-step long job, Gemini 3.8 Flash</th>
<th>Chat kept</th>
<th>AXI</th>
</tr>
</thead>
<tbody><tr>
<td>Prompt tokens a step</td>
<td>476,835 on average, 949,591 at most (457 turns, stopped before the next prompt would pass 950,000 tokens)</td>
<td>2,824 on average, flat over all 1,500 steps (169 times fewer)</td>
</tr>
<tr>
<td>First token, median</td>
<td>9.13 s once the prompt passed 500,000 tokens</td>
<td>2.27 s over all 1,500 steps</td>
</tr>
<tr>
<td>State exactly right when each reply is applied as it comes</td>
<td>through turn 286, wrong on every turn from 287</td>
<td>1,500 of 1,500 steps</td>
</tr>
</tbody></table>
<p>(<a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/GEMINI_LONG_TEST.md"><code>GEMINI_LONG_TEST.md</code></a>)</p>
<h2>Other models, more sessions, hostile input</h2>
<p>The same layer ran on an open 7B model, Qwen2.5-7B-Instruct-AWQ, served with vLLM on one NVIDIA L4. Each line below is one page in the repository, with its run file and the test that recomputes the figures.</p>
<table>
<thead>
<tr>
<th>What was run</th>
<th>Result</th>
<th>Page</th>
</tr>
</thead>
<tbody><tr>
<td>Four jobs of 20,000 steps, one L4</td>
<td>80,000 of 80,000 steps with exactly the right state; prompt about 620 tokens, 660 at most; 0.1605 s a step in the first 2,000 rounds, 0.1651 s in the last 2,000</td>
<td><a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/ENDURANCE_7B_TEST.md"><code>ENDURANCE_7B_TEST.md</code></a>, Test 43</td>
</tr>
<tr>
<td>256 sessions at once on the same card</td>
<td>25,557 steps, all exact; 105,230 exact steps per GPU hour; 2.458 J per exact step</td>
<td><a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/SESSIONS_PER_CHIP_TEST.md"><code>SESSIONS_PER_CHIP_TEST.md</code></a>, Test 38</td>
</tr>
<tr>
<td>10,000,000 hostile proposals through the gate (Python reference model, on a CPU)</td>
<td>none of the 1,401,041 injection proposals committed</td>
<td><a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/GATE_STRESS_TEST.md"><code>GATE_STRESS_TEST.md</code></a></td>
</tr>
</tbody></table>
<p>One card, one quantised model, one seed, synthetic service graphs; each page lists its own limits.</p>
<h2>Check it yourself</h2>
<p>Three checks, quickest first. The first needs no key and no account.</p>
<p><strong>1. Replay the 4,000 steps (about 3 seconds, no key).</strong> It replays the saved replies of the run and recomputes the held state with the repository's own code.</p>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
python3 quickstart_replay.py
</code></pre>
<p>Or open the <a href="https://colab.research.google.com/github/gaurshalendra2412/axi-runtime/blob/main/python/colab/axi_try_it.ipynb">one-click notebook in Colab</a>.</p>
<p><strong>2. Run the same harness live, with your own Gemini key (a free one is enough).</strong></p>
<pre><code class="language-plaintext">export GEMINI_API_KEY=your-key
pip install google-genai numpy
python3 live_check.py
</code></pre>
<p><strong>3. A longer live run, or another model.</strong></p>
<pre><code class="language-plaintext">python3 live_check.py --steps 100 --daily-limit 0 --min-interval 0.3
python3 live_check.py --model gemini-3.5-flash-lite
</code></pre>
<p>Full instructions: <a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/TRY_IT.md"><code>TRY_IT.md</code></a>.</p>
<h2>What has been said in public, and what was measured</h2>
<p>The left column paraphrases public pages; the right column is one result in the repository for the same kind of cost. They are different tasks, not the sources' own benchmarks.</p>
<table>
<thead>
<tr>
<th>Said in public</th>
<th>Measured with AXI</th>
</tr>
</thead>
<tbody><tr>
<td>Cost and time to first token rise with context; stale context hurts the model; a bigger window does not fix this. <a href="https://developers.googleblog.com/architecting-efficient-context-aware-multi-agent-framework-for-production/">Google Developers Blog, "Architecting efficient context-aware multi-agent framework for production", 4 Dec 2025</a></td>
<td>1,500-step job, Gemini 3.8 Flash: chat kept 476,835 prompt tokens a step on average, up to 949,591; AXI 2,824, flat (169 times fewer). First token, median 9.13 s past 500,000 tokens against 2.27 s.</td>
</tr>
<tr>
<td>Implicit caching passes on cost savings; the page gives no latency figure. <a href="https://ai.google.dev/gemini-api/docs/caching">Gemini API documentation, "Context caching"</a></td>
<td>With 97.0 percent of the kept chat's prompt cached, first token median 5.57 s past 150,000 tokens (1.86 s in the first 50 turns); AXI 2.41 s.</td>
</tr>
<tr>
<td>A developer reports a session growing from about 2K to over 80K tokens in five turns. <a href="https://discuss.google.dev/t/best-practices-for-handling-context-compaction-and-token-blowup-in-recursive-adk-agent-tool-loops/396215">Google developer forums, ADK thread, 10 Sep 2026</a></td>
<td>The prompt is built from the held state, so its size follows the state, not the step count: 7B model, 80,000 steps, prompt near 620 tokens, never above 660.</td>
</tr>
<tr>
<td>About 100 to 1 input to output tokens in agent loops; the KV-cache hit rate is the key production metric. <a href="https://manus.im/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus">Manus, "Context Engineering for AI Agents: Lessons from Building Manus"</a></td>
<td>Conversation job: 39.9 million tokens with the chat kept, 0.53 million with AXI (76 times fewer). 4,000-request run: a step with the right state, replies applied as written, cost 4.5 times AXI's.</td>
</tr>
<tr>
<td>Across six generation tasks, performance falls 39 percent on average from single-turn to multi-turn. <a href="https://arxiv.org/abs/2505.06120">Laban, Hayashi, Zhou and Neville, arXiv 2505.06120</a></td>
<td>A different task: a state edited step by step. Applied as it comes, the long job's state was exact until turn 286 and wrong from 287. With AXI: 1,500 of 1,500 steps on that job, 4,000 of 4,000 on the 4,000-step run, 80,000 of 80,000 on the 7B model.</td>
</tr>
<tr>
<td>Context rot: recall from the window declines as it grows; compaction and structured notes are the usual answers. <a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents">Anthropic, "Effective context engineering for AI agents", 29 Sep 2025</a></td>
<td>AXI is a third route: nothing is kept in the chat; the host holds the exact state and rebuilds a short prompt every step. The head-to-head with compaction is written and locked before its run (<a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/COMPACTION_TEST.md"><code>COMPACTION_TEST.md</code></a>); its result is not in yet.</td>
</tr>
</tbody></table>
<p>No company named here has reviewed or endorsed this work.</p>
<h2>Who made it, and what this is</h2>
<p>The architecture is by <strong>Rajnish Choubey</strong>. The tests were built and run by <strong>Shalendra Gaur</strong>, working with an AI coding assistant that is a tool, not an author. This is not affiliated with any model provider, and it has nothing to do with ARM's AMBA AXI bus.</p>
<p>AXI is a layer on the host side: the model is unchanged, and every claim on this page is about the state the host holds. Most runs here are one seed and one run per arm on synthetic service graphs; each linked page lists its own limits and what would count against AXI.</p>
<p>Other groups build commit boundaries around agent state too, with their own settings: Cordon (arXiv 2606.17573) and MemTX (arXiv 2607.23929). These systems have not been run against each other.</p>
<p><strong>Records and code.</strong></p>
<ul>
<li>Technical report: <a href="https://doi.org/10.5281/zenodo.24508592">10.5281/zenodo.24508592</a></li>
<li>White paper: <a href="https://doi.org/10.5281/zenodo.23958737">10.5281/zenodo.23958737</a></li>
<li>Repository: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a></li>
</ul>
<p>Issues are welcome. If a number here does not recompute, please say so there.</p>
<hr />
<p>This page is also in the repository as <a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/AXI_ONE_PAGE.md"><code>AXI_ONE_PAGE.md</code></a>.</p>
]]></content:encoded></item><item><title><![CDATA[Google's developer blog on agent context cost, and AXI's measured host-side fix: 169x fewer tokens a step (Gemini 3.8 Flash)]]></title><description><![CDATA[In December 2025 the Google Developers Blog described what happens in production agent systems: cost and time to first token climb as the context grows…]]></description><link>https://axi-runtime.hashnode.dev/google-s-developer-blog-on-agent-context-cost-and-a-measured-host-side-fix-169x-fewer-tokens-a-step-gemini-3-8-flash</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/google-s-developer-blog-on-agent-context-cost-and-a-measured-host-side-fix-169x-fewer-tokens-a-step-gemini-3-8-flash</guid><category><![CDATA[llm]]></category><category><![CDATA[agents]]></category><category><![CDATA[context engineering]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Tue, 24 Nov 2026 17:40:20 GMT</pubDate><content:encoded><![CDATA[<p>In December 2025 the Google Developers Blog described what happens in production agent systems: cost and time to first token climb as the context grows, stale context hurts the model, and a bigger window does not remove the problem (<a href="https://developers.googleblog.com/architecting-efficient-context-aware-multi-agent-framework-for-production/">Hangfei Lin, "Architecting efficient context-aware multi-agent framework for production"</a>). A developer on the Google developer forums describes a session growing from about 2K to over 80K tokens in five turns, with latency, drift and cost following (<a href="https://discuss.google.dev/t/best-practices-for-handling-context-compaction-and-token-blowup-in-recursive-adk-agent-tool-loops/396215">ADK thread, September 2026</a>). The Gemini caching documentation explains the cost saving that implicit caching passes on; it gives no latency figure (<a href="https://ai.google.dev/gemini-api/docs/caching">Context caching</a>).</p>
<p>All of these are about a conversation that carries its own history. We measured the other way: do not carry it.</p>
<h2>The layer</h2>
<p>AXI, by <strong>Rajnish Choubey</strong>, is a layer on the host side, between a model and the state it edits. The model is unchanged. At every step it proposes one change; the host checks the proposal against the rules, completes what the rules can complete, commits it all or not at all, and shows the model the exact state again in a short prompt rebuilt from what the host holds. Nothing is kept in the chat.</p>
<h2>What was measured</h2>
<p>One long, heavy job on Gemini 3.8 Flash: a service graph edited request by request, 1,500 requests, each with about 40 lines of routine operations log. Once with the whole chat kept and sent again at every turn (until it reached the model's window: 457 turns, 949,591 tokens), once with AXI.</p>
<table>
<thead>
<tr>
<th></th>
<th>Chat kept</th>
<th>AXI</th>
</tr>
</thead>
<tbody><tr>
<td>Prompt tokens per step</td>
<td>476,835 on average</td>
<td>2,824, flat for all 1,500 steps (169 times fewer)</td>
</tr>
<tr>
<td>Tokens sent in all</td>
<td>217.5 million in 457 turns</td>
<td>4.6 million in 1,500 steps</td>
</tr>
<tr>
<td>First token, median</td>
<td>9.13 s once the prompt passes 500,000 tokens</td>
<td>2.27 s, flat (2.15 to 2.35 s in every tenth)</td>
</tr>
<tr>
<td>Seconds a step</td>
<td>7.13 on average</td>
<td>3.07</td>
</tr>
<tr>
<td>State if each reply is applied as it comes</td>
<td>exact until turn 286, wrong on every turn after</td>
<td>exact on 1,500 of 1,500 steps</td>
</tr>
<tr>
<td>Exact steps an hour</td>
<td>488</td>
<td>1,157</td>
</tr>
</tbody></table>
<p>On a second job, a 400-turn conversation in plain, ambiguous sentences, the same model sent 39.9 million tokens with the chat kept and 0.53 million with AXI (76 times fewer). Once the prompt passed 150,000 tokens the kept chat's first token took a median 5.57 s with 97.0 percent of its prompt served from the cache; AXI's stayed at 2.41 s.</p>
<p>And a different question, on the same model: 4,000 consecutive steps of a dense job with strict rules. The state the host held was exactly the intended state on 4,000 of 4,000 steps. The model's own replies were exactly right on 3,954; on the other 46 it had left out a service's dependants when asked to delete the service and an edge, and the fixed repair rule completed them. Applied as written, those replies would each have left edges pointing at a deleted service. On the first 400 requests the replies applied as written left the right state on 85 steps, and a step with the right state cost 4.5 times as much.</p>
<h2>Check it yourself, in seconds</h2>
<p>No key, no model, no GPU:</p>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
python3 quickstart_replay.py
</code></pre>
<p>It replays the saved real replies of the 4,000-step run through the repository's own code and recomputes the held state at every step; it stops with an error if one replayed step differs from the saved one. Prefer a browser: there is a <a href="https://colab.research.google.com/github/gaurshalendra2412/axi-runtime/blob/main/python/colab/axi_try_it.ipynb">one-click Colab notebook</a>. With your own Gemini key (a free one is enough) <code>python3 live_check.py</code> runs the same harness live for 15 steps.</p>
<h2>Scope</h2>
<p>These are one job and one run of each arm on one model, and every claim is about the state the host holds, not about the model in general or anyone's servers. A reply that is readable, inside the request's scope and wrong is applied; the gate and the repair keep what is true and cut what is false. This is not affiliated with Google.</p>
<p>Other groups build commit boundaries around agent state with their own settings and evaluations: <a href="https://arxiv.org/abs/2606.17573">Cordon</a> and <a href="https://arxiv.org/abs/2607.23929">MemTX</a>. The repository's related-work page says the idea of a commit boundary is not ours to claim.</p>
<h2>Where to read more</h2>
<ul>
<li><a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/FOR_ENGINEERS.md">For engineers: the bottlenecks people publish, next to what was measured</a></li>
<li><a href="https://doi.org/10.5281/zenodo.24508592">Technical report, six pages, with a DOI (Zenodo): 10.5281/zenodo.24508592</a></li>
<li><a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/MILLION_TOKEN_TEST_HARD.md">The 4,000-step page, written before the run</a></li>
<li><a href="https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/GEMINI_LONG_TEST.md">The long-job page</a></li>
<li><a href="https://github.com/gaurshalendra2412/axi-runtime">Repository</a></li>
</ul>
<p>Tests built and run by Shalendra Gaur, with an AI coding assistant as a tool (disclosed in the README).</p>
<p>First published on <a href="http://dev.to">dev.to</a>: <a href="https://dev.to/shalendra_gaur_ecd0567a49/googles-developer-blog-on-agent-context-cost-and-a-measured-host-side-fix-169x-fewer-tokens-a-4phb">https://dev.to/shalendra_gaur_ecd0567a49/googles-developer-blog-on-agent-context-cost-and-a-measured-host-side-fix-169x-fewer-tokens-a-4phb</a></p>
]]></content:encoded></item><item><title><![CDATA[How many LLM agent sessions can one GPU serve? AXI measured: 8 to 256 sessions on one NVIDIA L4, every step exact]]></title><description><![CDATA[256 agent sessions on one NVIDIA L4 with a 7B model: every step exact, 105,230 exact steps per GPU hour at 2.458 J. The card filled near 128.]]></description><link>https://axi-runtime.hashnode.dev/how-many-llm-agent-sessions-can-one-gpu-serve-measured-8-to-256-sessions-on-one-nvidia-l4-every-step-exact</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/how-many-llm-agent-sessions-can-one-gpu-serve-measured-8-to-256-sessions-on-one-nvidia-l4-every-step-exact</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[GPU]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:58:44 GMT</pubDate><content:encoded><![CDATA[<p><strong>Concurrent LLM agent sessions per GPU depend on how much prompt each session sends and how much KV cache it holds. If the host holds the state and shows the model only the exact state, each session's prompt stays the size of the state and does not grow with the steps, so many sessions fit in one cache. Measured on one NVIDIA L4 with a 7B model: 256 sessions at once, 25,557 of 25,557 steps with the host's state exactly right, 105,230 exact steps per GPU hour, 2.458 joules per exact step. The card was full at about 128 sessions.</strong></p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>What limits the number of agent sessions on a GPU?</h2>
<p>For multi-turn agents, GPU memory for the KV cache is usually the first limit, and prefill work is the second. A session that keeps its whole chat holds a longer cache and sends a longer prompt every step. A session whose host holds the state sends a prompt the size of the state, so the cache per session is small and does not grow with the number of steps. In the 20,000-step runs on the same 7B model (Test 43) the prompt stayed near 620 tokens a step and never passed 660. In the session test below the cache was set to 160,000 tokens so that all 256 sessions' prefixes could be held, and the cache share stayed near 71 percent from 8 to 256 sessions, so they were.</p>
<h2>What was measured?</h2>
<p>Test 38: Qwen2.5-7B-Instruct (AWQ 4-bit) on vLLM 0.31.0, one NVIDIA L4 on Colab, prefix caching on, greedy decoding, no retry, 100 steps a session, all sessions advancing in lock-step rounds.</p>
<table>
<thead>
<tr>
<th>Sessions at once</th>
<th>Steps</th>
<th>Steps with the host's state exactly right</th>
<th>Exact steps per GPU hour</th>
<th>Median round (every session gets one step)</th>
<th>Cache share of prompt tokens</th>
<th>Joules per exact step</th>
</tr>
</thead>
<tbody><tr>
<td>8</td>
<td>800</td>
<td>800 (100.0 %)</td>
<td>51,134</td>
<td>0.57 s</td>
<td>69.7 %</td>
<td>5.035</td>
</tr>
<tr>
<td>32</td>
<td>3,200</td>
<td>3,200 (100.0 %)</td>
<td>88,635</td>
<td>1.28 s</td>
<td>71.1 %</td>
<td>2.923</td>
</tr>
<tr>
<td>128</td>
<td>12,800</td>
<td>12,800 (100.0 %)</td>
<td>105,043</td>
<td>4.27 s</td>
<td>71.5 %</td>
<td>2.464</td>
</tr>
<tr>
<td>256</td>
<td>25,557</td>
<td>25,557 (100.0 %)</td>
<td>105,230</td>
<td>8.49 s</td>
<td>71.5 %</td>
<td>2.458</td>
</tr>
</tbody></table>
<p>Zero corrupted steps in every cell. Computed prompt tokens per step were 94 to 105 at every size. (The cell of 256 holds 25,557 steps, not 25,600, because one job's script had 57 steps.)</p>
<h2>What does that say about sessions per GPU?</h2>
<ul>
<li><strong>Exactness held at every size.</strong> The host's state was exactly right on every step up to 256 sessions on one card.</li>
<li><strong>Throughput rose, then stopped.</strong> Exact steps per hour went up 1.73 times from 8 to 32 sessions and 1.19 times from 32 to 128, and did not rise from 128 to 256 (1.002 times). On this card with this model and engine the chip was full at about 128 sessions; past that every session waits longer without the chip doing more. The test also read NO on one of its own predictions (at least 1.5 times from 32 to 256: measured 1.19 times), and the page prints it as NO.</li>
<li><strong>Energy per exact step fell</strong> from 5.035 joules at 8 sessions to 2.458 joules at 256, as the card filled.</li>
<li><strong>The cache held every session's prefix.</strong> The cache share stayed near 71 percent from 8 to 256 sessions.</li>
</ul>
<h2>What does a step cost in energy against other ways of remembering?</h2>
<p>On a 14B model (Test 44), six ways of keeping context all ended with the exact state once the host's check was in the loop. A step took 0.30 s and 21.8 joules with the exact state shown; 0.55 to 0.66 s and 39.4 to 48.0 joules with summaries, a sliding window or retrieval; the whole chat sent 8,228.8 prompt tokens a step against 413.7 for the exact state.</p>
<h2>What is not shown?</h2>
<p>Arrivals at random times (these rounds are lock-step), other cards, models bigger or smaller than 7B (a ladder of 11 open models, 1.5B to 32B, is in the repository), and sessions longer than 100 steps in this test (separate 20,000-step jobs are reported in Test 43). The flat line from 128 to 256 is this card's limit with this engine and setting, not a statement about the framework.</p>
<h2>Check it</h2>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
python3 quickstart_replay.py
</code></pre>
<p>That replays the saved replies of the 4,000-request Gemini run (no key, no GPU). The Test 38 page, with its predictions written before the run and its result below a line, is <code>docs/SESSIONS_PER_CHIP_TEST.md</code> in the repository: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. White paper: <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a>. Ten open-model tests: <a href="https://doi.org/10.5281/zenodo.24319561">doi.org/10.5281/zenodo.24319561</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item><item><title><![CDATA[Host-held state for LLM agents: five questions to ask LangGraph, Letta, smolagents, PydanticAI and AXI, with measured answers]]></title><description><![CDATA[Five design questions that decide whether an agent's state stays right, with how AXI answers them and how to measure each in any framework.]]></description><link>https://axi-runtime.hashnode.dev/host-held-state-for-llm-agents-five-questions-to-ask-langgraph-letta-smolagents-pydanticai-and-axi-with-measured-answers</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/host-held-state-for-llm-agents-five-questions-to-ask-langgraph-letta-smolagents-pydanticai-and-axi-with-measured-answers</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[architecture]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:56:38 GMT</pubDate><content:encoded><![CDATA[<p><strong>Host-held state means the application, not the chat history, is the source of truth for what an agent has done. Several frameworks keep state on the host in some form. What decides whether the state stays right over many steps is five design questions. Below are those questions, how the AXI host-side runtime answers each one, and how to measure the same thing in any framework.</strong></p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>What is host-held state, and which frameworks have it?</h2>
<p>Frameworks such as LangGraph (typed state with checkpointers), Letta (formerly MemGPT, host-managed memory), PydanticAI (typed dependencies and validated outputs) and smolagents (code agents whose variables persist in a host-side interpreter) all keep some agent state outside the message list. They are general tools, and each lets you build different things on top. AXI is one specific design with one purpose: keep an edited state exactly right while a model proposes changes to it, and it reports measured results for that. It can sit beside or under those frameworks.</p>
<h2>The five questions</h2>
<table>
<thead>
<tr>
<th>#</th>
<th>Question to ask of any design</th>
<th>How AXI answers it</th>
<th>How to measure it in any framework</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>Who may change the state?</td>
<td>Only the host. The model proposes one change at a time in a short fixed format.</td>
<td>Count steps where the model's output touched state without passing a check.</td>
</tr>
<tr>
<td>2</td>
<td>What happens to a change that breaks a rule?</td>
<td>It is refused with a typed reason, and the state is left untouched.</td>
<td>Inject known-bad proposals, count how many reach the state.</td>
</tr>
<tr>
<td>3</td>
<td>What happens to a change that is almost right?</td>
<td>The host completes what the rules can complete (deleting a service also removes its edges) and then commits.</td>
<td>Take the model's real slips, count how many a fixed rule repairs.</td>
</tr>
<tr>
<td>4</td>
<td>Can a change half-apply?</td>
<td>No. A change commits all or nothing.</td>
<td>Kill the process mid-commit, audit the state.</td>
</tr>
<tr>
<td>5</td>
<td>What does the model see next?</td>
<td>The exact state, not the history.</td>
<td>Log the prompt size at step 1 and at step 10,000.</td>
</tr>
</tbody></table>
<h2>What did those answers measure?</h2>
<ul>
<li><strong>Question 3, completion.</strong> Gemini 3.8 Flash, 4,000 requests: the model's replies were right 3,954 times (98.85 percent). All 46 slips were of one kind, a delete that left out the service's other connections. A fixed rule completed all 46. A gate that only refuses (question 2 without 3) kept the state well formed but exactly right on only 84 of 400 steps; with the completion it was 400 of 400.</li>
<li><strong>Question 1 and 2, the check.</strong> 10,000,000 proposals against the Python reference model on a CPU, 1,401,041 of them injection attempts: none of the injection proposals committed, and the held state matched an independent reference at every comparison. That run also found four things to harden (listed on the test page).</li>
<li><strong>Question 5, the prompt.</strong> The prompt stayed near 620 tokens and never above 660 over four jobs of 20,000 steps on a 7B model, with the state exactly right on 80,000 of 80,000 steps. A kept chat of the same job grew until it hit the window.</li>
<li><strong>Across models.</strong> The host's state was exactly right in the main cell of 10 of 11 open models, from 1.5B to 32B, with 0 corrupted steps in every cell. The eleventh, a DeepSeek-R1 distill, ran every reply to a delete to the 96-token cap; the host dropped those replies, so its state stayed well formed but fell behind (1.53 percent exact).</li>
<li><strong>Other kinds of state.</strong> A table, a schedule, source code and tool calls, on a 7B and a 14B: with the world's own rule check, the held state broke no rule on 3,600 steps.</li>
</ul>
<h2>What does this not claim?</h2>
<p>The check can only enforce rules that are written down. It decides whether a change is legal, not whether it was the right change. The measured work uses synthetic service graphs and four small synthetic worlds.</p>
<h2>Run it</h2>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
python3 quickstart_replay.py
</code></pre>
<p>No key, no GPU. It replays the saved replies of the 4,000-request run and prints 4,000 of 4,000, 3,954 of 4,000, 85 of 400 and 4.5 times. Test pages: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. White paper: <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a>. Ten open-model tests: <a href="https://doi.org/10.5281/zenodo.24319561">doi.org/10.5281/zenodo.24319561</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item><item><title><![CDATA[Why LLM latency grows with conversation length, and AXI's fix: a flat 0.1605 s to 0.1651 s step over 20,000 steps]]></title><description><![CDATA[Kept chat: first token 5.57 s past 150k tokens. Host-held state: 2.41 s flat, and a 0.1605-0.1651 s step over 20,000 steps on a 7B model.]]></description><link>https://axi-runtime.hashnode.dev/why-llm-latency-grows-with-conversation-length-and-the-measured-fix-a-flat-0-1605-s-to-0-1651-s-step-over-20-000-steps</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/why-llm-latency-grows-with-conversation-length-and-the-measured-fix-a-flat-0-1605-s-to-0-1651-s-step-over-20-000-steps</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:54:52 GMT</pubDate><content:encoded><![CDATA[<p><strong>LLM latency grows with conversation length because the prompt the model must read grows with it. If the host holds the state and shows the model the exact state instead of the history, the prompt stays the size of the state and the step time stays flat. Measured: a step took 0.1605 s early and 0.1651 s late (+2.8 percent) over 20,000 steps on a 7B model, with the prompt near 620 tokens throughout.</strong></p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>Why does latency rise as a conversation gets longer?</h2>
<p>Before the first output token the model reads the prompt. A kept chat makes the prompt longer every turn, so the time to the first token rises with it, and every later token is generated against a longer context. A cache removes part of the reading cost, not all of it, and a chat that outgrows the context window simply stops.</p>
<h2>What does that look like in numbers?</h2>
<p>Gemini 3.8 Flash, 400 turns of ambiguous text (Test 23), chat kept against a host-held state:</p>
<table>
<thead>
<tr>
<th></th>
<th>Chat kept</th>
<th>Host-held state</th>
</tr>
</thead>
<tbody><tr>
<td>Median first token, first 50 turns</td>
<td>1.86 s</td>
<td>about 2.4 s, flat (2.2 to 2.8 s in every tenth of the job)</td>
</tr>
<tr>
<td>Median first token, once the prompt passes 150,000 tokens</td>
<td>5.57 s</td>
<td>2.41 s (2.31 times lower)</td>
</tr>
<tr>
<td>Seconds a step at that prompt size</td>
<td>5.70</td>
<td>2.76 (2.07 times faster)</td>
</tr>
<tr>
<td>95th percentile first token</td>
<td>7.4 s</td>
<td>3.8 s</td>
</tr>
</tbody></table>
<p>On a long job with heavy turns (Test 22), the kept chat's first token went from 2.2 s in the first band to 9.1 s over all turns past 500,000 tokens; with the host holding the state it stayed at 2.3 s.</p>
<h2>Is it the same on open models?</h2>
<p>Open models on vLLM 0.31.0, one NVIDIA L4, greedy decoding:</p>
<ul>
<li><strong>Test 43, endurance, a 7B model:</strong> four jobs of 20,000 steps, 80,000 of 80,000 steps with the host's state exactly right. The prompt stayed near 620 tokens and never passed 660. A step took 0.1605 s early and 0.1651 s late.</li>
<li><strong>Test 42, how long a kept chat lasts:</strong> in a 131,072-token window the kept chat slowed from 0.35 s to 1.36 s a step and ended after 337 steps at the window's limit; in a 32,768-token window it ended after 108 to 235 steps. The exact-state jobs ran 1,500 of 1,500 steps at a flat 0.28 to 0.31 s.</li>
<li><strong>Gemini, 4,000 steps in a row:</strong> the prompt grew 1.16 times from the first tenth of the run to the last, and the step speed did not fall (0.94 times).</li>
</ul>
<h2>What about prefix caching (KV cache reuse) and context compaction?</h2>
<p>Both are standard answers, and both are worth switching on. They are measured here too, so you can see what each one leaves.</p>
<ul>
<li><strong>Prefix caching.</strong> In the Gemini runs the service served 97 percent of the kept chat's prompt tokens from its cache, and the median first token was still 5.57 s against 2.41 s once the prompt passed 150,000 tokens. Counted after the cache, the kept chat computed 2.3 times (Test 23) and 1.7 times (Test 22, past 500,000 tokens) as many tokens per exact step. On 11 open models with vLLM prefix caching on, the kept chat computed 1.24 to 4.11 times the prompt tokens per step.</li>
<li><strong>Summaries, a sliding window, retrieval.</strong> On a 14B model (Test 44), six ways of keeping context all ended with the exact state once the host's check was in the loop. The step cost differed: 0.30 s and 21.8 joules with the exact state shown; 0.55 to 0.66 s and 39.4 to 48.0 joules with summaries, a window or retrieval; the whole chat sent 8,228.8 prompt tokens a step against 413.7 for the exact state.</li>
</ul>
<p>Caching and compaction make the history cheaper to carry. A host-held state does not carry the history at all, so the two can be used together, and neither changes whether the state is exactly right.</p>
<h2>When is the kept chat actually faster?</h2>
<p>At a short prompt. In Test 23 the kept chat was the faster arm in the first 50 turns (1,609 exact steps an hour against 1,129). The crossover came past turn 120, at about 70,000 prompt tokens. Over all 400 turns the host-held state made 1.33 times the exact steps an hour. If your jobs never get past a few thousand tokens, latency is not the reason to move state to the host; exactness and cost per correct step are.</p>
<h2>What is the fix, in one sentence?</h2>
<p>Do not let the prompt grow with the job: hold the state on the host, check every change the model proposes, commit it all or not at all, and show the model the exact state again each step.</p>
<h2>Check the numbers</h2>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
python3 quickstart_replay.py
</code></pre>
<p>That replays the saved replies of the 4,000-request run (no key, no GPU). The test pages for Tests 22, 23, 42 and 43 hold the rules written before each run and the saved results.</p>
<h2>Scope</h2>
<p>Latency on Gemini is as the API served it, including network time. Open-model times are one NVIDIA L4 on Colab, vLLM 0.31.0, greedy decoding, no retry, synthetic service graphs. Claims are about the state the host holds. Test pages: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. White paper: <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item><item><title><![CDATA[LLM agent token cost: a kept chat grows with the square of the steps, AXI's held state stays flat (prompt caching counted)]]></title><description><![CDATA[A kept chat resends everything each step. Measured on Gemini 3.8 Flash: 85x fewer prompt tokens a step, 4.5x lower cost per right step.]]></description><link>https://axi-runtime.hashnode.dev/llm-agent-token-cost-why-a-kept-chat-grows-with-the-square-of-the-steps-and-the-measured-fix-prompt-caching-counted</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/llm-agent-token-cost-why-a-kept-chat-grows-with-the-square-of-the-steps-and-the-measured-fix-prompt-caching-counted</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:52:25 GMT</pubDate><content:encoded><![CDATA[<p><strong>An agent that keeps its whole chat resends everything on every step, so the tokens it sends grow with the square of the number of steps. Holding the state on the host and showing the model the exact state keeps the prompt the size of the state. Measured on Gemini 3.8 Flash: 85 times fewer prompt tokens a step and 76 times fewer in all over 400 turns, and 4.5 times lower cost per step that ends with the right state.</strong></p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>Why does the token bill of a chat-based agent grow so fast?</h2>
<p>If step t sends a prompt of a + b·t tokens (the fixed part plus everything said so far), n steps send n·a + b·n(n+1)/2 tokens in all. The second term grows with n squared: twice the turns, about four times the tokens, at the growth rate measured in Test 23. A host that holds the state sends a prompt the size of the state, so n steps send about n times that size: a straight line.</p>
<h2>How many tokens does that make, measured?</h2>
<p>All runs: Gemini 3.8 Flash, each job run once with the chat kept and once with the host holding the state.</p>
<table>
<thead>
<tr>
<th>Job</th>
<th>Prompt tokens a step, chat kept</th>
<th>With a host-held state</th>
<th>Tokens sent in all</th>
</tr>
</thead>
<tbody><tr>
<td>400 turns of plain, ambiguous sentences (Test 23)</td>
<td>99,809 on average</td>
<td>1,177 (85 times fewer)</td>
<td>39.9 million against 0.53 million (76 times fewer)</td>
</tr>
<tr>
<td>Long job with heavy turns (Test 22)</td>
<td>476,835 on average, up to 949,591</td>
<td>2,824 (169 times fewer)</td>
<td>217.5 million (457 turns) against 4.6 million (1,500 steps)</td>
</tr>
<tr>
<td>Four ARC-AGI-3 games (Test 24)</td>
<td>n/a</td>
<td>n/a</td>
<td>25.7 million against 1.95 million (13.2 times fewer)</td>
</tr>
</tbody></table>
<h2>Doesn't prompt caching fix this?</h2>
<p>Caching is the first thing to switch on, and it helps: the service served 97 percent of the kept chat's prompt tokens from its cache. But sent tokens and computed tokens are different bills, so here are both.</p>
<ul>
<li><strong>Computed tokens per exact step</strong>, counted after the cache: the kept chat needed 2.3 times as many in Test 23 (whole job) and 1.7 times as many in Test 22 past 500,000 tokens. Caching narrows the gap from 85 times to about 2 times. It does not close it.</li>
<li><strong>Open models with prefix caching switched on</strong> (vLLM, one NVIDIA L4): the kept chat computed 1.24 to 4.11 times the prompt tokens per step across 11 models, and on a like-for-like 7B pair 1.78 times the tokens and 1.51 times the seconds per step.</li>
<li><strong>Caching does nothing for exactness.</strong> A cached wrong state is still a wrong state, and that is where most of the cost sits (next section).</li>
</ul>
<h2>What does a correct step cost?</h2>
<p>Cost per token hides the real unit. Over the first 400 requests of a 4,000-request Gemini run, at $0.75 in and $3.75 out per million tokens with thinking counted as output:</p>
<table>
<thead>
<tr>
<th>Way of using the model's replies</th>
<th>Steps with the right state (of 400)</th>
<th>Spent</th>
<th>Cost of one step with the right state</th>
</tr>
</thead>
<tbody><tr>
<td>Host layer: check, complete, commit</td>
<td>400</td>
<td>$0.47</td>
<td>$0.0012</td>
</tr>
<tr>
<td>Replies applied as written</td>
<td>85</td>
<td>$0.45</td>
<td>$0.0052 (4.5 times as much)</td>
</tr>
<tr>
<td>A gate that only refuses bad replies</td>
<td>84</td>
<td>$0.48</td>
<td>$0.0057 (4.9 times as much)</td>
</tr>
</tbody></table>
<p>The spend was about the same. What differed was how many steps ended with the right state.</p>
<h2>What about energy and capacity?</h2>
<p>On a 14B model (Test 44), a step cost 21.8 joules with the exact state shown and 39.4 to 48.0 joules with summaries, a window or retrieval; the whole chat sent 8,228.8 prompt tokens a step against 413.7 for the exact state. On one NVIDIA L4 with a 7B model (Test 38), 256 sessions ran with every step exact: 105,230 exact steps per GPU hour at 2.458 joules per exact step.</p>
<h2>Check the figures yourself</h2>
<p>No key, no GPU. This replays the saved replies of the 4,000-request run with the repository's own code and prints the 4,000, 3,954, 85 and 4.5 times figures:</p>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
python3 quickstart_replay.py
</code></pre>
<h2>Scope</h2>
<p>Gemini 3.8 Flash for the sent-token figures; open models on vLLM 0.31.0 and one NVIDIA L4, greedy decoding, no retry; synthetic service graphs; the cost rows are arithmetic added after the results, from the saved runs, not a pre-registered line. Whether the bill follows sent or computed tokens depends on how a company prices cached tokens; the repository does not price them. Joules are the card's board power read during the run. Test pages: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. White paper: <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item><item><title><![CDATA[AI agent drift: what it is, how to measure it, and how AXI held 4,000 of 4,000 steps exact]]></title><description><![CDATA[Agent drift is the gap between held and true state. Replies applied as written left it exact on 21% of steps; a host-side check held 4,000 of 4,000.]]></description><link>https://axi-runtime.hashnode.dev/ai-agent-drift-what-it-is-how-to-measure-it-and-the-host-side-fix-that-held-4-000-of-4-000-steps</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/ai-agent-drift-what-it-is-how-to-measure-it-and-the-host-side-fix-that-held-4-000-of-4-000-steps</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:50:34 GMT</pubDate><content:encoded><![CDATA[<p><strong>AI agent drift is the distance between the state a system holds and the true state. It grows when a model's small slips are applied as they come and stay in the state. Drift can be measured, and a host-side layer that checks every change before it is committed held distance 0 on 4,000 of 4,000 steps in a measured run.</strong></p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>What is agent drift, and is it the same as hallucination?</h2>
<p>Hallucination is one wrong reply. Drift is what a wrong reply leaves behind. A model invents or misreads something at step 40, the system applies it, and every later step builds on a state that is no longer true. So drift has two parts: how often the model slips, and how long a slip stays in the state.</p>
<p>In this work drift is a number: <strong>distance = how many items of the held state differ from the true state</strong>, counted at every step. Distance 0 means the held state is exactly right.</p>
<h2>How often do strong models slip?</h2>
<p>Gemini 3.8 Flash, one run of 4,000 requests in a row (editing a service graph of 17 to 22 services), 3.7 million tokens:</p>
<table>
<thead>
<tr>
<th>What was counted</th>
<th>Result</th>
</tr>
</thead>
<tbody><tr>
<td>Replies that were exactly the ideal reply</td>
<td>3,954 of 4,000 (98.85 percent)</td>
</tr>
<tr>
<td>Slips</td>
<td>46 of 4,000, all of one kind: asked to delete a service and also an edge, the reply left out the service's other connections</td>
</tr>
<tr>
<td>Replies applied as written, first 400 requests: state exactly right</td>
<td>85 of 400 (21 percent)</td>
</tr>
<tr>
<td>Replies applied as written: state corrupted</td>
<td>223 of 400 (56 percent)</td>
</tr>
<tr>
<td>With the host layer (check, complete, commit all or nothing): state exactly right</td>
<td>4,000 of 4,000, never corrupted</td>
</tr>
</tbody></table>
<p>A 98.85 percent reply rate sounds safe. It is not, because the damage is in how long a slip stays.</p>
<h2>Why does a 98.85 percent model leave the state right on only 21 percent of steps?</h2>
<p>Arithmetic. If each reply is right with probability p = 0.9885, the chance of 400 replies in a row with no slip is 0.9885^400, about 1 percent. The first slip is expected around step 87 (1 / (1 − 0.9885)). After a slip, the state stays wrong until something overwrites the damaged part. Measured stretches were 36 to 150 steps. Slips arrive faster than the state heals, so the share of steps with the right state falls far below the share of replies that were right. The run measured 21 percent.</p>
<p>That is the model plus the loop around it, not a property of this one model: on a 7B open model, replies applied as written corrupted the state in 12 of 12 episodes.</p>
<h2>What fixes it?</h2>
<p>Put the check on the host side, around the model, and leave the model unchanged. Each step:</p>
<ol>
<li>The model proposes one change in a short fixed format.</li>
<li>The host checks it against the rules of the state.</li>
<li>The host completes what the rules can complete (for example, deleting a service also removes its edges).</li>
<li>The host commits the whole change or none of it.</li>
<li>The model is shown the exact state again.</li>
</ol>
<p>A gate that only refuses bad replies is not enough: it kept the state well formed but exactly right on only 84 of 400 steps. The completion step is what removed all 46 slips.</p>
<p>In common engineering words this is validation, repair, and an atomic commit with a held source of truth. The measured part is that it held distance 0 on 4,000 of 4,000 steps, and 80,000 of 80,000 steps on a 7B open model (four jobs of 20,000 steps).</p>
<h2>Does a kept chat drift too?</h2>
<p>On ambiguous text over 400 turns, the kept chat was exact on 398 of 400 replies and none was corrupted, but one wrong change at turn 191 stayed in the state for 140 turns (turns 191 to 330) because a chat has no check against the truth. With the host holding the state: exact on 400 of 400.</p>
<h2>Run it yourself in a few seconds</h2>
<p>No key, no GPU: the saved replies of the 4,000-request run are replayed with the repository's own code.</p>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
python3 quickstart_replay.py
</code></pre>
<p>It prints 4,000 of 4,000, 3,954 of 4,000, 85 of 400 and the 4.5 times cost figure, and says whether they match the published ones.</p>
<h2>Scope</h2>
<p>One model, one job, one sampled run for the 4,000-step figures; open-model runs on vLLM 0.31.0 and one NVIDIA L4 (greedy decoding, no retry). Synthetic service graphs. Claims are about the state the host holds, not the model's own replies. Test pages with the rules written before each run: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. White paper: <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item><item><title><![CDATA[AXI by Rajnish Choubey: a host-side layer that keeps LLM-edited state exact. Questions, answers and measured evidence]]></title><description><![CDATA[AXI host-side runtime for LLM agents by Rajnish Choubey: measured answers on drift, token cost, latency, GPU sessions, injection, model size.]]></description><link>https://axi-runtime.hashnode.dev/axi-by-rajnish-choubey-a-host-side-layer-that-keeps-llm-edited-state-exact-questions-answers-and-measured-evidence</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/axi-by-rajnish-choubey-a-host-side-layer-that-keeps-llm-edited-state-exact-questions-answers-and-measured-evidence</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[architecture]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:47:36 GMT</pubDate><content:encoded><![CDATA[<p><strong>AXI is a layer on the host side, between a language model and the state it edits. The model is unchanged. It is for the company that runs the model, not for end users, and it fits any LLM application that holds state: agents, chat, workflows, short jobs and long ones. It proposes one change at a time; AXI checks the change against the rules, completes what the rules can complete, commits it all or not at all, and shows the model the exact state again. The architecture is by Rajnish Choubey; the tests and measurements were built and run by Shalendra Gaur.</strong></p>
<p><em>Naming note: this AXI is a host-side runtime for LLM agents. It is not the ARM AMBA AXI chip-bus protocol. Search for "AXI host-side runtime LLM agents" or "Rajnish Choubey AXI".</em></p>
<h2>What problems does it answer, and what was measured?</h2>
<p>Every figure is measured, scoped on its test page, and recomputable from saved files.</p>
<table>
<thead>
<tr>
<th>Question</th>
<th>Short answer, measured</th>
<th>Test</th>
</tr>
</thead>
<tbody><tr>
<td>How do I stop an AI agent from drifting (holding a state that is no longer the true state)?</td>
<td>Host's state exactly right on 4,000 of 4,000 steps (Gemini 3.8 Flash) and 80,000 of 80,000 steps (7B open model). Replies applied as written: right on 85 of 400 steps (21 percent).</td>
<td>Hard run, Test 43</td>
</tr>
<tr>
<td>Why is my agent's token cost so high?</td>
<td>A kept chat sent 85 times the prompt tokens a step (99,809 against 1,177) and 76 times the tokens in all (39.9 million against 0.53 million) over 400 turns.</td>
<td>Test 23</td>
</tr>
<tr>
<td>Does prompt caching solve it?</td>
<td>It narrows it. Counted after the cache, the kept chat needed 2.3 and 1.7 times the computed tokens per exact step; on 11 open models with prefix caching, 1.24 to 4.11 times.</td>
<td>Tests 22, 23, 35, 37, 41, 42</td>
</tr>
<tr>
<td>Why does latency grow with conversation length?</td>
<td>Median first token 5.57 s against 2.41 s flat once the prompt passes 150,000 tokens; a step 0.1605 s early and 0.1651 s late over 20,000 steps.</td>
<td>Tests 23, 43</td>
</tr>
<tr>
<td>What does a correct step cost?</td>
<td>$0.0012 with AXI against $0.0052 for replies applied as written (4.5 times) and $0.0057 for a gate that only refuses (4.9 times).</td>
<td>Hard run, first 400 requests</td>
</tr>
<tr>
<td>How many agent sessions does one GPU carry?</td>
<td>256 sessions on one NVIDIA L4, every step exact: 105,230 exact steps per GPU hour at 2.458 joules per exact step.</td>
<td>Test 38</td>
</tr>
<tr>
<td>What about hostile or injected input?</td>
<td>10,000,000 proposals, 1,401,041 injection attempts: none committed. The run also found four things to harden.</td>
<td>Test 39</td>
</tr>
<tr>
<td>What happens when the state gets big?</td>
<td>At 20,001 items the whole state is 378,399 characters; the focused view shown to the model stayed at a median of 207 to 323 characters.</td>
<td>Test 40</td>
</tr>
<tr>
<td>Does it work on other models?</td>
<td>Exactly right in the main cell of 10 of 11 open models (1.5B to 32B), 0 corrupted steps in every cell. The eleventh, a DeepSeek-R1 distill, ran its delete replies to the token cap and fell behind (1.53 percent exact).</td>
<td>Tests 35, 37, 41</td>
</tr>
<tr>
<td>Other kinds of state?</td>
<td>A table, a schedule, source code and tool calls: with the world's own rule check, no rule broken on 3,600 steps.</td>
<td>Test 45</td>
</tr>
</tbody></table>
<h2>What is drift here?</h2>
<p>The distance between the state the system holds and the true state, counted at every step. Distance 0 is an exactly right state. A 98.85 percent reply rate left the state exactly right on only 21 percent of steps when replies were applied as written, because a slip stays in the state until something overwrites it. See the drift page for the arithmetic.</p>
<h2>How is it tested?</h2>
<p>Each test page was written before its run, with its reading lines and predictions, and its result goes below a line at the end. A result that read NO is printed as NO. Open-model runs use vLLM 0.31.0 on one NVIDIA L4, greedy decoding, no retry, synthetic service graphs.</p>
<h2>Run it</h2>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
python3 quickstart_replay.py
</code></pre>
<p>No key, no GPU. It replays the saved replies of the 4,000-request run and prints 4,000 of 4,000, 3,954 of 4,000, 85 of 400 and 4.5 times (the cost of a step with the right state with replies applied as written, against AXI).</p>
<h2>Where to read more</h2>
<ul>
<li>Code, tests and saved results: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a></li>
<li>White paper, "AXI: The Cure for the Cost Crisis in AI": <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a></li>
<li>Ten open-model tests, "AXI for Model Hosts": <a href="https://doi.org/10.5281/zenodo.24319561">doi.org/10.5281/zenodo.24319561</a></li>
</ul>
<h2>Scope</h2>
<p>A host-side layer; the model is unchanged and every claim is about the state the host holds. Synthetic service graphs and four small synthetic worlds. The repository holds the host side in Python, the tests and the saved results; the deeper work of the architecture is Rajnish Choubey's and is not in it.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item><item><title><![CDATA[Prompt injection and LLM agent state: AXI's gate committed 0 of 1,401,041 injection proposals (10 million tested)]]></title><description><![CDATA[10 million proposals incl. 1,401,041 injection texts hit a host's gate: none of the injections committed, 0 state mismatches. Four fixes found.]]></description><link>https://axi-runtime.hashnode.dev/prompt-injection-and-llm-agent-state-0-of-1-401-041-injection-proposals-committed-at-the-host-s-gate-10-million-tested</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/prompt-injection-and-llm-agent-state-0-of-1-401-041-injection-proposals-committed-at-the-host-s-gate-10-million-tested</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[Security]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:45:19 GMT</pubDate><content:encoded><![CDATA[<p><strong>Prompt-injection text can change what a model writes, but it cannot change the state the host holds unless it passes the host's front door: a strict parse, a rule check, then an all-or-nothing commit. Measured on the Python reference model of the host-side layer (a CPU run, no model called): 10,000,000 hostile and random proposals went in, 1,401,041 of them injection text. None of the 1,401,041 injection proposals committed, and the graph the host held matched an independent reference at every comparison (0 state mismatches). The same run found four things to harden, listed below.</strong></p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>Why test an agent's state layer with hostile text?</h2>
<p>An agent that edits state (a service graph, a table, a schedule, code) turns text into changes. If the text is hostile, the question for a safety team is not "will the model be fooled" but "what can reach the state". In this design the model never writes the state: it proposes one change, and the host decides. So the host's front door was hit directly, with text a hijacked model could emit, and compared with a second, independent implementation on every proposal.</p>
<h2>What was thrown at the front door?</h2>
<p>100 fresh runtimes, 100,000 proposals each, 14 families in fixed shares:</p>
<table>
<thead>
<tr>
<th>Family</th>
<th>What it is</th>
<th>Share</th>
</tr>
</thead>
<tbody><tr>
<td>Legal edits</td>
<td>built from the live state, keeps the graph evolving</td>
<td>20 %</td>
</tr>
<tr>
<td>Mutated</td>
<td>a legal proposal with bytes flipped, deleted, inserted, swapped, spliced or cut</td>
<td>15 %</td>
</tr>
<tr>
<td>Random bytes and Unicode</td>
<td>0 to 200 random bytes, random text</td>
<td>8 %</td>
</tr>
<tr>
<td>Token soup</td>
<td>random items of the grammar's alphabet</td>
<td>8 %</td>
</tr>
<tr>
<td>Injection alone</td>
<td>about 60 strings: "ignore earlier rules", role markers, chat-template tokens, fake state blocks, tool-call JSON, markdown fences, SQL, shell, format and log-lookup strings</td>
<td>6 %</td>
</tr>
<tr>
<td>Injection around a legal proposal</td>
<td>the same strings before, after or both sides of a legal proposal</td>
<td>8 %</td>
</tr>
<tr>
<td>Control characters</td>
<td>NUL, tab, form feed, zero-width and bidirectional-override characters, byte-order mark, lone surrogates</td>
<td>6 %</td>
</tr>
<tr>
<td>Look-alike digits</td>
<td>full-width, Arabic-Indic, superscript, mathematical digits</td>
<td>4 %</td>
</tr>
<tr>
<td>Numeric extremes</td>
<td>0, negatives, leading zeros, 40-, 4,000-, 4,300-, 4,301- and 5,000-digit numbers</td>
<td>6 %</td>
</tr>
<tr>
<td>Hostile names</td>
<td>SQL, shell, path, format strings and newlines as relation names</td>
<td>4 %</td>
</tr>
<tr>
<td>Many items</td>
<td>one item repeated up to 20,000 times, or batches of up to 3,000 additions</td>
<td>3 %</td>
</tr>
<tr>
<td>One huge line</td>
<td>1 KB to 2 MB of random characters</td>
<td>0.5 %</td>
</tr>
<tr>
<td>Shape abuse</td>
<td>empty text, doubled separators, unbalanced brackets</td>
<td>1.5 %</td>
</tr>
<tr>
<td>Replays</td>
<td>an earlier committed proposal sent again</td>
<td>10 %</td>
</tr>
</tbody></table>
<h2>What came out?</h2>
<table>
<thead>
<tr>
<th>Check</th>
<th>Result</th>
</tr>
</thead>
<tbody><tr>
<td>Proposals</td>
<td>10,000,000 (3,007,418 committed, 6,901,639 refused, 90,943 raised an exception of one kind)</td>
</tr>
<tr>
<td>Injection proposals (alone or around a legal one)</td>
<td>1,401,041, <strong>0 committed</strong></td>
</tr>
<tr>
<td>Graph equal to the independent reference</td>
<td>at every comparison (every 64 proposals and at each segment end): <strong>0 mismatches</strong></td>
</tr>
<tr>
<td>Decision (accept or refuse) equal to the reference</td>
<td>on every proposal that did not raise</td>
</tr>
<tr>
<td>Pager audit (blocks add up, none in two places)</td>
<td>clean at all 1,000 scheduled checks</td>
</tr>
<tr>
<td>Replay of the committed texts rebuilds the graph</td>
<td>100 of 100 segments</td>
</tr>
<tr>
<td>Replay of every proposal in order</td>
<td>98 of 100 segments (in the other 2 only the order of the pager's free list differed; with the oversized texts replayed too, both matched)</td>
</tr>
<tr>
<td>Replay of the second half onto a mid-run copy</td>
<td>100 of 100 segments</td>
</tr>
<tr>
<td>32 threads with one lock around the front door</td>
<td>94,812 commits, 0 exceptions, end graph equal to the replay of the log</td>
</tr>
</tbody></table>
<p>The slowest single proposal outside the two size-stress families took 84.14 ms.</p>
<h2>What did it find to harden?</h2>
<p>The run was written to find faults, and it did. These are stated as the test page states them:</p>
<ul>
<li><strong>A very long number raises instead of being refused.</strong> A number of 4,300 or more digits makes Python's own integer-string limit raise an error out of the front door: 90,943 proposals (a 4,000-digit one committed normally). The limit is a CPython 3.11+ setting that a host program can switch off.</li>
<li><strong>Two services whose coordinates land on one page can unmap each other's page.</strong> Deleting one removes the page of the other; 5,231 of 10,000 checks found mapped pages different from the pages of the services.</li>
<li><strong>A crash in the middle of a commit leaves the pager failing its audit.</strong> 0 of 113,017 simulated crashes left a clean pager, and a crash between ranks left them apart (0 of 2,000 clean). The model has no undo and no recovery log, and a "crash" here is an exception, not a killed process.</li>
<li><strong>Without a lock, 32 threads raise errors.</strong> 37 exceptions in 92,137 commits. The class is documented as one proposal at a time; with one lock (last row above) it was clean.</li>
</ul>
<p>Nothing was changed to make a line pass. A fix would be its own commit with its own test and a re-run on a new seed.</p>
<h2>What does this not say?</h2>
<ul>
<li>No language model was called. It says nothing about whether a model can be talked into writing something; it says what happens to the text when it arrives at the host.</li>
<li>The gate checks the state's rules, not intent. A hijacked model that writes a legal edit obeying every rule would be committed like any other legal edit.</li>
<li>It is the Python reference model on a CPU, not the Rust crate, with 14 families of hostile text chosen by the author, and an independent reference written by the same author and assistant (a shared misreading would not show).</li>
</ul>
<h2>Check it</h2>
<p>The test page (plan written before the run, result below a line) is <code>docs/GATE_STRESS_TEST.md</code> in the repository, with the harness <code>python/axi/experiments/gate_stress.py</code> and the saved results in <code>docs/results/axi_gate_stress.json</code> (sha256 on the page): <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. White paper: <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a>. Ten open-model tests: <a href="https://doi.org/10.5281/zenodo.24319561">doi.org/10.5281/zenodo.24319561</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item><item><title><![CDATA[Does model size matter for LLM agent reliability? 11 open models, 1.5B to 32B: AXI's held state exact on 10 of 11]]></title><description><![CDATA[11 open models, 1.5B to 32B: the host-held state was exact on 10 of 11 in 3,200-step runs. Size changed speed and cost, and plain-words accuracy.]]></description><link>https://axi-runtime.hashnode.dev/does-model-size-matter-for-llm-agent-reliability-11-open-models-1-5b-to-32b-host-held-state-exact-on-10-of-11</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/does-model-size-matter-for-llm-agent-reliability-11-open-models-1-5b-to-32b-host-held-state-exact-on-10-of-11</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:42:18 GMT</pubDate><content:encoded><![CDATA[<p><strong>When the host holds the state and checks every change the model proposes, the state the host holds was exactly right on every step on 10 of 11 open models, from 1.5B to 32B parameters, in 3,200-step runs with 0 corrupted steps. Model size mattered a lot in other places: when requests were written in ordinary words, a plain model got 2.31 percent of steps right at 1.5B and 97.91 percent at 32B. The one model that failed (a reasoning distill) failed for a reason that is listed below.</strong></p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>What was measured?</h2>
<p>The same jobs, gate, repair and settings on every model (Tests 35, 37 and 41): vLLM 0.31.0, one NVIDIA L4, prefix caching on, greedy decoding, no retry, 32 jobs of 100 steps (3,200 steps) with the grammar that names the coordinates. Only the model name changes. "Exact" means the state the host holds equals the true state after the step.</p>
<table>
<thead>
<tr>
<th>Model</th>
<th>Exact share, 3,200 steps</th>
<th>Steps per GPU hour</th>
<th>Kept chat, computed prompt tokens per step vs exact state</th>
</tr>
</thead>
<tbody><tr>
<td>Qwen2.5-1.5B</td>
<td>100.00 %</td>
<td>258,284</td>
<td>1.24 times</td>
</tr>
<tr>
<td>Qwen2.5-3B</td>
<td>100.00 %</td>
<td>136,952</td>
<td>1.24 times</td>
</tr>
<tr>
<td>Qwen2.5-7B (4-bit)</td>
<td>100.00 %</td>
<td>86,374</td>
<td>1.24 times</td>
</tr>
<tr>
<td>Qwen3-8B (4-bit, thinking off)</td>
<td>100.00 %</td>
<td>83,524</td>
<td>1.31 times</td>
</tr>
<tr>
<td>Llama 3.1 8B (4-bit copy)</td>
<td>100.00 %</td>
<td>83,713</td>
<td>1.24 times</td>
</tr>
<tr>
<td>Phi-3.5-mini</td>
<td>100.00 %</td>
<td>95,320</td>
<td>1.37 times</td>
</tr>
<tr>
<td>Mistral 7B v0.3</td>
<td>100.00 %</td>
<td>58,446</td>
<td>4.11 times</td>
</tr>
<tr>
<td>Gemma 3 4B (changed settings, below)</td>
<td>100.00 %</td>
<td>104,157</td>
<td>1.34 times</td>
</tr>
<tr>
<td>Qwen2.5-14B (4-bit)</td>
<td>100.00 %</td>
<td>32,854</td>
<td>1.24 times</td>
</tr>
<tr>
<td>Qwen2.5-32B (4-bit, part of its weights in CPU memory, below)</td>
<td>100.00 %</td>
<td>1,471</td>
<td>1.24 times</td>
</tr>
<tr>
<td>DeepSeek-R1-Distill-Qwen-7B</td>
<td><strong>1.53 %</strong></td>
<td>16,523</td>
<td>2.34 times</td>
</tr>
</tbody></table>
<p>Corrupted steps: 0 in every cell of every model. Steps per hour are not comparable across rows with different cards or settings: the 32B ran on an L4 with 10 GB of its weights in ordinary memory, and Gemma ran in bf16 with a 64,000-token cache where the plan had fixed fp16 and 32,000 tokens (the engine refused the planned settings; the test page reports both changes).</p>
<h2>Why did the DeepSeek-R1 distill fail?</h2>
<p>Every reply to a delete (738 + 354 of the 3,200 steps in the main cell) ran to the 96-token cap and could not be read, so the host dropped those replies. Its state stayed well formed (0 corrupted steps) but fell behind the true state. Adds and edge additions were read on all 1,069 and 1,039 steps.</p>
<h2>Where did model size matter?</h2>
<p>When the request is in ordinary words (no coordinates named), the model has to read the sentence. The "words" cell, plain against the host reading the sentence itself:</p>
<table>
<thead>
<tr>
<th>Model</th>
<th>Words read by the model</th>
<th>Words read by the host</th>
</tr>
</thead>
<tbody><tr>
<td>Qwen2.5-1.5B</td>
<td>2.31 %</td>
<td>15.69 %</td>
</tr>
<tr>
<td>Phi-3.5-mini</td>
<td>4.09 %</td>
<td>25.00 %</td>
</tr>
<tr>
<td>Llama 3.1 8B</td>
<td>5.16 %</td>
<td>32.00 %</td>
</tr>
<tr>
<td>Qwen2.5-3B</td>
<td>7.47 %</td>
<td>23.09 %</td>
</tr>
<tr>
<td>Mistral 7B v0.3</td>
<td>9.88 %</td>
<td>24.03 %</td>
</tr>
<tr>
<td>Gemma 3 4B (changed settings)</td>
<td>19.34 %</td>
<td>58.84 %</td>
</tr>
<tr>
<td>Qwen3-8B</td>
<td>35.69 %</td>
<td>66.06 %</td>
</tr>
<tr>
<td>Qwen2.5-7B</td>
<td>41.53 %</td>
<td>64.00 %</td>
</tr>
<tr>
<td>Qwen2.5-14B</td>
<td>47.72 %</td>
<td>90.72 %</td>
</tr>
<tr>
<td>Qwen2.5-32B</td>
<td>97.91 %</td>
<td>100.00 %</td>
</tr>
<tr>
<td>DeepSeek-R1-Distill-Qwen-7B</td>
<td>0.00 %</td>
<td>0.91 %</td>
</tr>
</tbody></table>
<p>The host reading the sentence lifted the share on all 11 models. It did not make a weak model exact on ordinary words, and it was not meant to: the page says so. Size alone did not order the models either (Llama 3.1 8B is below Qwen2.5 3B on the plain words cell).</p>
<h2>What does this say, in one paragraph?</h2>
<p>In these runs, when the grammar names the coordinates and the host checks every change, the model's size changed speed and cost, not whether the host's state was right: 100.00 percent on 10 of 11 models, 1.5B to 32B. If you make the model also find what to change in loose language, size matters a great deal, and the host's check cannot supply what the model never understood.</p>
<h2>What is not shown?</h2>
<p>One card type (an L4, also for the 32B with part of its weights in CPU memory), one engine and version, quantised copies for several models, synthetic service graphs, greedy decoding, the Qwen2.5 family for the size ladder, 100-step jobs.</p>
<h2>Check it</h2>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
python3 quickstart_replay.py
</code></pre>
<p>That replays the saved replies of the 4,000-request Gemini run (no key, no GPU). The model tests are <code>docs/MODEL_LADDER_TEST.md</code>, <code>MODEL_LADDER_WORDS_TEST.md</code>, <code>MODEL_FAMILIES_TEST.md</code> and <code>MODEL_LADDER_COMPLETE_TEST.md</code> in the repository: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. White paper: <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a>. Ten open-model tests: <a href="https://doi.org/10.5281/zenodo.24319561">doi.org/10.5281/zenodo.24319561</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item><item><title><![CDATA[LLM agent memory compared: whole chat, summary, sliding window, retrieval and AXI's host-held state on a 14B model]]></title><description><![CDATA[Six memory methods, one 14B model: host-held state 0.30 s and 21.8 J a step; whole chat 1.72 s and 123.1 J; others 0.55-0.66 s.]]></description><link>https://axi-runtime.hashnode.dev/llm-agent-memory-compared-whole-chat-summary-sliding-window-retrieval-and-host-held-state-on-a-14b-model</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/llm-agent-memory-compared-whole-chat-summary-sliding-window-retrieval-and-host-held-state-on-a-14b-model</guid><category><![CDATA[llm]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:40:47 GMT</pubDate><content:encoded><![CDATA[<p><strong>Six ways of remembering what an agent has done, measured on one 14B model over 600-step jobs: the whole chat, a generic summary, a summary that writes the state out, a sliding window, retrieval, and a host-held state shown fresh each step. With the host's check in the loop, all six ended with the exact state on every step they ran. They differed in cost: 0.30 s and 21.8 joules a step for the host-held state, 0.55 to 0.66 s and 39.4 to 48.0 joules for summaries, a window and retrieval; the whole chat sent 8,228.8 prompt tokens a step against 413.7 for the host-held state. They also differed on something the host-held state did not win: how often the model's own reply was right.</strong></p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>What is the fair objection to "keep the whole chat"?</h2>
<p>Nobody keeps the whole chat for long. Tools summarise it, cut it to a window, or fetch the old turns that matter. So Test 44 puts each of those against a host that holds the state and shows the model the exact state every step.</p>
<h2>What was compared?</h2>
<p>Qwen2.5-14B-Instruct (4-bit) on vLLM 0.31.0, one NVIDIA L4, prefix caching on, greedy decoding, no retry, three jobs of 600 steps (1,800 steps per arm). In every chat arm the first message shows the whole state and the first request; later messages are only the requests, and the model's replies stay in the chat.</p>
<table>
<thead>
<tr>
<th>Arm</th>
<th>What it is</th>
</tr>
</thead>
<tbody><tr>
<td>Exact state (host-held)</td>
<td>each step: fresh prompt with the state the host holds and the request; the host checks and repairs the reply</td>
</tr>
<tr>
<td>Whole chat</td>
<td>the chat kept whole until its next prompt would pass 16,000 tokens</td>
</tr>
<tr>
<td>Summary</td>
<td>at 4,000 tokens the model summarises the chat and the summary replaces it</td>
</tr>
<tr>
<td>Summary that writes the state out</td>
<td>the same, but the model is asked to write out the complete current list of services and edges</td>
</tr>
<tr>
<td>Sliding window</td>
<td>first turn pinned, then the last 12 turns</td>
</tr>
<tr>
<td>Retrieval</td>
<td>first turn pinned, the last 4 turns, and the 8 earlier turns sharing the most coordinates with the request</td>
</tr>
</tbody></table>
<h2>What came out?</h2>
<table>
<thead>
<tr>
<th>Arm</th>
<th>Steps</th>
<th>Model's own reply right</th>
<th>Held state exact (with the host's check)</th>
<th>Applied as written, exact</th>
<th>Computed prompt tokens a step</th>
<th>Seconds a step</th>
<th>Joules a step</th>
</tr>
</thead>
<tbody><tr>
<td>Exact state</td>
<td>1,800</td>
<td>81.89 %</td>
<td>100.0 %</td>
<td>0.39 %</td>
<td>149.2</td>
<td>0.3034</td>
<td>21.8</td>
</tr>
<tr>
<td>Whole chat</td>
<td>1,160</td>
<td>89.83 %</td>
<td>100.0 %</td>
<td>0.69 %</td>
<td>not compared</td>
<td>not compared</td>
<td>not compared</td>
</tr>
<tr>
<td>Summary</td>
<td>1,800</td>
<td>84.00 %</td>
<td>100.0 %</td>
<td>0.44 %</td>
<td>42.8</td>
<td>0.5477</td>
<td>39.9</td>
</tr>
<tr>
<td>Summary that writes the state out</td>
<td>1,800</td>
<td>85.28 %</td>
<td>100.0 %</td>
<td>0.44 %</td>
<td>45.3</td>
<td>0.6255</td>
<td>45.5</td>
</tr>
<tr>
<td>Sliding window</td>
<td>1,800</td>
<td>85.33 %</td>
<td>100.0 %</td>
<td>0.44 %</td>
<td>489.3</td>
<td>0.5503</td>
<td>39.4</td>
</tr>
<tr>
<td>Retrieval</td>
<td>1,800</td>
<td>93.83 %</td>
<td>100.0 %</td>
<td>0.44 %</td>
<td>496.2</td>
<td>0.6631</td>
<td>48.0</td>
</tr>
</tbody></table>
<p>The whole chat stopped on its 16,000-token rule at step 418, 367 and 375 of 600 in the three jobs. Computed tokens include the summary calls; joules are the board's energy divided by the steps run (mean power 70.4 to 72.0 W in every arm). The whole chat sent 8,228.8 prompt tokens a step against 413.7 for the exact state.</p>
<h2>What does the table say?</h2>
<ul>
<li><strong>The host's check, not the memory method, held the state.</strong> The same replies applied as written left the state right on 0.39 to 0.69 percent of steps, and not even a well-formed graph on 98.3 to 99.6 percent of them. With the host's gate and repair, all arms were exact on every step.</li>
<li><strong>The host-held state was the cheapest way to run, in time and energy.</strong> It was the fastest of the five arms compared here (0.3034 s) and the lowest in joules (21.8). Summaries computed fewer new tokens (42.8 and 45.3 against 149.2), but the summary calls took the time: 494.9 of the 985.8 seconds of the summary arm were 21 summary calls.</li>
<li><strong>Showing the exact state did not make the model's own reply right more often.</strong> The model's own step was right on 81.89 percent with the exact state against 84.00 to 93.83 percent for the chat arms. On deletes of a service with edges, where the reply must list every edge, it was right on 21.63 percent against 30.77 to 73.32. The host's repair completes the missing edges, which is why the held state stayed exact.</li>
<li><strong>Asking a model to write the state down did not work here.</strong> None of the 22 summaries that were asked to write the state out equalled the true state (19 differed, 3 stopped at the 1,000-token limit before the edge list).</li>
</ul>
<h2>What is not shown?</h2>
<p>One card, one 14B quantised model, greedy decoding, synthetic service graphs, three jobs of one family and 600 steps. The summary prompts, the window size (12 turns) and the retrieval rule were the author's single choices and were fixed before the run; a better summary prompt, a longer window or embedding-based retrieval would move those arms. The whole chat ran under engine memory warnings late in the arm, so its computed tokens, seconds and joules are left out of the comparison. The whole chat here shows the state once; the heavier chat that shows it every message is in the context-window page of this series.</p>
<h2>Check it</h2>
<p>The test page, with its predictions written before the run and every reading below a line, is <code>docs/MEMORY_ARMS_TEST.md</code> in the repository, with the saved summaries in <code>docs/results/axi_memory_arms_summaries.json</code>: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. White paper: <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a>. Ten open-model tests: <a href="https://doi.org/10.5281/zenodo.24319561">doi.org/10.5281/zenodo.24319561</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item><item><title><![CDATA[When an agent's chat outgrows the context window: 108 to 235 steps in 32k, 337 in 131k; AXI's held state ran 1,500 of 1,500]]></title><description><![CDATA[A kept chat ran out of context after 108-235 steps (32k window) or 337 (131k); host-held state ran 1,500 of 1,500 at a flat 0.3 s a step.]]></description><link>https://axi-runtime.hashnode.dev/what-happens-when-an-llm-agent-s-chat-outgrows-the-context-window-measured-108-to-235-steps-in-32k-337-in-131k</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/what-happens-when-an-llm-agent-s-chat-outgrows-the-context-window-measured-108-to-235-steps-in-32k-337-in-131k</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:39:12 GMT</pubDate><content:encoded><![CDATA[<p><strong>A kept chat grows every step, so it runs into the context window. Measured on a 7B model: with the chat kept, the job ended after 108 to 235 steps in a 32,768-token window and after 337 steps in a 131,072-token window, where a step slowed from 0.35 s to 1.36 s. With the host holding the state, the same kind of job ran 1,500 of 1,500 steps in every run at a flat 0.28 to 0.31 s, and the prompt never passed 660 tokens.</strong></p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>What happens to an agent when the context window fills?</h2>
<p>The prompt is the whole chat so far, so it gets one step longer every step. The model reads more before it answers, each step slows, and at the window's limit the job simply stops. A cache removes part of the reading cost (98 to 99 percent of the kept chat's prompt tokens came from the cache here) but not the growth.</p>
<h2>What was measured?</h2>
<p>Test 42: Qwen2.5-7B-Instruct (4-bit), vLLM 0.31.0, one NVIDIA L4, prefix caching on, greedy decoding. The kept chat shows the whole current state in every message (the heaviest honest version) and stops when its next prompt would pass 32,000 tokens (32,768 window) or 130,000 (a 131,072 window using YaRN scaling). The exact-state arm shows the host's state fresh each step.</p>
<table>
<thead>
<tr>
<th>Run</th>
<th>Arm</th>
<th>Steps run</th>
<th>Steps with the state exact</th>
<th>Ended by</th>
<th>Seconds a step</th>
<th>Longest prompt (tokens)</th>
</tr>
</thead>
<tbody><tr>
<td>32k window, job 1</td>
<td>kept chat</td>
<td>108</td>
<td>108 (100 %)</td>
<td>context limit</td>
<td>0.4065</td>
<td>31,776</td>
</tr>
<tr>
<td>32k window, job 2</td>
<td>kept chat</td>
<td>208</td>
<td>208 (100 %)</td>
<td>context limit</td>
<td>0.3449</td>
<td>31,885</td>
</tr>
<tr>
<td>32k window, job 3</td>
<td>kept chat</td>
<td>228</td>
<td>228 (100 %)</td>
<td>context limit</td>
<td>0.3282</td>
<td>31,968</td>
</tr>
<tr>
<td>32k window, job 4</td>
<td>kept chat</td>
<td>235</td>
<td>235 (100 %)</td>
<td>context limit</td>
<td>0.3403</td>
<td>31,910</td>
</tr>
<tr>
<td>131k window</td>
<td>kept chat</td>
<td>337</td>
<td>337 (100 %)</td>
<td>context limit</td>
<td>0.8104</td>
<td>129,759</td>
</tr>
<tr>
<td>32k window</td>
<td>exact state</td>
<td>1,500</td>
<td>1,500 (100 %)</td>
<td>all steps run</td>
<td>0.2998</td>
<td>660</td>
</tr>
<tr>
<td>32k window, four jobs side by side</td>
<td>exact state</td>
<td>6,000</td>
<td>6,000 (100 %)</td>
<td>all steps run</td>
<td>0.116 per step</td>
<td>658</td>
</tr>
<tr>
<td>131k window</td>
<td>exact state</td>
<td>1,500</td>
<td>1,500 (100 %)</td>
<td>all steps run</td>
<td>0.2985</td>
<td>660</td>
</tr>
</tbody></table>
<p>Corrupted steps: 0 in every cell. The kept chat was exact on every step it ran; what it lost was time, tokens and its end.</p>
<h2>How much slower does a kept chat get?</h2>
<p>In the 131k run, seconds a step by blocks of 50 steps were 0.35, 0.43, 0.66, 0.84, 1.01, 1.17 and 1.36, while the prompt grew from 28,807 tokens at step 100 to 71,227 at step 200, 113,855 at step 300 and 129,759 at its last step. Over the same steps the exact-state arm computed fewer tokens and took less time:</p>
<table>
<thead>
<tr>
<th>Pair</th>
<th>Computed prompt tokens a step</th>
<th>Seconds a step</th>
</tr>
</thead>
<tbody><tr>
<td>32k kept chat vs exact state, steps 1 to 108</td>
<td>290.7 vs 163.5 (1.78 times)</td>
<td>0.4065 vs 0.2692 (1.51 times)</td>
</tr>
<tr>
<td>131k kept chat vs exact state, 337 steps</td>
<td>382.5 vs 258.1 (1.48 times)</td>
<td>0.8104 vs 0.2932 (2.76 times)</td>
</tr>
</tbody></table>
<h2>Does the host-held state also fill a window?</h2>
<p>It follows the size of the state, not the length of the history. In the four-job run the exact-state prompt rose from 317.9 tokens over steps 1 to 100 to 526.4 over steps 1,401 to 1,500 and never passed 660 tokens, because the held state grew a little. That reading is the author's and was not tested by a separate run.</p>
<p>A large state is a different test (Test 40, a CPU run on the Python reference model, characters counted with 3 characters per token assumed). At 20,001 items the whole state is 378,399 characters on an even graph, about 124,000 to 126,000 tokens, which nearly fills a 128,000-token window. The focused view the model is shown stayed at a median of 207 to 323 characters from 20 to 20,000 items; a request that names the biggest hub shows 355 items (5,553 characters, 1.8 percent of the state).</p>
<p>One reading went against the framework: the host's own check is not flat in the size of the state. It took 3.9 microseconds at 201 items and 257 at 20,001 (66 times). That is 0.3 ms at about 6,700 services, small beside a model's reply time, and the test page gives the likely cause. Not shown: that a model is as exact when it reads the focused view as when it reads the whole state.</p>
<h2>What is not shown?</h2>
<p>One card, one 7B quantised model, one engine and version, synthetic service graphs, four kept chats on four jobs of one family. The kept chat's stop is set by the window and the test's stop rule: it is the arithmetic of a growing chat, not a saving of the exact-state arm. The saving this test can claim is in computed tokens and seconds over the same steps.</p>
<h2>Check it</h2>
<p>The test pages are <code>docs/KEPT_CHAT_LONG_TEST.md</code> (Test 42) and <code>docs/STATE_SIZE_SCALING_TEST.md</code> (Test 40) in the repository. Test 40 runs on any machine with Python in about 3 seconds:</p>
<pre><code class="language-plaintext">git clone https://github.com/gaurshalendra2412/axi-runtime
cd axi-runtime/python
mkdir -p /tmp/axi_out
python3 -m axi.experiments.state_size_scaling /tmp/axi_out
</code></pre>
<p>Repository: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. White paper: <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a>. Ten open-model tests: <a href="https://doi.org/10.5281/zenodo.24319561">doi.org/10.5281/zenodo.24319561</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item><item><title><![CDATA[LLM tool calls and structured edits on a 7B model: 57 to 79 percent right as written, 94 to 99.8 with AXI's host-side check]]></title><description><![CDATA[Four test worlds, 7B and 14B models: replies applied as written were right on 57-79% of steps; a rule check raised that to 94-99.8%.]]></description><link>https://axi-runtime.hashnode.dev/llm-tool-calls-and-structured-edits-on-a-7b-model-57-to-79-percent-of-steps-right-as-written-94-to-99-8-with-a-rule-check</link><guid isPermaLink="true">https://axi-runtime.hashnode.dev/llm-tool-calls-and-structured-edits-on-a-7b-model-57-to-79-percent-of-steps-right-as-written-94-to-99-8-with-a-rule-check</guid><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[Testing]]></category><dc:creator><![CDATA[Shalendra gaur]]></dc:creator><pubDate>Wed, 18 Nov 2026 06:36:09 GMT</pubDate><content:encoded><![CDATA[<p><strong>Models make mistakes on structured edits: formulas in a spreadsheet, bookings in a schedule, lines in a code file, arguments of a tool call. Measured on a 7B model across four such worlds, applying the model's reply as written gave a correct step on 57.11 to 79.11 percent of steps. Putting a check that knows the world's own rule in front of the state, and dropping any reply that fails it, raised that to 94.0 to 99.78 percent, and the state the host held broke no rule on any step. The same pattern on a 14B model: 94.67 to 99.78 percent.</strong></p>
<p><em>Naming note: "AXI" here is the AXI host-side runtime for LLM agents, an architecture by Rajnish Choubey. It is not the ARM AMBA AXI chip-bus protocol.</em></p>
<h2>What was tested?</h2>
<p>Test 45 tests the pattern (the host holds the state, a check admits or drops the model's reply) on four worlds written for the test, not on the framework's own graph gate:</p>
<table>
<thead>
<tr>
<th>World</th>
<th>State</th>
<th>A rule the check must know</th>
</tr>
</thead>
<tbody><tr>
<td>Table</td>
<td>cells A1 to D4 of numbers and two-cell formulas</td>
<td>no formula depends on itself</td>
</tr>
<tr>
<td>Schedule</td>
<td>events in three rooms for three people, hours 8 to 18</td>
<td>no room or person booked twice at once</td>
</tr>
<tr>
<td>Code</td>
<td>a Python file of two small functions, edited by insert, replace, delete of numbered lines</td>
<td>no name used before it is defined</td>
</tr>
<tr>
<td>Tool calls</td>
<td>search, email, book, timer with typed arguments</td>
<td>arguments match the tool's schema</td>
</tr>
</tbody></table>
<p>Each world has 3 jobs of 150 steps (450 steps), and about 30 percent of the requests are conflicting: applied as written they would break a rule, and the right reply is to do nothing. The model is always shown the state the host holds. Four arms: <strong>B</strong> applies the reply as written; <strong>P</strong> puts the rules in the prompt and tells the model to reply NOOP when a request would break one; <strong>G</strong> puts a generic check in front (the reply parses, the thing it names exists, formulas point at cells that hold something, the file still parses); <strong>D</strong> adds the domain check.</p>
<h2>What came out?</h2>
<p>Share of steps that were right (the reply, applied under the arm's policy to the true state before the step, gives the true state after it; a conflicting request is right only if the state does not change). Qwen2.5-7B-Instruct (4-bit) and Qwen2.5-14B-Instruct (4-bit), vLLM 0.31.0, one NVIDIA L4, greedy, no retry:</p>
<table>
<thead>
<tr>
<th>World</th>
<th>7B: B</th>
<th>P</th>
<th>G</th>
<th>D</th>
<th>14B: B</th>
<th>P</th>
<th>G</th>
<th>D</th>
</tr>
</thead>
<tbody><tr>
<td>Table</td>
<td>66.44</td>
<td>52.89</td>
<td>78.44</td>
<td><strong>98.89</strong></td>
<td>68.00</td>
<td>34.44</td>
<td>79.33</td>
<td><strong>99.78</strong></td>
</tr>
<tr>
<td>Schedule</td>
<td>74.22</td>
<td>45.56</td>
<td>80.44</td>
<td><strong>98.89</strong></td>
<td>75.11</td>
<td>48.44</td>
<td>80.00</td>
<td><strong>98.22</strong></td>
</tr>
<tr>
<td>Code</td>
<td>57.11</td>
<td>55.56</td>
<td>58.00</td>
<td><strong>94.00</strong></td>
<td>60.67</td>
<td>53.56</td>
<td>75.11</td>
<td><strong>94.67</strong></td>
</tr>
<tr>
<td>Tool calls</td>
<td>79.11</td>
<td>91.33</td>
<td>79.78</td>
<td><strong>99.78</strong></td>
<td>73.56</td>
<td>92.67</td>
<td>76.22</td>
<td><strong>96.89</strong></td>
</tr>
</tbody></table>
<p>The state the host held broke a rule on most steps when replies were applied as written (7B: 96.0 percent of table steps, 98.89 of code steps, 86.67 of tool-call steps, 43.33 of schedule steps) and on none with the domain check (<code>D</code>: 100.0 percent valid in all eight world and model pairs).</p>
<h2>What did each kind of check see?</h2>
<ul>
<li><strong>The generic check cannot see the domain's rules.</strong> On conflicts only the domain can see, <code>G</code> got 0.0, 1.22, 2.41 and 0.0 percent right on the 7B (table, schedule, code, tool calls).</li>
<li><strong>Telling the model the rules was not enough.</strong> <code>P</code> was below <code>B</code> in three of four worlds on the 7B, because the model refuses what it should apply: 39 percent of replies were NOOP in the table world and 74 percent in the schedule world.</li>
<li><strong>The domain check gave the largest gain in every world.</strong> <code>D</code> was above <code>P</code> by 46.0, 53.33, 38.44 and 8.45 points on the 7B (table, schedule, code, tool calls).</li>
</ul>
<h2>What did the check not do?</h2>
<p>It guaranteed that the held state broke no rule. It did not make the held state the true one: a valid but wrong edit stays. After 450 steps the held state equalled the true state on 60.0, 93.11, 3.56 and 92.67 percent of steps in the table, schedule, code and tool-call worlds on the 7B (98.44, 85.33, 14.44 and 77.56 on the 14B). In the code world the model's replies to valid requests go wrong early and stay in the file.</p>
<h2>What is not shown?</h2>
<p>Four small synthetic worlds written for this test, one card, two quantised models, greedy decoding, one engine version. The domain checks were written by the author. It is a test of the pattern, not of the framework's own graph gate, and not of real spreadsheets, calendars, repositories or tool schemas.</p>
<h2>Check it</h2>
<p>The test page, with its predictions written before the run, is <code>docs/STATE_KINDS_TEST.md</code> in the repository, with the compact results in <code>docs/results/axi_state_kinds_compact.json</code>: <a href="https://github.com/gaurshalendra2412/axi-runtime">github.com/gaurshalendra2412/axi-runtime</a>. White paper: <a href="https://doi.org/10.5281/zenodo.23958737">doi.org/10.5281/zenodo.23958737</a>. Ten open-model tests: <a href="https://doi.org/10.5281/zenodo.24319561">doi.org/10.5281/zenodo.24319561</a>.</p>
<p><em>Architecture by Rajnish Choubey. Tests built and run by Shalendra Gaur.</em></p>
]]></content:encoded></item></channel></rss>