<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Roshan Ravani Singh</title>
    <description>The latest articles on DEV Community by Roshan Ravani Singh (@roshan_ravanisingh_41e23).</description>
    <link>https://dev.to/roshan_ravanisingh_41e23</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2830304%2Fb541b297-244e-4e54-8e29-8a8251a2f4df.png</url>
      <title>DEV Community: Roshan Ravani Singh</title>
      <link>https://dev.to/roshan_ravanisingh_41e23</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/roshan_ravanisingh_41e23"/>
    <language>en</language>
    <item>
      <title>The simpler system won, and I published the loss</title>
      <dc:creator>Roshan Ravani Singh</dc:creator>
      <pubDate>Mon, 30 Nov 2026 03:04:34 +0000</pubDate>
      <link>https://dev.to/roshan_ravanisingh_41e23/the-simpler-system-won-and-i-published-the-loss-124o</link>
      <guid>https://dev.to/roshan_ravanisingh_41e23/the-simpler-system-won-and-i-published-the-loss-124o</guid>
      <description>&lt;p&gt;I built a market-intelligence system with two decision paths. The first is a typed System-1&lt;br&gt;
engine: parse the input into a schema, apply rules, emit a decision with its evidence. The second&lt;br&gt;
adds a recurrent reasoning loop on top, because the obvious assumption is that more reasoning&lt;br&gt;
produces better decisions.&lt;/p&gt;

&lt;p&gt;It does not. On my evaluation, &lt;strong&gt;System-1 scored 0.558 accuracy; the recurrent loop scored 0.508&lt;br&gt;
at 8.5× the cost.&lt;/strong&gt; The loop stays in the repository, off by default, and the README says why.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why publish a negative result
&lt;/h2&gt;

&lt;p&gt;Because a system you cannot score is a system you cannot improve, and a system whose failures are&lt;br&gt;
hidden cannot be trusted with anything that matters. &lt;strong&gt;Divya&lt;/strong&gt; exists to test the thesis this&lt;br&gt;
portfolio is built on — typed outputs, provenance, evaluation, red team — against a real decision&lt;br&gt;
problem rather than a benchmark notebook.&lt;/p&gt;

&lt;p&gt;The parts that made the comparison honest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A typed decision, not prose.&lt;/strong&gt; Every output is a schema under a versioned protocol. Two runs
can be diffed, scored, and regressed. A paragraph cannot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evidence provenance.&lt;/strong&gt; Each decision carries the inputs and sources it used, so a wrong answer
can be traced to a wrong input instead of argued about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One evaluation harness for both paths.&lt;/strong&gt; The recurrent configuration was not allowed to have a
private, friendlier test.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The red team found real defects
&lt;/h2&gt;

&lt;p&gt;The 43-case red-team suite covers seven classes of adversarial input. It found &lt;strong&gt;15 defects&lt;/strong&gt; in&lt;br&gt;
the decision surface, all now fixed. That is the number I trust most in this project, because it&lt;br&gt;
was produced by trying to break the thing rather than by trying to demo it.&lt;/p&gt;

&lt;p&gt;There are &lt;strong&gt;378 tests&lt;/strong&gt; behind it, and &lt;code&gt;make test&lt;/code&gt; is the entry point.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would change next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The evaluation set is small enough that 0.558 versus 0.508 deserves a confidence interval before
anyone treats it as a law. The direction is credible; the precision is not.&lt;/li&gt;
&lt;li&gt;Fine-tuning was measured on a Kaggle T4 ×2, which bounds the model sizes this pipeline can
realistically use. A 4B model was measured and deleted: 42–64 s warm versus 0.56–0.91 s for the
smaller configuration.&lt;/li&gt;
&lt;li&gt;The recurrent loop might win on a different task. "It lost here" is the claim; "reasoning loops
do not help" is not.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That distinction is the whole discipline. A negative result is only useful if it is stated as&lt;br&gt;
narrowly as it was measured.&lt;/p&gt;

&lt;p&gt;Read the &lt;a href="https://roshan-s-digital-twin.vercel.app/s/divya" rel="noopener noreferrer"&gt;case page&lt;/a&gt; or the code at&lt;br&gt;
&lt;a href="https://github.com/RavaniRoshan/divya" rel="noopener noreferrer"&gt;github.com/RavaniRoshan/divya&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>evaluation</category>
      <category>python</category>
      <category>testing</category>
    </item>
    <item>
      <title>What 86.9% KV cache utilisation actually means</title>
      <dc:creator>Roshan Ravani Singh</dc:creator>
      <pubDate>Mon, 30 Nov 2026 03:03:39 +0000</pubDate>
      <link>https://dev.to/roshan_ravanisingh_41e23/what-869-kv-cache-utilisation-actually-means-35e5</link>
      <guid>https://dev.to/roshan_ravanisingh_41e23/what-869-kv-cache-utilisation-actually-means-35e5</guid>
      <description>&lt;p&gt;Serving is where an LLM bill actually lives, and the paged KV cache is the reason vLLM can serve&lt;br&gt;
more concurrent requests than a naive loop on the same GPU.&lt;/p&gt;

&lt;p&gt;I rebuilt that architecture to understand it, one phase at a time, in&lt;br&gt;
&lt;a href="https://github.com/RavaniRoshan/mini-llm-engine" rel="noopener noreferrer"&gt;mini-llm-engine&lt;/a&gt;. It is based on the nano-vLLM&lt;br&gt;
reference — that lineage should be stated plainly, because the value of the exercise is the&lt;br&gt;
implementation and the measurements, not the invention of the idea.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fragmentation problem in one paragraph
&lt;/h2&gt;

&lt;p&gt;A naive cache allocates a contiguous block per sequence, sized for the worst case. A request that&lt;br&gt;
generates 900 tokens reserves the same memory as one that generates 100, because the runtime&lt;br&gt;
cannot move a block that a kernel is reading. Ten concurrent requests later, most of the cache is&lt;br&gt;
free space that no other sequence can use. Paging fixes that: allocate fixed-size blocks, map them&lt;br&gt;
per sequence, and let the scheduler decide how many blocks a running sequence actually needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I measured it
&lt;/h2&gt;

&lt;p&gt;The number that gets quoted from this project is &lt;strong&gt;86.9% effective KV utilisation&lt;/strong&gt; on a synthetic&lt;br&gt;
fragmentation workload — sequences with deliberately uneven lengths arriving together. That is the&lt;br&gt;
interesting case: it is the workload where a contiguous allocator wastes the most memory, and&lt;br&gt;
therefore the one where paging has to earn its complexity.&lt;/p&gt;

&lt;p&gt;What that number is not:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is not a throughput claim. On the machine I had, the whole engine runs at 3.7 tokens/second,
with TTFT p50 1613 ms and TPOT p50 1006 ms — on an &lt;strong&gt;RTX 3050 Laptop with 4 GB&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;It is not a data-centre benchmark. The harness targets a Kaggle T4 with 15 GB; the laptop number
is a structural baseline, not a serving result.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every phase has a gate script (&lt;code&gt;tests/test_phase*.py&lt;/code&gt;) and the methodology is in&lt;br&gt;
&lt;code&gt;docs/benchmark.md&lt;/code&gt;, so the claim can be reproduced or refuted on your hardware instead of taken&lt;br&gt;
on my word.&lt;/p&gt;

&lt;h2&gt;
  
  
  The parts that are easy to get wrong
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Block tables are the whole game.&lt;/strong&gt; Prefix sharing only works if two sequences can point at the
same physical block, and eviction is only safe if the table is updated before the block is
reused. Sharing was verified across 16 of 16 blocks in the test workload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Continuous batching is a scheduler problem.&lt;/strong&gt; Admitting a new sequence mid-decode changes the
shape of every kernel call. The OpenAI-compatible HTTP surface is the easy part; the token
budget arithmetic is not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quantization has to be exact where it claims to be.&lt;/strong&gt; GGUF Q8_0 and Q4_K_M are checked for
dequantization parity against BF16, because a quantized model that silently drifts is worse than
no quantization at all.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why this belongs next to agent work
&lt;/h2&gt;

&lt;p&gt;An agent that makes thirty calls is a customer of an inference stack. Whether those calls queue&lt;br&gt;
behind each other or batch together decides the cost per run as much as the model choice does.&lt;br&gt;
Understanding the scheduler is how you stop treating latency as a property of the vendor.&lt;/p&gt;

&lt;p&gt;Start at the &lt;a href="https://roshan-s-digital-twin.vercel.app/s/mini-llm-engine" rel="noopener noreferrer"&gt;case page&lt;/a&gt; or go straight&lt;br&gt;
to &lt;a href="https://github.com/RavaniRoshan/mini-llm-engine" rel="noopener noreferrer"&gt;github.com/RavaniRoshan/mini-llm-engine&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>inference</category>
      <category>python</category>
      <category>cuda</category>
    </item>
    <item>
      <title>What a capability lease buys you when the client is an agent</title>
      <dc:creator>Roshan Ravani Singh</dc:creator>
      <pubDate>Mon, 30 Nov 2026 03:02:45 +0000</pubDate>
      <link>https://dev.to/roshan_ravanisingh_41e23/what-a-capability-lease-buys-you-when-the-client-is-an-agent-mcc</link>
      <guid>https://dev.to/roshan_ravanisingh_41e23/what-a-capability-lease-buys-you-when-the-client-is-an-agent-mcc</guid>
      <description>&lt;p&gt;A personal access token is a promise that never expires. You mint one for a human, they paste it&lt;br&gt;
into a CI secret, and eighteen months later it is still valid, still scoped to everything, and&lt;br&gt;
still the thing that breaks the day a laptop is stolen.&lt;/p&gt;

&lt;p&gt;That design was fine when the client was a person clicking buttons. It stops being fine when the&lt;br&gt;
client is an autonomous agent that runs for forty minutes, touches a dozen repositories, and may&lt;br&gt;
be wrong at any step.&lt;/p&gt;

&lt;p&gt;I have been building &lt;strong&gt;refweir&lt;/strong&gt;, a self-hosted Git forge whose first-class client is an agent&lt;br&gt;
rather than a human in a browser. The interesting part is not the UI. It is the authority model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Authority should be a lease, not a key
&lt;/h2&gt;

&lt;p&gt;A forge for agents needs to answer three questions before it accepts a write:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Which agent is this?&lt;/strong&gt; Not which account — which run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What may it touch?&lt;/strong&gt; A branch namespace, not a repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When does that stop being true?&lt;/strong&gt; On its own, without anyone remembering to revoke it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Refweir issues a short-lived capability: an HMAC-SHA256 signed token with a one-hour expiry,&lt;br&gt;
scoped to &lt;code&gt;refs/heads/agent/*&lt;/code&gt;. The agent presents it, the server verifies the signature, and the&lt;br&gt;
ref it is allowed to push is the ref the lease names. When the hour runs out the authority is&lt;br&gt;
gone. No revocation job, no leaked-token incident, no "who still has access" audit.&lt;/p&gt;

&lt;p&gt;The namespace confinement matters as much as the expiry. A lease that can push anywhere is a&lt;br&gt;
password with a shorter clock. A lease that can only push to &lt;code&gt;refs/heads/agent/&amp;lt;run&amp;gt;&lt;/code&gt; cannot&lt;br&gt;
reach &lt;code&gt;main&lt;/code&gt; even if the agent is confused, prompt-injected, or simply having a bad day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transport is part of the contract
&lt;/h2&gt;

&lt;p&gt;Agents already speak Git over smart-HTTP, and half of them expect SSH. Refweir ships both in one&lt;br&gt;
binary: smart-HTTP on &lt;code&gt;:8080&lt;/code&gt; and an embedded pure-Go SSH server on &lt;code&gt;:2222&lt;/code&gt;, with the React UI&lt;br&gt;
embedded and SQLite in WAL mode. Self-hosting is a file, not a stack — no host OpenSSH, no&lt;br&gt;
sidecar, no CGO.&lt;/p&gt;

&lt;p&gt;That is a structural claim rather than a benchmark. I have not published a throughput number for&lt;br&gt;
refweir and I am not going to pretend otherwise; what is verifiable is the shape: one binary,&lt;br&gt;
two transports, leases that expire, refs that cannot escape their namespace, and a test suite&lt;br&gt;
that exercises the policy rather than the happy path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this generalises past Git
&lt;/h2&gt;

&lt;p&gt;Any agent that acts on a system needs the same three properties. A browser agent needs a session&lt;br&gt;
scoped to one origin, not the whole profile. A deploy agent needs a credential scoped to one&lt;br&gt;
environment for one window. A coding agent needs a branch, a budget, and a deadline.&lt;/p&gt;

&lt;p&gt;Long-lived secrets are the default because they are easy to mint and hard to reason about. Leases&lt;br&gt;
are the opposite: slightly more work up front, and the blast radius becomes a design parameter&lt;br&gt;
instead of an incident report.&lt;/p&gt;

&lt;p&gt;The forge is at &lt;a href="https://github.com/RavaniRoshan/refweir" rel="noopener noreferrer"&gt;github.com/RavaniRoshan/refweir&lt;/a&gt;, and&lt;br&gt;
the case page with the longer version is at&lt;br&gt;
&lt;a href="https://roshan-s-digital-twin.vercel.app/s/refweir" rel="noopener noreferrer"&gt;roshan-s-digital-twin.vercel.app/s/refweir&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>git</category>
      <category>ai</category>
      <category>security</category>
      <category>go</category>
    </item>
    <item>
      <title>Your agent loop is a financial instrument</title>
      <dc:creator>Roshan Ravani Singh</dc:creator>
      <pubDate>Mon, 30 Nov 2026 03:02:45 +0000</pubDate>
      <link>https://dev.to/roshan_ravanisingh_41e23/your-agent-loop-is-a-financial-instrument-17k7</link>
      <guid>https://dev.to/roshan_ravanisingh_41e23/your-agent-loop-is-a-financial-instrument-17k7</guid>
      <description>&lt;p&gt;An agent that retries on a rate limit is a financial instrument pointed at your own account.&lt;/p&gt;

&lt;p&gt;That sentence started as a joke about my own code. It became the design brief for &lt;strong&gt;backstop&lt;/strong&gt;, an&lt;br&gt;
in-process reliability layer for AI SDKs: token budgets, backpressure, retry policy, and circuit&lt;br&gt;
breakers that sit between an agent and the provider it is calling.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with guardrails outside the process
&lt;/h2&gt;

&lt;p&gt;Most guardrails live in a gateway. A request leaves the agent, crosses the network, hits a proxy,&lt;br&gt;
and the proxy decides whether it is allowed. That architecture is fine for policy that belongs to&lt;br&gt;
a platform team. It is the wrong place for the loop that is actually spinning.&lt;/p&gt;

&lt;p&gt;The expensive thing in an agent run is not one call. It is the thirty calls the model makes after&lt;br&gt;
a tool starts failing, each one carrying a growing conversation. By the time a gateway notices,&lt;br&gt;
the bill is already written. A budget enforced in the same process as the loop can stop at call&lt;br&gt;
four, because it sees the same state the loop sees.&lt;/p&gt;

&lt;p&gt;Backstop intercepts the transport and enforces four things per provider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Token budget&lt;/strong&gt; — a hard ceiling on the run, not a warning in a dashboard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backpressure&lt;/strong&gt; — slow down before the provider does it for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retry policy&lt;/strong&gt; — bounded attempts with jitter, so a rate limit does not become a storm.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Circuit breaker&lt;/strong&gt; — trip on repeated failure instead of hammering a service that is down.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the control path costs
&lt;/h2&gt;

&lt;p&gt;A reliability layer that adds latency is its own outage. The honest measurement I have is the&lt;br&gt;
control path over an offline mock transport: &lt;strong&gt;p50 0.07 ms, p99 0.080 ms&lt;/strong&gt;, against a direct-call&lt;br&gt;
p99 of 0.261 ms in the same harness.&lt;/p&gt;

&lt;p&gt;Read that carefully. It is not a claim about a live OpenAI call — the mock transport exists so the&lt;br&gt;
overhead can be measured without confusing network variance with my own code. The live probe is&lt;br&gt;
opt-in, and the README marks exactly which numbers sit above the "Mechanism Checks" line.&lt;/p&gt;

&lt;p&gt;I would rather publish the caveat than a prettier graph.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why in-process is the right default
&lt;/h2&gt;

&lt;p&gt;The failure modes are all local:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A retry storm is a loop property, not a network property.&lt;/li&gt;
&lt;li&gt;A budget overrun is a conversation property.&lt;/li&gt;
&lt;li&gt;A breaker trip should happen before the call is serialised, not after it returns 429.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A gateway can enforce policy across teams. It cannot see your loop. For a single agent&lt;br&gt;
application, the cheapest correct place to put the brake is the call site.&lt;/p&gt;

&lt;p&gt;The code is at &lt;a href="https://github.com/RavaniRoshan/backstop" rel="noopener noreferrer"&gt;github.com/RavaniRoshan/backstop&lt;/a&gt;, the&lt;br&gt;
live decision-logic demo runs in the browser on the&lt;br&gt;
&lt;a href="https://roshan-s-digital-twin.vercel.app/s/backstop" rel="noopener noreferrer"&gt;case page&lt;/a&gt;, and the demo deployment is at&lt;br&gt;
&lt;a href="https://backinstop.vercel.app" rel="noopener noreferrer"&gt;backinstop.vercel.app&lt;/a&gt; — the spelling is the deployed name, not a&lt;br&gt;
typo in this post.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>reliability</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
