<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hemantho Darwin R on Medium]]></title>
        <description><![CDATA[Stories by Hemantho Darwin R on Medium]]></description>
        <link>https://medium.com/@hemanthodarwinr?source=rss-ca2bdefd4ce0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_MLPje6CZJHwVZBk</url>
            <title>Stories by Hemantho Darwin R on Medium</title>
            <link>https://medium.com/@hemanthodarwinr?source=rss-ca2bdefd4ce0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:56:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hemanthodarwinr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The allocators were fine. vLLM was leaking anyway.]]></title>
            <link>https://medium.com/@hemanthodarwinr/the-allocators-were-fine-vllm-was-leaking-anyway-63481cf16e22?source=rss-ca2bdefd4ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/63481cf16e22</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[vllm]]></category>
            <category><![CDATA[ai-production-systems]]></category>
            <category><![CDATA[h100]]></category>
            <category><![CDATA[vllm-serving]]></category>
            <dc:creator><![CDATA[Hemantho Darwin R]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 04:03:40 GMT</pubDate>
            <atom:updated>2026-09-10T04:03:40.002Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A production incident with malloc, UCX, and a circular reference bug buried inside vLLM’s garbage collector.</em></p><p>A few months ago I got pulled into a production incident that took most of a day and ended somewhere I genuinely didn’t expect: inside vLLM’s request lifecycle and Python’s garbage collector, on an H100 inference server taking 30 to 40 API calls a second.</p><p>The symptom was simple enough. RSS on our vLLM pods kept climbing. No ceiling, no plateau, just up. I spent a few hours on it, hit a wall, and did the only sensible thing left — reverted to the previous stable deployment to get production back on solid ground, then went looking for what had actually happened.</p><p>I ended up testing three different things before I found it: allocator and arena tuning, UCX memory registration settings, and finally the vLLM engine itself. Here’s what each one is, what I found, and where the fix actually turned out to live.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YvHmAR7B7nxrXt0stNJT4A.png" /><figcaption><em>The allocators look fine. The pod is dying anyway. Container RSS climbs to 98% in under two hours while allocator metrics barely move — a signature of a Python-level leak, not a malloc problem.</em></figcaption></figure><p><em>Previously in this series: if you’ve seen similar RSS growth on JVM pods — OOMKills with a healthy-looking heap — that’s a different root cause entirely. I wrote about that one here: “</em><a href="https://medium.com/@hemanthodarwinr/the-jvm-said-everything-was-fine-kubernetes-disagreed-36ff631131a7?sharedUserId=hemanthodarwinr"><em>The JVM Said Everything Was Fine. Kubernetes Disagreed.</em></a><em>”</em></p><h3>First: allocator and arena tuning</h3><p>I’d seen this pattern before on JVM pods — glibc’s default allocator holding freed memory inside arenas instead of handing it back to the OS, RSS climbing while everything inside the application looks completely fine. So that’s where I started here too.</p><p>I went through the usual suspects — glibc’s malloc, tcmalloc, jemalloc — along with arena restriction, trying to force more frequent cleanup of dead objects:</p><pre>env:<br>  - name: MALLOC_ARENA_MAX<br>    value: &quot;2&quot;</pre><p>This was the first thing I reached for because it was the cheapest option on the table: no rebuild, fully reversible, and I already had a mental model for how it should behave from the last time I’d chased something like this.</p><p>It didn’t work. RSS kept climbing at exactly the same rate regardless of which allocator or arena setting I used. In hindsight, I was pattern-matching to a fix I already knew instead of asking what was actually different about this stack before I started. Cost me real time, but it was cheap to rule out — one env var and a restart.</p><h3>Second: UCX memory registration</h3><p>With allocators off the table, I looked at what’s actually different about this stack versus a typical JVM service — H100 GPUs, and a tight CPU-to-GPU data path. That pointed me at UCX: Unified Communication X, the open-source communication framework running underneath NCCL, PyTorch, Ray, and vLLM for high-speed transfers over InfiniBand and RDMA.</p><p>UCX intercepts mmap() calls at the OS level to pin memory and register it directly with the network interface card — that&#39;s what makes zero-copy transfers possible in the first place. The theory: under a highly dynamic inference workload, with variable-sized tensors and KV cache transfers moving between nodes, UCX&#39;s internal memory-registration cache might just not be releasing memory back to the OS. This isn&#39;t a hunch — it&#39;s a documented failure mode. Teams like Mistral AI have written about RSS ballooning indefinitely from exactly this cause, until the host OOMs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBlINtFPqXeDgMuyqT-pRg.png" /><figcaption><em>The prime suspect that wasn’t. UCX’s registration cache looked like the obvious culprit — until the documented fix changed nothing.</em></figcaption></figure><p>The workaround is one environment variable:</p><pre>env:<br>  - name: UCX_MEM_MMAP_HOOK_MODE<br>    value: &quot;none&quot;</pre><p>This tells UCX to stop intercepting mmap() entirely and lets the kernel reclaim freed memory the normal way.</p><p>It also didn’t fix it. RSS kept growing at the same rate with the flag set. This one stung a bit more than the allocator dead end — it was a real, well-documented failure mode that matched our symptoms almost perfectly, right up until it didn’t move the needle at all. It did force me to actually understand the CPU-to-GPU data path instead of treating it as a black box, which was worth something even if the fix itself wasn’t.</p><h3>Third: the vLLM engine itself</h3><p>At this point both the system allocator and the GPU communication layer were ruled out. That left vLLM’s own engine code. I checked the version we were running — 0.15.0 — and went straight to the vLLM GitHub issue tracker, on the assumption that a project this widely used had almost certainly seen this exact symptom from someone else already.</p><p>It had. Issue #28726 laid out essentially the same investigation I’d just run — malloc, tcmalloc, jemalloc, all tried, all with real numbers attached, all inconclusive in the same way mine were. Following that thread led to the actual fix, landed in PR #34183.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J82Qn0VYp2EgEbfMOHT4SA.png" /></figure><p>The root cause was a circular reference bug tied to Python’s garbage collector. With prefix caching active, vLLM’s internal routing kept a lingering reference to completed Request objects. Because those objects were caught in a reference cycle, Python&#39;s GC couldn&#39;t deallocate them — so memory grew with every request processed, forever, regardless of any allocator or UCX setting, because the problem was never in either of those layers. The fix changed the request lifecycle and prefix-caching logic to explicitly break that circular reference the moment a generation completes, so the garbage collector could actually sweep it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tDvIeW41yxrr6nXnAm3cpg.png" /><figcaption><em>a finished request and the prefix cache point at each other, so GC never collects either. PR #34183 breaks the cycle</em></figcaption></figure><p>I also looked at PR #24964 and PR #27896, both touching memory and GC-related issues in the same area, but neither matched closely enough to what I was seeing, so I set them aside.</p><p>This is what actually fixed it. Upgrading from 0.15.0 to 0.16.0 resolved the RSS growth completely. And honestly, the GitHub issue tracker got me to root cause faster than two rounds of infrastructure-level tuning combined — it should have been an earlier stop, not the third one. A circular reference bug inside a garbage collector isn’t something any amount of external tuning was ever going to touch, but a version bump is about as low-risk a fix as you can ask for, once you know that’s what it is. It still needed validating post-upgrade, since a production inference engine version bump isn’t automatically zero-risk — but this one was clean.</p><h3>What I’d do differently</h3><p>Two of the three things I tried were both technically sound, well-documented approaches to real problems. They just weren’t <em>our</em> problem. The time spent ruling them out wasn’t wasted exactly — I understand this stack a lot better now than I did before the incident — but checking the issue tracker for a known, version-specific bug is cheaper than allocator and UCX testing combined, and I should have done it earlier.</p><p>If I’m debugging something like this again, the order I’d actually follow is: check the engine’s own issue tracker for the exact symptom first, especially on a widely-used open-source project where someone else has very likely already hit it. Only then move to allocator and arena tuning if there’s genuinely nothing there. And treat GPU communication layers like UCX as a real suspect specifically when the workload involves variable-sized tensors or cross-node transfers over InfiniBand or RDMA — not before.</p><p>Reverting bought us time during the incident, but it wasn’t the fix. Worth remembering those are two different things.</p><h3>Quick reference</h3><p>Allocator tuning:</p><pre>env:<br>  - name: MALLOC_ARENA_MAX<br>    value: &quot;2&quot;</pre><p>UCX workaround:</p><pre>env:<br>  - name: UCX_MEM_MMAP_HOOK_MODE<br>    value: &quot;none&quot;</pre><p>The actual fix:</p><pre>pip install vllm==0.16.0</pre><h3>Closing</h3><p>Neither of the first two fixes was a bad idea — they’re both real remedies for real, documented problems that look almost identical to what I was dealing with. But the actual bug lived one layer deeper than either of them: a circular reference between completed Request objects that Python&#39;s garbage collector couldn&#39;t clean up on its own, specifically when prefix caching was active. No allocator setting and no UCX flag was ever going to touch that. The fix was already sitting in the next release — I just hadn&#39;t looked there first.</p><p>If you’re running vLLM with prefix caching enabled, it’s worth checking your version. This was a real bug in 0.15.0, fixed in 0.16.0.</p><p>Anyone else running vLLM at similar request volumes hit this one? Curious whether you landed on the same PR or found a different path — drop it in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63481cf16e22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Agent Could Answer. It Still Couldn’t Do Anything.]]></title>
            <link>https://medium.com/@hemanthodarwinr/the-agent-could-answer-it-still-couldnt-do-anything-e188e01d7e8a?source=rss-ca2bdefd4ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e188e01d7e8a</guid>
            <category><![CDATA[graph-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[harness-engineering]]></category>
            <category><![CDATA[loop-engineering]]></category>
            <dc:creator><![CDATA[Hemantho Darwin R]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 09:25:59 GMT</pubDate>
            <atom:updated>2026-08-17T09:25:59.267Z</atom:updated>
            <content:encoded><![CDATA[<h4>Harness, loop, and graph engineering — what it actually takes to let an agent act, run on its own, and work with other agents. Part 2 of 2.</h4><h3>Introduction</h3><p>In <a href="https://medium.com/@hemanthodarwinr/the-prompt-was-perfect-the-answer-was-still-wrong-12a3af43c474?sharedUserId=hemanthodarwinr">Part 1</a>, I went through prompt and context engineering — the two layers most people already touch, even if they’d never call it that. Both get you a solid single-turn agent: good wording, good retrieval, good answers. But neither one says a thing about what happens once the agent needs to <em>act</em>, keep going without you watching, or hand work off to other agents.</p><p>That’s what the next three layers are actually for. Same running example as <a href="https://medium.com/@hemanthodarwinr/the-prompt-was-perfect-the-answer-was-still-wrong-12a3af43c474?sharedUserId=hemanthodarwinr">Part 1</a> — the food-delivery support agent picks up a real tool, an unattended retry loop, and eventually a small team of coordinating sub-agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aFzZuyu383Ep9DjJDQnnRA.png" /><figcaption><em>The five layers side by side, from wording to multi-agent coordination.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vMQvfEgsHzgjC6m4ZZFlsA.png" /><figcaption><em>The same five layers, nested. Each one sits inside the layer above it.</em></figcaption></figure><h3>The System Around the Model: Harness Engineering</h3><h3>What is it?</h3><p>Simplest way to put it: agent = model + harness. The harness is everything that isn’t the model’s weights — tools, execution environment, memory, sandboxing, verification checks, permission boundaries. It’s what decides whether an agent actually survives a real, long-running task or falls apart the first time something unexpected happens. Prompt and context engineering both live <em>inside</em> the harness, by the way — they’re pieces of it, not separate layers sitting next to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yVoRdkSma_6v6OnX8Zzulw.png" /><figcaption><em>The model is just the weights in the middle. Everything that lets it act safely sits around it.</em></figcaption></figure><pre>class RefundTool:<br>    MAX_AUTO_REFUND = 25.00<br>    def issue_refund(self, order_id: str, amount: float, reason: str) -&gt; dict:<br>        if amount &gt; self.MAX_AUTO_REFUND:<br>            return {&quot;status&quot;: &quot;pending_approval&quot;, &quot;reason&quot;: &quot;exceeds threshold&quot;}<br>        order = fetch_order(order_id)<br>        if not order.get(&quot;eligible_for_refund&quot;):<br>            return {&quot;status&quot;: &quot;denied&quot;, &quot;reason&quot;: &quot;order not eligible&quot;}<br>        result = payment_api.refund(order_id, amount)<br>        log_action(&quot;refund_issued&quot;, order_id, amount, reason)<br>        return {&quot;status&quot;: &quot;issued&quot;, &quot;refund_id&quot;: result[&quot;id&quot;]}</pre><h3>Pros 👍</h3><ul><li>A prompt is fragile, a harness isn’t — swap the model out underneath and your safety guarantees stay put</li><li>Permission limits and eligibility checks are structural here, not instructions the model could talk itself out of</li><li>One enterprise document-processing benchmark saw accuracy jump from roughly 36% to over 52% just from adding a proper harness — bigger than most raw model upgrades manage on their own</li><li>Gives you somewhere to actually verify things before they touch production</li></ul><h3>Cons 👎</h3><ul><li>This is real infrastructure work — sandboxing, permission tiers, verification loops don’t build themselves</li><li>Harnesses aren’t as neutral as they look — a model can get quietly dependent on the exact harness it was tuned around</li><li>More surface area to maintain than a prompt or a retrieval pipeline ever needed</li><li>Doesn’t decide when or how often the agent runs — that part’s still coming</li></ul><h3>Running Itself Over Time: Loop Engineering</h3><h3>What is it?</h3><p>Loop engineering is designing the system that prompts the agent, instead of you doing it by hand every time — cycles that run on their own, check their own progress, and keep going until they hit a real stop condition. You stop being the one typing the prompt and start being the one who designed the thing that types it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5jDuob8ARkXRfNCnH76v8w.png" /><figcaption><em>The cycle every agent already runs. The question is whether anyone designed the stop conditions on purpose.</em></figcaption></figure><pre>def resolve_ticket_loop(ticket_id: str, max_iterations: int = 5):<br>    for i in range(max_iterations):<br>        state = get_ticket_state(ticket_id)<br>        if state[&quot;status&quot;] == &quot;resolved&quot;:<br>            return state<br>        action = decide_next_action(state)<br>        result = execute_action(action)<br>        if result[&quot;error_type&quot;] == &quot;hard_blocker&quot;:<br>            escalate_to_human(ticket_id, result[&quot;reason&quot;])<br>            return {&quot;status&quot;: &quot;escalated&quot;, &quot;reason&quot;: result[&quot;reason&quot;]}<br>        update_ticket_state(ticket_id, result)<br>    escalate_to_human(ticket_id, &quot;exceeded max iterations&quot;)<br>    return {&quot;status&quot;: &quot;escalated&quot;, &quot;reason&quot;: &quot;iteration_cap&quot;}</pre><h3>Pros 👍</h3><ul><li>Models genuinely got a lot better at staying coherent over long stretches — one benchmark showed frontier models going from finishing ~1h40m tasks to 12-hour tasks in about a year, something like a 6x jump</li><li>Several coding-agent tools now ship native scheduled loops with cron-style recurrence, so the tooling’s finally caught up too</li><li>Frees you from having to babysit every single step of a long task</li><li>Good error triage means recoverable failures get handled without paging a human</li></ul><h3>Cons 👎</h3><ul><li>No termination condition, and the agent either runs forever or quits at a random point</li><li>Vague goals like “handle the queue better” just aren’t loopable — there’s no way for the agent to know it’s done</li><li>Unbounded retries quietly burn compute, hide bad assumptions, and create a mess to clean up later</li><li>A badly built loop is really just an expensive while statement wearing a costume</li></ul><h3>Coordinating More Than One Loop: Graph Engineering</h3><h3>What is it?</h3><p>Graph engineering means representing the whole agent system as an explicit graph — nodes that do work (agents, tools, deterministic functions, sometimes a human), edges that pass state between them. A single loop, if you think about it, is really just the smallest possible graph: one node with an edge pointing back at itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X6nJWdHQ7bmOMhGImGnVAA.png" /><figcaption><em>You declare the valid paths up front. A loop lets the agent choose its own; a graph doesn’t.</em></figcaption></figure><pre>def support_graph(ticket_id: str):<br>    ticket = get_ticket(ticket_id)<br>    category = route_ticket(ticket)<br>    if category == &quot;refund_request&quot;:<br>        result = refund_worker.handle(ticket)<br>        if result[&quot;status&quot;] == &quot;pending_approval&quot;:<br>            return human_approval_gate(ticket, result)<br>        return result<br>    elif category == &quot;late_delivery&quot;:<br>        return delivery_worker.handle(ticket)<br>    else:<br>        return general_worker.handle(ticket)</pre><h3>Pros 👍</h3><ul><li>Fixed paths and explicit checks at every node — something you can actually audit, unlike a loop roaming free</li><li>Genuinely earns its keep when roles diverge (a refund specialist isn’t a delivery specialist) or when steps can run safely in parallel</li><li>Protocols like Google’s Agent2Agent (A2A) are starting to standardize discovery and handoffs even across companies, not just within one codebase</li><li>You can mix routers — deterministic for the obvious cases, model-based where it’s genuinely ambiguous</li></ul><h3>Cons 👎</h3><ul><li>Most tasks don’t need this at all — a well-designed loop, or honestly just a solid harness, beats an over-engineered graph most of the time</li><li>Every routing decision that turns into a full LLM call instead of a cheap deterministic check adds real cost and latency</li><li>There’s a legitimate “graph engineering trap” going around — teams swap a simple, debuggable loop for a complex graph and end up with a bigger headache, not a smaller one</li><li>Requires more upfront design than a loop — you have to know your paths before you can declare them</li></ul><h3>Making the Right Choice</h3><h3>Add harness engineering when:</h3><ul><li>🎯 The agent needs to actually do something, not just talk</li><li>🔧 You need permission boundaries a prompt alone can’t enforce</li><li>💻 The model’s about to get anywhere near production</li><li>🔒 You want safety guarantees that survive a model upgrade</li></ul><h3>Add loop engineering when:</h3><ul><li>🌐 The task legitimately takes longer than one exchange</li><li>🔄 You want it running unattended, with an actual way to know it’s done</li><li>📦 You can state the goal concretely — not “do better,” something you can check</li><li>🖥️ You’ve already thought through what counts as recoverable vs. a hard stop</li></ul><h3>Add graph engineering when:</h3><ul><li>⚡ The roles genuinely diverge and one agent shouldn’t be doing all of it</li><li>🏭 Steps can run in parallel safely and you actually want that speed</li><li>🧠 You need a handoff trail you can audit later</li><li>💰 You’ve confirmed a single loop really isn’t enough — not just assumed it</li></ul><h3>Real-World Impact Considerations</h3><p>What actually shows up once teams are running this in production:</p><ul><li>Harness-level fixes solve things prompting simply can’t — one team rebuilding a coding agent for a newer model found it had started noticing its own context window filling up and taking shortcuts to compensate. That’s a harness fix, not a prompt tweak.</li><li>Loop-based orchestration was already showing up in high-volume production workflows before “loop engineering” was even a phrase anyone used</li><li>At least one project-management tool now ships recurring autonomous workflows — bug triage, docs upkeep — as a real product feature, not a demo</li><li>The honest consensus on graphs, from what I’ve seen: reach for one when roles genuinely diverge or you need an audit trail, not as your default starting architecture</li></ul><h3>Deployment Quick Start</h3><h3>Harness Setup</h3><pre>refund_tool = RefundTool()<br>result = refund_tool.issue_refund(order_id, amount=15.00, reason=&quot;late delivery&quot;)</pre><h3>Loop Setup</h3><pre>result = resolve_ticket_loop(ticket_id, max_iterations=5)</pre><h3>Graph Setup</h3><pre>result = support_graph(ticket_id)</pre><h3>Conclusion</h3><p>None of these three “wins” — they’re solving different problems at different scales. Harness engineering makes an agent safe to let loose. Loop engineering makes it capable of running without you standing over it. Graph engineering makes multiple agents work together without stepping on each other. And honestly, the biggest takeaway across both posts: most production agents never need to climb past layer three. A well-context-engineered prompt inside a decent harness is still the right call for most real work — the top of this stack is there for when you genuinely need it, not somewhere you default to.</p><h3>Quick Decision Guide</h3><ul><li>🔬 Agent just answers questions and never acts? You might not need a harness yet.</li><li>🌐 Agent needs to safely call real tools? Harness engineering, no way around it.</li><li>💬 Task runs longer than one exchange? Add loop engineering with a real stop condition.</li><li>🏭 Genuinely different roles, or you need an audit trail? That’s when a graph earns its complexity.</li><li>📈 Not sure yet? Start at harness plus loop. Only reach for a graph once a single loop has actually proven insufficient.</li></ul><h3>What’s Next?</h3><ul><li>📚 Go back and ask which of these five layers your own agent is actually missing — usually the fastest way to figure out why it’s failing</li><li>🧪 If you’re reaching for a graph, ask first whether a well-scoped loop would just do the job with less complexity</li><li>🔄 Worth revisiting this as models keep improving — longer coherent task horizons keep pushing what’s realistically viable at the loop layer</li></ul><p>That wraps the two-parter. <a href="https://medium.com/@hemanthodarwinr/the-prompt-was-perfect-the-answer-was-still-wrong-12a3af43c474?sharedUserId=hemanthodarwinr">Part 1</a> covered prompt and context engineering; this one covered harness, loop, and graph — all tracked through one running example that started as a single classification prompt and ended up as a small coordinated graph with its own approval gate.</p><p><em>Which layer is your agent actually missing? Curious what’s tripped you up in production — drop it in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e188e01d7e8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Prompt Was Perfect. The Answer Was Still Wrong.]]></title>
            <link>https://medium.com/@hemanthodarwinr/the-prompt-was-perfect-the-answer-was-still-wrong-12a3af43c474?source=rss-ca2bdefd4ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/12a3af43c474</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[context-engineering]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <dc:creator><![CDATA[Hemantho Darwin R]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 11:15:19 GMT</pubDate>
            <atom:updated>2026-08-11T11:15:19.508Z</atom:updated>
            <content:encoded><![CDATA[<h4>Prompt and context engineering get you a great answer. They still can’t make your agent act — that’s Part 2.</h4><h3>Introduction</h3><p>There’s a diagram that keeps making the rounds in AI engineering circles — five terms stacked on top of each other, each one supposedly making the last one obsolete: prompt engineering, context engineering, harness engineering, loop engineering, graph engineering. Part of me wants to write it off as buzzword inflation, and honestly, some of it probably is. But there’s something useful hiding under the naming trend — a decent way to figure out <em>why</em> your agent is actually failing. Is it the wording? The missing context? No safety rail? No stop condition? Or is it just missing an org chart?</p><p>This is Part 1 of a two-parter going through all five. Today: prompt and context engineering — the two layers most people already touch, whether or not they’d call it that. Part 2 gets into harness, loop, and graph engineering, which is where things get more interesting: what happens once an agent stops answering one question and starts running on its own for hours.</p><p>I’ll use the same running example across both posts so the stack actually feels like it’s building on itself — a support agent for a food-delivery app, getting a bit more capable at every layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aFzZuyu383Ep9DjJDQnnRA.png" /><figcaption>The five layers side by side, from wording to multi-agent coordination.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vMQvfEgsHzgjC6m4ZZFlsA.png" /><figcaption>The same five layers, nested. Each one sits inside the layer above it.</figcaption></figure><h3>The Foundation: Prompt Engineering</h3><h3>What is it?</h3><p>Prompt engineering is just shaping the wording, structure, and examples inside a single request to get a better answer out — few-shot examples, chain-of-thought instructions, format constraints, that kind of thing. It’s the most accessible layer by far. No infrastructure, nothing to deploy, just better words.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*78q9CT_71iNduokor5cv9A.png" /><figcaption>Everything the model has to work with lives inside a single request. Nothing outside it exists as far as the model’s concerned</figcaption></figure><pre>def classify_ticket(ticket_text: str) -&gt; str:<br>    prompt = f&quot;&quot;&quot;You are a support ticket classifier for a food-delivery app.<br><br>Classify into exactly one category:<br>- late_delivery<br>- wrong_order<br>- refund_request<br>- account_issue<br>- other<br>Example:<br>Ticket: &quot;My food arrived an hour late and cold.&quot;<br>Category: late_delivery<br>Ticket: &quot;{ticket_text}&quot;<br>Category:&quot;&quot;&quot;<br><br>    return call_llm(prompt)</pre><h3>Pros 👍</h3><ul><li>No infrastructure — just write better words and you’re done</li><li>Anyone can iterate on it, no code required</li><li>Genuinely moves the needle on things like classification and debugging</li><li>Fastest thing you can try when you’re still prototyping</li></ul><h3>Cons 👎</h3><ul><li>Only controls what you ask, not what the model can actually see</li><li>A great prompt still falls apart if the model has no idea what happened on a specific order</li><li>Nothing persists — no memory, no tools, no state between calls</li><li>You’ll hit a wall the moment someone expects a multi-turn, context-aware answer</li></ul><h3>The Next Layer: Context Engineering</h3><h3>What is it?</h3><p>Context engineering is about curating everything that ends up inside the model’s context window when it actually runs — retrieved docs, chat history, tool definitions, memory, whatever state matters — instead of fussing over the wording of one instruction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zWnZeeiRXKsiEofJPWKMOQ.png" /><figcaption>Four sources, re-ranked down to what actually matters, assembled fresh before every single call.</figcaption></figure><pre>def build_context(ticket_text: str, order_id: str) -&gt; dict:<br>    order_data = fetch_order(order_id)<br>    candidates = vector_search(ticket_text, top_k=50)<br>    relevant_docs = rerank(candidates, ticket_text, top_k=5)<br><br>    return {<br>        &quot;order&quot;: order_data,<br>        &quot;policy_snippets&quot;: relevant_docs,<br>        &quot;conversation_history&quot;: get_recent_messages(order_id, limit=5),<br>    }<br><br>def classify_ticket_with_context(ticket_text: str, order_id: str) -&gt; str:<br>    context = build_context(ticket_text, order_id)<br>    return call_llm(render_prompt(ticket_text, context))</pre><h3>Pros 👍</h3><ul><li>Retrieval plus re-ranking beats dumping everything into the prompt — 5 well-ranked chunks usually beat 50 raw ones</li><li>Keeps the agent from guessing which tool to use, which gets expensive fast when it guesses wrong</li><li>Protocols like MCP turn “get the model the right info” into something closer to a standard interface than a one-off integration</li><li>Runs fresh, before every single call, so it doesn’t go stale as things change</li></ul><h3>Cons 👎</h3><ul><li>More moving parts — a retrieval pipeline, a re-ranker, some assembly step you now have to maintain</li><li>Bad retrieval can actively hurt quality, not just fail to help — too much irrelevant context is its own problem</li><li>Still doesn’t get you an agent that can <em>act</em> on anything, just one that answers better</li><li>You need actual infrastructure now — a vector store, at minimum — that prompting alone never asked for</li></ul><h3>Making the Right Choice</h3><h3>Stick with prompt engineering when:</h3><ul><li>🎯 You’re still prototyping and don’t need real data in the loop yet</li><li>🔧 The task really is single-turn, no outside facts required</li><li>💻 You want to move fast and skip setting anything up</li><li>🔒 Whatever the model already knows is genuinely enough</li></ul><h3>Move to context engineering when:</h3><ul><li>🌐 The answer depends on facts the model has no way of knowing — order status, account state, current policy</li><li>🔄 People expect the conversation to actually remember things across turns</li><li>📦 You keep stuffing more into the prompt and the answers are getting worse, not better</li><li>🖥️ The agent needs to stay grounded in something that keeps changing</li></ul><h3>Real-World Impact Considerations</h3><p>A few things worth knowing, from teams who’ve clearly started treating this as its own discipline rather than just “better prompting”:</p><ul><li>Teams working on large, multi-repo codebases have started treating cross-file dependencies as a retrieval problem rather than a prompting one, building dedicated re-ranking pipelines instead of just writing longer prompts</li><li>Search infrastructure vendors are now shipping re-ranking and tool-curation tooling as its own product line, separate from prompt tooling, specifically for enterprise RAG</li><li>A 2026 survey on context-management practices found most data teams already planning dedicated infrastructure spend here in the next year — this stopped being “just a technique” a while ago</li></ul><p>Worth saying again because it trips people up: context engineering runs before <em>every</em> call. It’s not a system prompt you write once and forget about.</p><h3>Deployment Quick Start</h3><h3>Prompt-Only Setup</h3><pre>response = call_llm(f&quot;Classify this ticket: {ticket_text}&quot;)</pre><h3>Context-Engineered Setup</h3><pre>context = build_context(ticket_text, order_id)<br>response = call_llm(render_prompt(ticket_text, context))</pre><h3>Conclusion</h3><p>Neither layer beats the other — they’re just answering different questions. Prompt engineering gets you a well-phrased request. Context engineering gets that request grounded in facts the model couldn’t have known otherwise. Most real agents end up needing both, and most people figure that out the hard way — right around the moment a user asks something the prompt never accounted for.</p><h3>Quick Decision Guide</h3><ul><li>🔬 Just prototyping, no outside data needed? A good prompt is enough for now.</li><li>🌐 Need the agent grounded in real, changing facts? Time for context engineering.</li><li>💬 Quality dropping the more you add to the prompt? That’s your cue to move to retrieval and re-ranking instead.</li><li>📈 Not sure yet? Start with a solid prompt and add context the moment you hit a fact the model can’t already know.</li></ul><h3>What’s Next?</h3><ul><li>📚 Together, these two layers get you a genuinely strong single-turn agent — good wording, good retrieval, good answers</li><li>🧪 What they don’t get you is an agent that can <em>act</em> — call a real API, remember something across days, or keep working while you’re not watching</li><li>🔄 That’s exactly what Part 2 covers: harness engineering (the system around the model), loop engineering (running itself over time), and graph engineering (coordinating more than one agent)</li></ul><p><em>Part 2 picks up with this same support agent — now with a sandboxed refund tool, an unattended retry loop, and eventually a small team of coordinating sub-agents.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12a3af43c474" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The JVM Said Everything Was Fine. Kubernetes Disagreed.]]></title>
            <link>https://medium.com/@hemanthodarwinr/the-jvm-said-everything-was-fine-kubernetes-disagreed-36ff631131a7?source=rss-ca2bdefd4ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/36ff631131a7</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[jvm]]></category>
            <category><![CDATA[malloc]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ak]]></category>
            <dc:creator><![CDATA[Hemantho Darwin R]]></dc:creator>
            <pubDate>Fri, 07 Aug 2026 04:53:04 GMT</pubDate>
            <atom:updated>2026-08-07T04:53:04.740Z</atom:updated>
            <content:encoded><![CDATA[<h4>A production incident with glibc arenas, jemalloc, and container-aware JVM flags</h4><h3>Introduction</h3><p>A few months ago I got pulled into a production incident that ate an entire day: Java pods kept getting OOMKilled, and every dashboard I pulled up said the heap was fine. -Xmx was sized correctly. Heap usage was stable. Metaspace wasn&#39;t growing. Kubernetes killed the pods anyway.</p><p>I ended up testing three different fixes to chase this down — glibc arena tuning, jemalloc, and JVM container-alignment flags. Only one of them I actually got to run in production that day; the other two I evaluated and either applied or shelved for later. Here’s what each one is, what I found, and what actually stopped the bleeding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6mYT89_2jg3CaBzoASqhtA.png" /><figcaption>Heap flat the whole time. RSS climbing the whole time. Kubernetes only ever looks at the second line.</figcaption></figure><h3>The First Lever: glibc Arena Tuning</h3><h3>What is it?</h3><p>Java’s native memory (everything outside the heap) gets allocated through glibc malloc by default on most Linux distros, including the AKS nodes I was running on. glibc spreads that allocation across multiple “arenas,” typically scaling with thread count — and freed memory often stays parked inside an arena instead of going back to the OS. That’s what was quietly inflating my RSS while every JVM metric looked calm.</p><pre>env:<br>  - name: MALLOC_ARENA_MAX<br>    value: &quot;2&quot;</pre><p>This was the first thing I tried, purely because it was the cheapest — one env var, no image rebuild, fully reversible if it did nothing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r4vwfrdodqOdRz7P6LErmw.png" /><figcaption>The JVM only ever reports on the blue slice. Kubernetes counts all three.</figcaption></figure><h3>Pros 👍</h3><ul><li>One-line env var — I didn’t have to rebuild or redeploy the image</li><li>Fully reversible in seconds, which mattered mid-incident</li><li>Directly targets the actual cause of the RSS creep I was seeing</li><li>Made a visible difference almost immediately — arena count stopped exploding and the RSS curve flattened</li></ul><h3>Cons 👎</h3><ul><li>Didn’t fully solve it on its own — the growth slowed, it didn’t stop</li><li>Setting it too aggressively low can hurt allocation performance under heavy concurrency (I stuck with 2, didn’t push lower)</li><li>Felt like a mitigation, not the root cause — which turned out to be correct</li></ul><h3>The Second Lever: Jemalloc</h3><h3>What is it?</h3><p>Jemalloc is a drop-in allocator replacement for glibc. It handles fragmentation better and is far more aggressive about actually returning freed memory to the OS instead of hoarding it.</p><pre>RUN apt-get update &amp;&amp; apt-get install -y libjemalloc2</pre><pre>env:<br>  - name: LD_PRELOAD<br>    value: /usr/lib/x86_64-linux-gnu/libjemalloc.so.2</pre><p>I looked into this one seriously, but hit a wall — the JDK base image I was running (from Quay) didn’t have it available, and swapping base images wasn’t something I was going to do in the middle of a live incident.</p><h3>Pros 👍</h3><ul><li>Returns memory to the OS far more aggressively than glibc</li><li>Better fragmentation handling under sustained allocation churn</li><li>No application code changes — it’s a preload, not a dependency</li><li>The strongest option on paper for high-throughput, heavily multi-threaded services</li></ul><h3>Cons 👎</h3><ul><li>Requires the package to actually exist in your base image — mine didn’t have it</li><li>Adds a build step, which isn’t something you want to introduce mid-incident</li><li>I couldn’t validate it in the moment, so it’s still an open question for this specific setup</li><li>More moving parts to reason about later if something else goes wrong</li></ul><p><em>I ended up shelving this one for a proper eval later, outside the pressure of an active incident.</em></p><h3>The Third Lever: JVM Configuration Alignment</h3><h3>What is it?</h3><p>This is the one that, in hindsight, I should have checked first. Without container-aware sizing, the JVM can size itself against host memory instead of the container’s actual limit — leaving no real headroom for native memory, Metaspace, or thread stacks.</p><pre>-XX:MaxRAMPercentage=70<br>-XX:InitialRAMPercentage=50<br>-XX:+UseContainerSupport</pre><p>Component % of container memory JVM Heap 60–70% Metaspace + Threads 10–15% Native / libc / buffers 15–25%</p><p>Once I applied this alongside the arena cap, the picture stabilized completely — RSS growth flattened out and the OOMKills stopped.</p><h3>Pros 👍</h3><ul><li>This is the fix that, combined with arena tuning, actually stopped the OOMKills</li><li>Standard, well-documented JVM flags — nothing exotic or risky</li><li>Applies no matter which allocator I end up using later</li><li>Made every other lever more effective once it was in place</li></ul><h3>Cons 👎</h3><ul><li>Doesn’t stop native memory hoarding by itself — it just leaves the right amount of room for it</li><li>I had to actually know the container’s real memory limit, not just guess at -Xmx</li><li>The 60/15/25 split is a rule of thumb — I’d expect it to shift some depending on the workload</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1x9daY4JkyJD03ZH7HWuQ.png" /><figcaption><em>Arena tuning bought time. Jemalloc got shelved. JVM alignment is what actually ended it.</em></figcaption></figure><h3>Making the Right Choice</h3><h3>Reach for arena tuning when:</h3><ul><li>🎯 You need something fast and reversible, right now, mid-incident</li><li>🔧 You can’t rebuild the image on short notice</li><li>💻 RSS creep is moderate, and you want quick signal before doing anything bigger</li><li>🔒 You want a change you can undo in seconds if it doesn’t help</li></ul><h3>Reach for jemalloc when:</h3><ul><li>🌐 Arena tuning alone doesn’t fully flatten the curve</li><li>🔄 You’re running high-throughput or heavily multi-threaded services</li><li>📦 You’ve actually confirmed your base image supports it — check before you plan around it</li><li>🖥️ You have room to evaluate it outside the pressure of an active incident</li></ul><h3>Fix JVM alignment when:</h3><ul><li>⚡ You haven’t checked this yet — genuinely, start here next time</li><li>🏭 -Xmx was sized against host memory instead of the container limit</li><li>🧠 You’re seeing OOMKills with heap nowhere near its ceiling — that was my exact situation</li><li>💰 You want the one change that makes every other lever actually work</li></ul><h3>Real-World Performance Considerations</h3><p>What I actually observed, in order, on the day:</p><ul><li>MALLOC_ARENA_MAX=2 slowed the RSS climb almost immediately — first real signal in hours of debugging</li><li>Container-aware JVM flags, once added, were what actually stopped the OOMKills — not arena tuning alone</li><li>jemalloc stayed untested — the theoretical upside is real, but I have no production numbers to back it for this setup yet</li><li>The biggest lesson wasn’t a number at all: heap being flat while RSS climbs is not a “heap investigation” anymore, it’s a “what else lives in this container” investigation</li></ul><p>Worth saying plainly: I didn’t get a clean, single silver-bullet fix. It was the arena cap and the JVM flags together that closed it out.</p><h3>Deployment Quick Start</h3><h3>Arena Tuning Deployment</h3><pre>env:<br>  - name: MALLOC_ARENA_MAX<br>    value: &quot;2&quot;</pre><h3>Jemalloc Deployment (evaluated, not yet run)</h3><pre>RUN apt-get update &amp;&amp; apt-get install -y libjemalloc2</pre><pre>env:<br>  - name: LD_PRELOAD<br>    value: /usr/lib/x86_64-linux-gnu/libjemalloc.so.2</pre><h3>JVM Alignment Deployment</h3><pre>-XX:MaxRAMPercentage=70<br>-XX:InitialRAMPercentage=50<br>-XX:+UseContainerSupport</pre><h3>Conclusion</h3><p>None of these three was “the” fix on its own. Arena tuning bought me the first real signal of the day. JVM alignment was the one that actually stopped the OOMKills, and in hindsight should have been where I started, not where I ended up. Jemalloc stayed on the shelf, not because it’s wrong, but because I couldn’t validate it under incident pressure with the base image I had. Real production memory issues rarely have a single lever — they have a combination, discovered in the wrong order under time pressure, and fixed in whatever order the constraints of the moment allow.</p><h3>Quick Decision Guide</h3><ul><li>🔬 Seeing OOMKills with a healthy-looking heap? Check JVM container-awareness first — I didn’t, and paid for it in hours.</li><li>🌐 Need a fast, reversible first move mid-incident? MALLOC_ARENA_MAX=2.</li><li>💬 Still seeing RSS creep after that, and have time to evaluate properly? Look at jemalloc — check your base image first.</li><li>🏭 Not sure what’s driving it? Watch container_memory_working_set_bytes against JVM heap side by side before touching anything.</li><li>📈 Rolling a fix out for real? One lever at a time, so you actually know what worked — I didn’t have that luxury mid-incident, but you should give yourself that luxury when you’re not on fire.</li></ul><h3>What’s Next?</h3><ul><li>📚 Check whether your base image actually ships jemalloc before you plan around it — that gap cost me an option mid-incident</li><li>🧪 If you haven’t verified -XX:+UseContainerSupport is in your JVM flags, do that before anything else — it&#39;s the cheapest check with the highest odds of being your actual root cause</li><li>🔄 I’m circling back to properly test jemalloc outside the pressure of an incident — will update if the numbers say it’s worth adding on top of what’s already working</li></ul><p>The pod that gets OOMKilled with a “healthy” heap almost always has a native memory story behind it, not a JVM one. Took me a day to learn that the hard way.</p><p><em>Has anyone else chased this down in their own clusters? Curious how long it took you to figure out it wasn’t a heap problem — drop it in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36ff631131a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[vLLM vs Ollama vs SGLang vs TensorRT-LLM: Choosing the Right LLM Serving Solution in 2026]]></title>
            <link>https://medium.com/@hemanthodarwinr/vllm-vs-ollama-vs-sglang-vs-tensorrt-llm-choosing-the-right-llm-serving-solution-in-2026-d0b0f138c78e?source=rss-ca2bdefd4ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0b0f138c78e</guid>
            <category><![CDATA[vllm]]></category>
            <category><![CDATA[sglang]]></category>
            <category><![CDATA[tensorrt-llm]]></category>
            <category><![CDATA[nvidia]]></category>
            <category><![CDATA[ollama]]></category>
            <dc:creator><![CDATA[Hemantho Darwin R]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 05:42:36 GMT</pubDate>
            <atom:updated>2026-08-05T05:42:36.561Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>If you’ve ever gone from “the model works great in my notebook” to “why does everything fall over the moment two people hit the endpoint,” you already know why this post exists. Picking a serving engine isn’t glamorous work, but it’s one of those decisions that quietly decides whether your GPU bill makes sense and whether your users get an answer in 2 seconds or 20.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R6oKgUKSes4chNQo40kB4Q.png" /><figcaption>Fine at 1 user, shaky at 3, dead at 4. This is the moment every</figcaption></figure><p>I’ve spent time with all four of the engines below — Ollama, vLLM, SGLang, and TensorRT-LLM — and each one is opinionated about what it optimizes for. None of them is “the best.” They’re just built for different jobs. Let’s go through each one, what it’s actually good at, and where it’ll let you down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vz-yuTo_WH68l-KUnzjg7A.png" /><figcaption>Same problem, four different fixes: queue it, page it, cache it,</figcaption></figure><h3>The Local-First Approach: Ollama</h3><h3>What is it?</h3><p>Ollama is the one most people try first, honestly. You install it, run a command, and a model is answering questions on your laptop a minute later. No CUDA drivers to fight with, no Docker Compose file to debug at 11pm.</p><p>📖 Docs: <a href="https://docs.ollama.com/">https://docs.ollama.com</a></p><pre># One command. No CUDA setup, no Docker, no Python env.<br>ollama run llama3.1</pre><pre>from openai import OpenAI<br>client = OpenAI(base_url=&quot;http://localhost:11434/v1&quot;, api_key=&quot;not-needed&quot;)<br>response = client.chat.completions.create(<br>    model=&quot;llama3.1&quot;,<br>    messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Explain KV caching in one paragraph.&quot;}]<br>)</pre><h3>Pros 👍</h3><ul><li>Genuinely the fastest way to get a model running — minutes, not hours</li><li>Works on basically anything: NVIDIA, AMD, Apple Silicon, or plain CPU</li><li>Speaks the OpenAI API, so swapping it into existing code is trivial</li><li>No per-token cost once you own the hardware</li></ul><h3>Cons 👎</h3><ul><li>It handles one request at a time — there’s no real batching under the hood</li><li>Throughput just doesn’t move much no matter how much traffic you throw at it</li><li>A handful of concurrent users is enough to make latency ugly</li><li>It’s a single-machine tool; there’s no built-in way to scale it out</li></ul><h3>The Production Default: vLLM</h3><h3>What is it?</h3><p>Once a team outgrows Ollama, vLLM is usually where they land. The whole reason it exists is a technique called PagedAttention, which borrows an old idea from operating systems: instead of reserving one big, mostly-empty chunk of memory per request, it splits the KV cache into small pages and hands them out as needed. Sounds simple, but it’s the difference between wasting most of your GPU memory and actually using it.</p><p>📖 Docs: <a href="https://docs.vllm.ai/">https://docs.vllm.ai</a></p><pre># Launching an OpenAI-compatible server<br>vllm serve meta-llama/Llama-3.1-70B-Instruct --tensor-parallel-size 4</pre><pre>from openai import OpenAI<br>client = OpenAI(base_url=&quot;http://localhost:8000/v1&quot;, api_key=&quot;not-needed&quot;)<br>response = client.chat.completions.create(<br>    model=&quot;meta-llama/Llama-3.1-70B-Instruct&quot;,<br>    messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Summarize PagedAttention.&quot;}]<br>)</pre><h3>Pros 👍</h3><ul><li>PagedAttention brings wasted GPU memory down from something like 60–80% to under 5%</li><li>Runs on almost anything — NVIDIA, AMD, Intel, TPUs, Trainium</li><li>Keeps GPUs genuinely busy (85–92% utilization) even under heavy concurrent load</li><li>The ecosystem around it is mature at this point: multi-LoRA, speculative decoding, all the production niceties</li></ul><h3>Cons 👎</h3><ul><li>It doesn’t notice when two requests share the same context — no reuse, just recomputation</li><li>Time-to-first-token can lag behind the others when things get really busy</li><li>It’s a generalist, which means it won’t beat something purpose-built for your exact workload</li></ul><h3>The Context-Aware Engine: SGLang</h3><h3>What is it?</h3><p>SGLang takes a different bet entirely. Its trick, RadixAttention, keeps a tree of prompt prefixes it’s already processed, so when a new request starts the same way — same system prompt, same uploaded doc, same earlier turns in a conversation — it just skips recomputing that part. It’s less about squeezing memory and more about not doing the same work twice.</p><p>📖 Docs: <a href="https://docs.sglang.io/">https://docs.sglang.io</a></p><pre># Launching an OpenAI-compatible server<br>python -m sglang.launch_server --model meta-llama/Llama-3.1-70B-Instruct --port 30000</pre><pre>from openai import OpenAI<br>client = OpenAI(base_url=&quot;http://localhost:30000/v1&quot;, api_key=&quot;not-needed&quot;)<br>response = client.chat.completions.create(<br>    model=&quot;meta-llama/Llama-3.1-70B-Instruct&quot;,<br>    messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;What is RadixAttention?&quot;}]<br>)</pre><h3>Pros 👍</h3><ul><li>RadixAttention reuses cached work across requests that share a prefix — chat history, shared docs, system prompts</li><li>Cache hit rates land around 75–95% on real chat and agent traffic, which is a lot of skipped compute</li><li>Structured output (JSON, XML) is faster because validation happens against a state machine in parallel, not token by token</li><li>It’s not experimental anymore — plenty of production chat and coding products run on it</li></ul><h3>Cons 👎</h3><ul><li>If your traffic is all one-off, unique prompts, that prefix-sharing advantage just doesn’t show up</li><li>Smaller community than vLLM’s, and it covers fewer model architectures</li><li>Basically all of its upside depends on your requests actually overlapping with each other</li></ul><h3>The Hardware-Optimized Engine: TensorRT-LLM</h3><h3>What is it?</h3><p>This is NVIDIA’s own answer, and it’s the most specialized of the bunch. Instead of running your model as-is, it compiles it into an execution plan built for the exact GPU you’re deploying on. That specificity is where the speed comes from — and also where the friction comes from.</p><p>📖 Docs: <a href="https://nvidia.github.io/TensorRT-LLM">https://nvidia.github.io/TensorRT-LLM</a></p><pre># Model must be compiled before serving — this step can take 20-30+ minutes on an H100<br>trtllm-build --checkpoint_dir ./model_checkpoint \<br>    --output_dir ./compiled_engine \<br>    --gemm_plugin float16</pre><h3>Pros 👍</h3><ul><li>Typically 15–30% faster than vLLM on H100s — a real, measurable gap</li><li>Speculative decoding built in, sometimes pushing generation up to 3.6x faster</li><li>Fits naturally into an existing NVIDIA stack — Triton, NIM, Dynamo</li><li>Quantization (FP8/INT8/FP4) is tuned specifically for Tensor Cores, not bolted on</li></ul><h3>Cons 👎</h3><ul><li>Every time you swap models or update weights, you’re recompiling — that’s not a five-minute job</li><li>NVIDIA hardware only. No AMD, no Apple Silicon, no TPUs, no exceptions</li><li>Getting from zero to a working deployment realistically takes a week or two if your team isn’t already fluent in Triton and CUDA</li></ul><h3>Making the Right Choice</h3><h3>Choose Ollama when:</h3><ul><li>🎯 You’re prototyping or just want something running locally</li><li>🔧 Setup time matters more than raw performance</li><li>💻 You’re serving one person, or a small internal tool</li><li>🔒 Data can’t leave the machine, so a hosted API is off the table</li></ul><h3>Choose vLLM when:</h3><ul><li>🌐 You want a solid, general-purpose default that won’t paint you into a corner</li><li>🔄 You’re on mixed hardware or multiple clouds</li><li>📦 Your traffic doesn’t have one dominant pattern</li><li>🖥️ Broad compatibility matters more than squeezing out the last 20% of throughput</li></ul><h3>Choose SGLang when:</h3><ul><li>💬 You’re building a chatbot or an agent with multi-turn conversations</li><li>📚 A lot of your traffic touches the same documents (classic RAG situation)</li><li>🧩 You need JSON or structured output to come back fast and valid</li><li>♻️ Requests genuinely share context with each other</li></ul><h3>Choose TensorRT-LLM when:</h3><ul><li>⚡ Throughput on NVIDIA hardware is the whole point</li><li>🏭 You’re running one model, stably, at real scale, for a long time</li><li>🧠 Your team already knows its way around Triton and CUDA</li><li>💰 The performance gain is worth the lock-in and the setup cost</li></ul><h3>Real-World Performance Considerations</h3><p>A few numbers that are worth keeping in your head, all from load testing under concurrent traffic on comparable hardware:</p><ul><li>Ollama’s throughput basically plateaus no matter how much traffic you add, because it’s still working through requests one at a time</li><li>vLLM pushes GPU utilization into the 85–92% range under heavy load, which is a big jump over naive serving code</li><li>SGLang comes out roughly 29% ahead of vLLM specifically when requests share context, with output generation running over 2x faster in that scenario</li><li>TensorRT-LLM runs 15–30% faster than vLLM on H100s, and on the newest Blackwell chips it’s crossed 1,000 tokens/second per user for large models</li></ul><p>Worth repeating: none of these numbers travel well across workload types. The engine that wins on shared-context chat traffic can easily lose on a batch job full of one-off prompts. Benchmark on your own traffic before you trust anyone else’s numbers, including mine.</p><h3>Deployment Quick Start</h3><h3>Ollama Deployment</h3><pre># Local, single command<br>curl -fsSL https://ollama.com/install.sh | sh<br>ollama run llama3.1</pre><h3>vLLM Deployment</h3><pre>pip install vllm<br>vllm serve meta-llama/Llama-3.1-70B-Instruct --tensor-parallel-size 4</pre><h3>SGLang Deployment</h3><pre>pip install &quot;sglang[all]&quot;<br>python -m sglang.launch_server --model meta-llama/Llama-3.1-70B-Instruct --port 30000</pre><h3>TensorRT-LLM Deployment</h3><pre># Using Docker + NVIDIA&#39;s build toolchain<br>docker run --gpus all -it nvcr.io/nvidia/tensorrt_llm/release:latest<br>trtllm-build --checkpoint_dir ./model_checkpoint --output_dir ./compiled_engine</pre><h3>Conclusion</h3><p>None of these four is “the winner.” Ollama gets you moving fastest. vLLM is the safe, general-purpose choice that won’t lock you into anything. SGLang pays off hard if your traffic shares context. TensorRT-LLM is the one you reach for when you’ve already committed to NVIDIA and need every bit of throughput it can give you. The right pick really does come down to what your traffic actually looks like, not which tool has the flashiest benchmark chart.</p><h3>Quick Decision Guide</h3><ul><li>🔬 Just starting out or prototyping? Ollama.</li><li>🌐 Need a dependable default across different hardware? vLLM.</li><li>💬 Chat, RAG, or agents with repeated context? SGLang.</li><li>🏭 Need max throughput on a stable NVIDIA setup? TensorRT-LLM.</li><li>📈 Not sure yet? Start on Ollama locally, then move to vLLM or SGLang once you’re in production.</li></ul><h3>What’s Next?</h3><ul><li>📚 Go read the docs for whichever one actually fits your situation</li><li>🧪 Run your own benchmark with your own model and your own traffic — published numbers are a starting point, not a guarantee</li><li>🔄 Don’t rule out running more than one. Plenty of teams use SGLang for chat traffic and vLLM for batch jobs on the same model.</li></ul><p>The engine that matches your actual traffic pattern will beat the one with the better headline number almost every time.</p><p><em>Which of these are you running in production? Curious to hear what’s worked (or not) for you — drop it in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0b0f138c78e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NVIDIA RTX Spark: The Laptop That Just Made Your CPU Irrelevant]]></title>
            <link>https://medium.com/@hemanthodarwinr/nvidia-rtx-spark-the-laptop-that-just-made-your-cpu-irrelevant-8d9b7e0cbc99?source=rss-ca2bdefd4ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d9b7e0cbc99</guid>
            <category><![CDATA[cuda]]></category>
            <category><![CDATA[nvidia]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[apple-m4]]></category>
            <category><![CDATA[ai-computing]]></category>
            <dc:creator><![CDATA[Hemantho Darwin R]]></dc:creator>
            <pubDate>Tue, 02 Jun 2026 06:07:54 GMT</pubDate>
            <atom:updated>2026-06-02T06:08:22.331Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KWfd7EZ77PzjCQvP1RSq9w.jpeg" /></figure><h3>A year ago, I warned you NVIDIA was rewriting the rules of computing. Almost no one listened. Now the proof is sitting in a laptop.</h3><p><em>Before you read this — I published a deep-dive on the </em><a href="https://medium.com/@hemanthodarwinr/nvidia-dgx-spark-redefining-compact-ai-supercomputing-for-the-next-era-e47db09b2d92"><em>NVIDIA DGX Spark</em></a><em> about a year ago. It didn’t get much traction. That’s okay. But if you had read it, what I’m about to tell you would feel less like a surprise and more like an inevitability. Because NVIDIA isn’t just making graphics cards anymore — they’re quietly taking over the entire compute stack.</em></p><h3>The Quiet Revolution Nobody Saw Coming</h3><p>When Apple launched the M1 chip in 2020, the tech world had a collective meltdown. Unified memory. ARM architecture. A chip that didn’t need a discrete GPU because it <em>was</em> the GPU. Benchmarks that embarrassed Intel. Developers who swore they’d never leave x86 suddenly became Apple converts overnight.</p><p>The narrative became cemented: <strong>Apple Silicon = the future of personal computing.</strong></p><p>NVIDIA just said: <em>hold my VRAM.</em></p><p>The <strong>NVIDIA RTX Spark</strong> is not just a new laptop chip. It’s NVIDIA’s declaration that the CPU-centric era of computing is over — and that they intend to run the new one.</p><h3>What Exactly Is the RTX Spark?</h3><p>The RTX Spark is NVIDIA’s first-ever fully integrated system-on-chip (SoC) designed specifically for <strong>laptop AI workloads</strong>. Think of it as NVIDIA’s answer to Apple’s M-series — but built from the GPU up, not the CPU up.</p><p>Here’s what makes it fundamentally different from every other laptop chip on the market:</p><h3>🔹 Unified Memory Architecture — Done the NVIDIA Way</h3><p>Apple’s M4 chips are celebrated for their unified memory — where CPU and GPU share the same memory pool, eliminating costly data transfers between chips. NVIDIA’s RTX Spark does the same, but the emphasis is inverted.</p><p>On Apple Silicon, the CPU is the king and the GPU is a very capable guest.</p><p>On the RTX Spark, <strong>the GPU is the king.</strong> The entire memory architecture is designed around GPU throughput — massive bandwidth, low latency, optimized for tensor operations. For AI inference and generation tasks, this isn’t a marginal improvement. It’s a categorical one.</p><h3>🔹 No CPU Dependency</h3><p>This is the part that should make Intel, AMD, and Qualcomm nervous.</p><p>Traditional laptop chips — even the best ones from AMD and Qualcomm — are fundamentally CPU chips with GPU units bolted on. The CPU orchestrates everything. The GPU is a tool the CPU delegates to.</p><p>The RTX Spark flips this model. NVIDIA has built enough CPU compute into the SoC to handle the system — but the <strong>GPU is doing the orchestration for AI workloads.</strong> You don’t need a powerful host CPU. You don’t need to pair this with an Intel Core Ultra or a Snapdragon X Elite. The Spark is designed to run AI pipelines end-to-end, on-chip, without bottlenecking at the CPU.</p><p>For AI developers, researchers, and creators running local LLMs, image generation, or video processing — this matters enormously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbaX7lQQ9aWg94npoLYiSA.jpeg" /><figcaption>Unified memory architecture — CPU vs GPU-first</figcaption></figure><h3>🔹 Tensor Cores + DLSS 4 + RTX Neural Rendering</h3><p>The RTX Spark isn’t just an AI inference chip — it’s also a next-generation gaming and creative chip. NVIDIA’s Blackwell-generation Tensor Cores power:</p><ul><li><strong>DLSS 4 with Multi-Frame Generation</strong> — generating multiple frames per single rendered frame, delivering desktop-class framerates on a laptop</li><li><strong>RTX Neural Shading</strong> — where entire rendering passes are replaced by neural networks running on Tensor Cores</li><li><strong>AI-accelerated video</strong>: real-time 4K upscaling, noise reduction, and RTX Video HDR</li></ul><p>This is a chip that can run a 7B parameter LLM locally <em>and</em> play Cyberpunk 2077 at 120fps. In a laptop. Unplugged.</p><h3>Head-to-Head: RTX Spark vs. The Competition</h3><p>Let’s be direct about who this chip is competing with and why it changes the calculus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y14qms1l9L2gKNNmB9lj6Q.jpeg" /><figcaption>AI TOPS benchmark chart</figcaption></figure><h3>vs. Apple M4</h3><p>Feature Apple M4 NVIDIA RTX Spark Unified Memory ✅ Up to 32GB ✅ Up to 32GB+ AI Performance (TOPS) ~38 TOPS (NPU) <strong>~1,000+ TOPS (GPU Tensor Cores)</strong> Local LLM inference Good Exceptional Gaming performance Moderate Desktop-class Software ecosystem macOS only Windows + Linux CUDA ecosystem ❌ None ✅ Full</p><p>Apple’s M4 is an engineering marvel. But for AI workloads, the NPU in Apple Silicon simply cannot match what dedicated Tensor Cores with full CUDA support can do. The RTX Spark runs the same software stack as NVIDIA’s data center GPUs — every model on Hugging Face, every framework from PyTorch to TensorRT, every tool in the CUDA ecosystem.</p><h3>vs. Qualcomm Snapdragon X Elite</h3><p>Qualcomm made a bold move into Windows AI laptops with the Snapdragon X Elite — and it’s genuinely impressive for battery life and efficiency. But its NPU, while capable of ~45 TOPS, hits a wall the moment you try to run anything beyond basic inference.</p><p>The RTX Spark outperforms it on AI tasks by an order of magnitude, while also delivering GPU rendering capabilities that Snapdragon simply doesn’t have.</p><h3>vs. Intel Core Ultra (Lunar Lake / Arrow Lake)</h3><p>Intel has been pivoting hard toward AI with its integrated NPU in the Core Ultra series. The Arc GPU inside is a real improvement. But integrated graphics is still integrated graphics. For any serious AI workload or GPU-accelerated task, the RTX Spark isn’t competing with Intel — it’s in a different category entirely.</p><h3>vs. AMD Ryzen AI</h3><p>AMD’s Ryzen AI lineup is legitimately competitive in traditional CPU workloads and even in some GPU tasks. But AMD’s discrete laptop GPU story is complicated by the same issue: they’re CPU companies that make GPUs. NVIDIA is a GPU company that added enough CPU to close the loop.</p><h3>Why This Matters Beyond Specs</h3><h3>The DGX Spark Vision, Made Personal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dXDNd4MkLblR2usBRunWNw.jpeg" /><figcaption>NVIDIA’s 20-year strategy timeline</figcaption></figure><p>A year ago, I wrote about the <a href="https://medium.com/@hemanthodarwinr/nvidia-dgx-spark-redefining-compact-ai-supercomputing-for-the-next-era-e47db09b2d92">NVIDIA DGX Spark</a> — a compact personal AI supercomputer that NVIDIA positioned as a “desktop data center.” At the time, it felt like a product for researchers and AI labs.</p><p>The RTX Spark is that same vision, compressed into a laptop.</p><p>NVIDIA has been executing a deliberate strategy: <strong>bring data center-class AI compute down the stack.</strong> From H100 clusters → to DGX Spark desktops → to RTX Spark laptops. Each generation, the compute gets smaller, cheaper, and more personal — but the software stack remains identical.</p><p>This is not accidental. This is Jensen Huang’s long game, playing out exactly as architected.</p><h3>Local AI is Becoming Real</h3><p>For the past two years, “AI” on a laptop meant a marketing badge and a gimmick NPU that could run Windows Studio Effects. The RTX Spark changes that story.</p><p>With 32GB of unified memory and full Tensor Core throughput, you can now run:</p><ul><li><strong>Llama 3 70B</strong> — locally, privately, no API keys</li><li><strong>Stable Diffusion XL</strong> with real-time preview</li><li><strong>Whisper large-v3</strong> for real-time transcription</li><li><strong>Code generation models</strong> fast enough to feel like Copilot</li></ul><p>This is what “AI PC” should have meant from the beginning. NVIDIA just made it real.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zd7thct_UyjAckB6RhBPMQ.jpeg" /><figcaption>Local AI capabilities grid</figcaption></figure><h3>The Platform Play</h3><p>Here’s the part most reviewers are missing: NVIDIA isn’t just selling a chip. They’re selling a platform.</p><p>Every RTX Spark laptop ships with access to the same CUDA ecosystem that powers the world’s AI research. Developers don’t need to rewrite code. Models don’t need to be recompiled. The laptop and the data center speak the same language.</p><p>Apple locked its AI advantage behind a walled garden. NVIDIA built a superhighway — and invited everyone.</p><h3>Who Should Care</h3><p><strong>AI developers and researchers</strong> running local models — this is the most capable portable inference device ever built.</p><p><strong>Creative professionals</strong> — video editors, 3D artists, VFX artists — who need GPU power but also need to work anywhere.</p><p><strong>Gamers</strong> who want desktop-class performance in a laptop without compromise.</p><p><strong>Enterprise teams</strong> who want to run AI workloads locally for privacy and cost reasons.</p><p><strong>Anyone who looked at a MacBook Pro M4 and thought “I wish this ran CUDA.”</strong></p><h3>The Bigger Picture</h3><p>NVIDIA began as a gaming GPU company. Then they accidentally built the infrastructure of modern AI. Now they’re coming for personal computing.</p><p>The DGX Spark was the first signal. The RTX Spark is the confirmation.</p><p>We are entering an era where <strong>the GPU is the primary compute unit</strong> — not a coprocessor, not an accelerator, but the engine around which everything else is organized. NVIDIA has been preparing for this moment for 15 years, since CUDA was first released in 2006.</p><p>Intel built the PC era. Apple redefined the post-PC era. NVIDIA is building the AI-native era.</p><p>The RTX Spark isn’t just a laptop chip.</p><p>It’s a flag planted in the ground.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q2iwBRpkGZwNxZ-Ov-TxwQ.jpeg" /><figcaption>NVIDIA’s era closing visual</figcaption></figure><h3>Final Thoughts</h3><p>I know many of you skipped the DGX Spark piece last year. That’s fine — it felt niche. A desktop AI box for researchers didn’t feel relevant to most people’s lives.</p><p>But the RTX Spark is for everyone who owns a laptop. And it changes what we should expect from portable computing in the AI era.</p><p>NVIDIA has been playing a long, patient game. The moves are becoming impossible to ignore.</p><p><strong>The question now isn’t whether NVIDIA will dominate AI computing.</strong></p><p><strong>It’s whether anyone else will be able to keep up.</strong></p><p><em>Did you miss my earlier piece on the NVIDIA DGX Spark? Read it here → </em><a href="https://medium.com/@hemanthodarwinr/nvidia-dgx-spark-redefining-compact-ai-supercomputing-for-the-next-era-e47db09b2d92"><em>NVIDIA DGX Spark: Redefining Compact AI Supercomputing</em></a></p><p><em>If this piece changed how you think about the future of computing, share it with someone who still thinks Apple Silicon has no competition. They need to read this.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d9b7e0cbc99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Illusion of the AI Developer: Why Full-Time Reliance on Coding Tools is a Career Trap]]></title>
            <link>https://medium.com/@hemanthodarwinr/the-illusion-of-the-ai-developer-why-full-time-reliance-on-coding-tools-is-a-career-trap-803dbaacb543?source=rss-ca2bdefd4ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/803dbaacb543</guid>
            <dc:creator><![CDATA[Hemantho Darwin R]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 14:14:37 GMT</pubDate>
            <atom:updated>2026-02-25T15:16:51.635Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n2uTuYuhwKT72_wRtxk82w.png" /><figcaption>The cost of over-reliance on AI</figcaption></figure><p>The rise of AI-assisted coding tools like Claude Code, Cursor, Replit, and experimental systems like Google Antigravity has triggered a heated debate in our community.</p><p>Marketing tells you that these tools are the future of engineering. But a quieter, more critical question is being asked by seasoned engineers: Are we building better software, or are we building a generation of developers who can no longer code without a crutch?</p><p>This article explores that question deeply — especially for you if you are at the start or middle of your career. It argues that while AI has utility, adopting a workflow where it does the “full-time work of coding” is a path to skill atrophy and professional obsolescence.</p><h3>The Core Misconception: Automation vs. Engineering</h3><p>You might feel a nagging discomfort when you use these tools:</p><blockquote><em>“These tools are just predicting the next token based on existing code. They read repositories built by real developers and simply replicate patterns. It feels like they steal effort rather than solve problems.”</em></blockquote><p>Your concern is not just valid; it is technically accurate.</p><p>Modern AI coding tools are fundamentally probabilistic language models. It does not “understand” code. It does not hold a mental model of your system’s state. It generates suggestions based on statistical likelihoods derived from vast datasets.</p><ul><li>It can produce elegant solutions by accident.</li><li>It can produce incorrect or insecure code with confidence.</li><li>It cannot replace reasoning, architecture decisions, or domain understanding.</li></ul><p>The danger arises when you confuse typing code with engineering solutions. If you allow AI to handle the full-time burden of coding, you are not automating the typing; you are outsourcing the thinking.</p><h3>What These Tools Actually Do (And What They Hide)</h3><p>To understand the risk, we must look under the hood. AI coding assistants:</p><ul><li>Parse context: They read your open files to guess what you want.</li><li>Match patterns: They find similar code in their training data.</li><li>Predict tokens: They guess the next characters in the sequence.</li></ul><p>What it hides from you:</p><ul><li>The “Why”: It rarely explains the trade-offs of a specific implementation unless you explicitly prompt it.</li><li>The Edge Cases: It optimizes for the “happy path,” often ignoring rare but critical failure states.</li><li>The Technical Debt: It will happily suggest a quick fix that creates a maintenance nightmare six months later.</li></ul><p>When you use these tools full-time, you lose visibility into the mechanics of execution. You become a manager of code you do not truly understand.</p><h3>For Early-Career Developers: The Learning Trap</h3><p>For you as a beginner, the temptation to use AI full-time is highest. The friction of learning is high, and AI removes that friction. But friction is where learning happens.</p><h3>The Illusion of Competence</h3><p>A junior developer using AI full-time can build a working app in a day. Without AI, it might take a week.</p><ul><li>With AI: You feel productive.</li><li>Without AI: You feel stuck.</li></ul><p>This creates an illusion of competence. You believe you know how to build the app because the code exists. But if the AI breaks, or if the context shifts slightly, you lack the fundamental mental models to fix it.</p><h3>The Risk of “Cargo Cult” Coding</h3><p>If you:</p><ul><li>Copy AI-generated code blindly</li><li>Skip debugging or reasoning</li><li>Avoid learning fundamentals (memory management, async flows, database indexing)</li></ul><p>…you are engaging in Cargo Cult Engineering. You are mimicking the shape of code without understanding the spirit of it.</p><h3>Verdict for Beginners</h3><p>AI must never be your primary teacher.</p><ul><li>Struggle is necessary: You must wrestle with the error message to understand the system.</li><li>Type it out: Do not copy-paste. Typing reinforces syntax and logic in your brain.</li><li>Verify everything: Assume the AI is lying until you prove it is telling the truth.</li></ul><blockquote><em>Rule: If you cannot write the code without AI, you are not ready to use AI to write it for you.</em></blockquote><h3>For Mid-Career Developers: Productivity or Atrophy?</h3><p>For you in the middle of your career, the risk is more subtle. You already know how to code, so using AI feels safe. But this is where skill atrophy begins.</p><h3>The Erosion of Deep Focus</h3><p>Mid-career engineers are paid for their ability to solve complex, ambiguous problems.</p><ul><li>AI handles: Boilerplate, CRUD, standard patterns.</li><li>Humans should handle: Architecture, concurrency, security, business logic.</li></ul><p>However, when you use AI full-time, you begin to lose the stamina for deep work. You start expecting instant answers. Your ability to hold a complex system state in your head diminishes because you are constantly context-switching to prompt the AI.</p><h3>The “Review” Bottleneck</h3><p>Mid-level engineers often become reviewers of AI code.</p><ul><li>The Trap: Reviewing code is harder than writing it. You need to know <em>exactly</em> what the code should do to spot what it does wrong.</li><li>The Reality: If you didn’t write the logic, you are more likely to miss subtle bugs during review. You trust the tool because it is confident.</li></ul><h3>Verdict for Mid-Career</h3><p>Use AI as a subordinate, not a partner.</p><ul><li>Delegate the boring stuff, but own the critical path.</li><li>Never commit code you cannot explain line-by-line.</li><li>Use AI to challenge your thinking, not to do the thinking for you.</li></ul><h3>“Are They Stealing Developers’ Hard Work?”</h3><p>This is a philosophical but important concern.</p><p>It’s true that these models learn patterns from publicly available code. However, the greater theft is not of the code, but of the opportunity to grow.</p><ul><li>Human Learning: You read 500 repositories, internalize patterns, and build intuition.</li><li>AI Usage: The model holds the patterns; you hold only the prompt.</li></ul><p>When you rely on AI full-time, you are effectively renting competence rather than building it. If the tool changes, costs money, or is unavailable, your value drops precipitously.</p><p>The ethical conversation is ongoing. But from a career standpoint, the real value lies in internalizing the knowledge, not just generating the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eigzdohhpNKxVWrtN4h2ow.png" /></figure><h3>The Core Truth: Coding is Thinking</h3><p>Your intuition is correct:</p><blockquote><em>AI is not a solution. It is a text generator.</em></blockquote><p>The act of coding is not about typing syntax. It is about:</p><ol><li>Decomposing problems into solvable parts.</li><li>Managing state and side effects.</li><li>Anticipating failure modes.</li></ol><p>AI can do step 1 poorly. It cannot do step 2 or 3 reliably.</p><p>A wrong suggestion accepted blindly can introduce subtle bugs that are harder to detect than hand-written code. When you outsource the coding, you outsource the accountability. When production breaks, the AI cannot be fired. You can.</p><h3>When These Tools Become Dangerous</h3><p>They become harmful when you cross the line from Assisted Coding to Automated Coding.</p><p>Signs you are relying too heavily:</p><ol><li>Documentation Avoidance: You ask the AI instead of reading the official docs. (AI docs are often outdated or hallucinated).</li><li>Debugging Blindness: You ask the AI to fix errors instead of tracing the stack yourself.</li><li>Architectural Passivity: You let the AI decide folder structures and design patterns without critique.</li><li>Loss of Intuition: You feel anxiety when forced to code without assistance.</li></ol><p>In such cases, the tool doesn’t just assist — it erodes engineering intuition. It turns a craftsman into a prompt operator.</p><h3>A Strict Framework: Human-First Development</h3><p>To protect your career and code quality, adopt a Human-First framework.</p><h3>For Early-Career Developers</h3><ul><li>The 30-Minute Rule: Struggle with the problem for at least 30 minutes before asking AI.</li><li>No Copy-Paste: Type every line of code the AI suggests. This forces your brain to process the syntax.</li><li>Explain It Back: After using AI, close the chat and explain how the code works to a rubber duck (or peer). If you can’t, you didn’t learn it.</li></ul><h3>For Mid-Career Developers</h3><ul><li>Architect First: Design the solution on a whiteboard before opening the IDE.</li><li>AI for Drafts Only: Treat AI output as a first draft that requires 100% refactoring.</li><li>Own the Critical Path: Never let AI write security logic, payment processing, or core algorithms without a line-by-line audit.</li><li>Maintain the Muscle: Dedicate time to code complex problems without <em>any</em> AI assistance to keep your skills sharp.</li></ul><h3>Final Verdict: The Pilot, Not the Passenger</h3><p>AI coding tools are neither magic nor menace, but they are dangerous if trusted.</p><ul><li>Weak if used blindly: You become a bottleneck of unverified code.</li><li>Powerful if used critically: You move faster on trivial tasks.</li><li>Dangerous if used lazily: Your skills will rot.</li><li>Transformative if used thoughtfully: You amplify your human intellect.</li></ul><p>The stance is clear: For early-career developers, AI should be a tutor, not a ghostwriter. For mid-career developers, AI should be a junior assistant, not a lead engineer.</p><p>The real differentiator will not be <em>who uses AI</em>, but <em>who retains the ability to build without it</em>.</p><h3>Closing Thought</h3><blockquote><em>AI can generate code. Only developers can generate understanding.</em></blockquote><p>If you allow AI to take over the full-time role of being a coder, you are not optimizing your career; you are making yourself replaceable.</p><p>The future does not belong to developers who reject AI — nor to those who blindly depend on it — but to those who recognize that the value of a developer is not the code they produce, but the problems they solve.</p><p>Keep the human in the loop. Keep the mind in the code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=803dbaacb543" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NVIDIA DGX Spark: Redefining Compact AI Supercomputing for the Next Era]]></title>
            <link>https://medium.com/@hemanthodarwinr/nvidia-dgx-spark-redefining-compact-ai-supercomputing-for-the-next-era-e47db09b2d92?source=rss-ca2bdefd4ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e47db09b2d92</guid>
            <dc:creator><![CDATA[Hemantho Darwin R]]></dc:creator>
            <pubDate>Fri, 09 May 2025 17:42:28 GMT</pubDate>
            <atom:updated>2025-05-16T17:18:17.570Z</atom:updated>
            <content:encoded><![CDATA[<h3>From Data Centers to Desktops: The AI Supercomputer Revolution</h3><p>A quiet revolution just landed on your desk — literally. NVIDIA, the GPU titan, has moved beyond graphics to completely rethink the future of AI computing. With a bold new architecture, they’ve cracked the code on performance, power, and interconnectivity, all in a device that fits in your backpack.</p><h3>Meet the NVIDIA DGX Spark</h3><p>At its core is the NVIDIA GB10 Grace Blackwell Superchip, a product of NVIDIA’s fifth-generation Blackwell architecture — a monumental step forward in compute density and efficiency.</p><p>Capable of delivering up to 1,000 AI TOPS, the DGX Spark condenses data center-class capabilities into a compact form factor, giving technical teams the freedom to develop, train, and deploy advanced AI models — locally and without compromise..</p><h3>Why DGX Spark Matters Now</h3><p>As AI models grow more complex and compute-intensive, local access to high-performance hardware is no longer a luxury — it’s a necessity.</p><p>For innovators working at the forefront of AI, the delays and constraints of cloud-based workflows can slow progress. DGX Spark removes these bottlenecks, placing powerful, enterprise-grade AI capabilities directly on the desktop.</p><h3>The Technical Marvel Behind DGX Spark</h3><p>🔹 <strong>NVIDIA GB10 Superchip: A Leap in AI Processing</strong><br> At the heart of DGX Spark lies the NVIDIA GB10 Superchip — a processor that redefines AI computing. Delivering <strong>1,000 AI TOPS at FP4 precision</strong>, it strikes the ideal balance between raw performance and energy efficiency, engineered specifically for modern large-scale AI workloads.</p><p>🔹 <strong>Unified Memory Architecture: Eliminating Bottlenecks</strong><br> Conventional systems split memory between CPU and GPU, often resulting in data transfer slowdowns. DGX Spark overcomes this with <strong>128GB of unified LPDDR5x system memory</strong>, enabling seamless local execution of AI models with <strong>up to 200 billion parameters</strong> — enough to run enterprise-grade LLMs on your desktop, with zero friction.</p><p>🔹 <strong>Connectivity and Scalability: Beyond the Box</strong><br> DGX Spark’s integrated <strong>NVIDIA ConnectX-7 Smart NIC</strong> isn’t just about high-speed networking — it’s a scalability enabler. By linking two DGX Spark systems, users can support AI models with <strong>up to 405 billion parameters</strong>, bringing data center-grade capabilities to compact environments.</p><p>🔹 <strong>End-to-End Software Stack: Ready to Work Out of the Box</strong><br> Hardware is only half the equation. DGX Spark includes <strong>NVIDIA’s full AI software suite</strong>, featuring optimized frameworks, libraries, pretrained models, and deployment tools. You get immediate productivity with minimal setup, avoiding the typical challenges of configuring high-performance systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aaPLd8dZ-l9an0W_sdBv4A.jpeg" /><figcaption>Design proposed by <strong>NVIDIA</strong> for <strong>NVIDIA GB10 Grace Blackwell Superchip</strong></figcaption></figure><h3>Beyond Specifications: Real-World Impact</h3><h4>Revolutionizing AI Development Workflows</h4><p>Traditional AI development is fragmented and time-consuming:</p><ul><li>Prototype scaled-down models locally</li><li>Offload full-scale training to the cloud</li><li>Optimize for deployment</li><li>Repeat the cycle with every iteration</li></ul><p><strong>DGX Spark redefines this workflow</strong> by bringing the full power of a supercomputer to your desktop. With it, developers can:</p><ul><li><strong>Prototype, train, and test large-scale models entirely on-premises</strong></li><li><strong>Eliminate delays caused by cloud queues and network latency</strong></li><li><strong>Rapidly iterate and fine-tune models in real-time</strong></li><li><strong>Seamlessly transition from experimentation to production</strong></li></ul><p>This streamlined workflow empowers researchers and developers to move at the speed of innovation — without compromise.</p><h3>Tailored for the Five Most Demanding AI Workloads</h3><ol><li><strong>⚡ Rapid Prototyping</strong><br> Build, validate, and iterate on AI models at lightning speed. With DGX Spark, developers can start small and scale effortlessly — either to DGX Cloud or on-prem data centers — once models are production-ready.</li><li><strong>🔧 Model Fine-Tuning</strong><br> Customize large pre-trained models (up to 70 billion parameters) for niche domains or enterprise-specific tasks — without incurring cloud latency or spiraling costs.</li><li><strong>🚀 High-Performance Inference</strong><br> Powered by 5th-gen Tensor Cores, DGX Spark delivers real-time inference for models up to 200 billion parameters. Get instant responsiveness — no server racks or clusters required.</li><li><strong>📊 End-to-End Data Science</strong><br> Accelerate every step of the data science pipeline using NVIDIA RAPIDS™. From preprocessing to deployment, Spark enables GPU-accelerated analytics without the need for code rewrites or toolchain overhauls.</li><li><strong>🌐 Edge AI Development</strong><br> Leverage DGX Spark to develop advanced AI for the edge using specialized platforms like Isaac™, Metropolis, and Holoscan. Ideal for applications in robotics, smart cities, and medical imaging, it’s a launchpad for innovation beyond the cloud.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*ElVPmadmDJFrDpp29FWKXQ.jpeg" /><figcaption>The size of <strong>NVIDIA GB10 Grace Blackwell Superchip </strong>compared to a laptop.</figcaption></figure><h3>How DGX Spark Compares Across the AI Landscape</h3><h3>Apple Silicon: Elegant Design, Different Focus</h3><p>Apple’s M4 Pro showcases an impressive unified memory architecture and excels in creative and productivity workflows. However, with 24–36GB of memory, it’s optimized for consumer and developer use cases, not large-scale AI model training. DGX Spark, by contrast, is purpose-built for high-end AI workloads and research-level performance.</p><h3>Intel’s OpenVINO: Efficient Inference, Traditional Foundations</h3><p>Intel’s OpenVINO platform provides efficient AI acceleration on established CPU infrastructure, making it a solid choice for inference tasks. However, it retains separate memory systems, which can limit flexibility and performance for training large models — a challenge DGX Spark overcomes with its unified memory architecture.</p><h3>AMD MI300A: High Performance, Enterprise Scale</h3><p>AMD’s Instinct™ MI300A delivers server-grade performance with 128GB of HBM3 memory and strong capabilities for large-scale deployments. DGX Spark matches this memory scale in a far more compact form factor, making advanced AI workloads accessible without the need for data center infrastructure.</p><h3><strong>Architectural Deep Dive: Inside the DGX Spark</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*KcFa7tDMNHeY_8Jsr6o7Jg.png" /></figure><h3>The Real Cost of Innovation</h3><h3>The Real Value of Innovation</h3><p>Although official pricing details are yet to be announced, NVIDIA DGX Spark is clearly designed with professional AI developers and organizations in mind. It sits in a unique position — offering the power of traditional high-end AI infrastructure in a much more compact and accessible form.</p><p>For teams serious about advancing their AI capabilities, DGX Spark is more than just a piece of hardware — it’s a strategic investment. It has the potential to deliver strong returns by:</p><ul><li>Reducing reliance on costly cloud computing</li><li>Speeding up development and iteration cycles</li><li>Enhancing productivity across AI and data science workflows</li><li>Strengthening data security with local processing capabilities</li></ul><p>In short, DGX Spark brings enterprise-level AI performance within reach of innovators, researchers, and developers — without the complexity or overhead of massive infrastructure.</p><h3>Looking Ahead: How DGX Spark is Shaping the Future of AI</h3><p>The introduction of <strong>DGX Spark</strong> marks a significant turning point in the world of AI development. Much like personal computers revolutionized computing in the 1980s, desktop AI supercomputers are poised to reshape the AI landscape in the 2020s.</p><p>This leap in technology isn’t just for the tech giants — <strong>DGX Spark</strong> opens up incredible opportunities for:</p><ul><li><strong>Startups</strong>: Empowering smaller companies to build and test state-of-the-art AI without the need for prohibitively expensive infrastructure.</li><li><strong>Academic Researchers</strong>: Providing researchers the ability to push the boundaries of AI, free from the constraints of traditional enterprise-level budgets.</li><li><strong>Independent Developers</strong>: Offering creators the chance to experiment with new AI applications, exploring niche use cases that fall outside the norm.</li></ul><p>But perhaps the most exciting aspect of <strong>DGX Spark</strong> isn’t the impressive capabilities it brings today, but the potential it unlocks for the future. By putting this immense computing power into more hands, we are likely to witness an unprecedented wave of innovation across various industries and domains.</p><h3>Conclusion: A New Era in Computing</h3><p>The <strong>NVIDIA DGX Spark</strong> isn’t just a technical marvel — it’s a game-changer in the world of AI development. By bringing supercomputing capabilities to a compact, desktop-friendly form, it opens up possibilities that were previously restricted to large-scale data centers and research labs.</p><p>Whether you’re crafting the next breakthrough in natural language processing, exploring new dimensions in computer vision, or pioneering innovative AI applications, the DGX Spark provides the power and flexibility you need to turn your vision into reality.</p><p>The future of AI development is here — and it fits comfortably on your desk.</p><p><strong><em>Are you currently relying on cloud-based infrastructure for your AI projects? How do you think having a desktop supercomputer like the DGX Spark would transform your workflow? Share your thoughts in the comments below.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e47db09b2d92" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NVIDIA Triton vs FastAPI: Choosing the Right ML Serving Solution in 2024]]></title>
            <link>https://medium.com/@hemanthodarwinr/nvidia-triton-vs-fastapi-choosing-the-right-ml-serving-solution-in-2024-3e6c771f3cf6?source=rss-ca2bdefd4ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e6c771f3cf6</guid>
            <dc:creator><![CDATA[Hemantho Darwin R]]></dc:creator>
            <pubDate>Sat, 19 Oct 2024 04:01:37 GMT</pubDate>
            <atom:updated>2024-10-24T12:15:03.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*71yRAjXlPlvMuWrQLO0mAg.jpeg" /><figcaption>High-level architecture comparison between FastAPI and NVIDIA Triton deployments</figcaption></figure><h3>Introduction</h3><p>In the ever-evolving landscape of machine learning deployment, choosing the right serving solution can make or break your application’s performance. Today, we’ll dive deep into two popular approaches: the traditional FastAPI deployment and NVIDIA’s Triton Inference Server. Whether you’re a beginner exploring deployment options or a professional architect making critical infrastructure decisions, this guide will help you make an informed choice.</p><h3>The Traditional Approach: FastAPI + Gunicorn/Uvicorn</h3><h3>What is it?</h3><p>FastAPI is a modern, fast web framework for building APIs with Python. When combined with Gunicorn and Uvicorn, it provides a robust solution for serving machine learning models.</p><pre>from fastapi import FastAPI<br>import torch</pre><pre>app = FastAPI()<br>model = torch.load(&quot;model.pth&quot;)<br>@app.post(&quot;/predict&quot;)<br>async def predict(data: dict):<br>    input_tensor = torch.tensor(data[&quot;input&quot;])<br>    with torch.no_grad():<br>        prediction = model(input_tensor)<br>    return {&quot;prediction&quot;: prediction.tolist()}</pre><h3>Pros 👍</h3><ul><li><strong>Developer-Friendly</strong>: If you know Python, you’re good to go</li><li><strong>Flexible</strong>: Complete control over your application</li><li><strong>Great Documentation</strong>: Automatic OpenAPI/Swagger docs</li><li><strong>Easy Integration</strong>: Works seamlessly with Python packages</li><li><strong>Quick Setup</strong>: Minimal configuration required</li></ul><h3>Cons 👎</h3><ul><li><strong>Performance Limitations</strong>: Python’s GIL can be a bottleneck</li><li><strong>Manual Optimization</strong>: You handle caching, batching yourself</li><li><strong>Resource Management</strong>: GPU memory management needs attention</li><li><strong>Scaling Challenges</strong>: Requires additional work for distributed setups</li></ul><h3>NVIDIA Triton Inference Server</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dQXDFMjJRhmMkr8qY9dI4A.jpeg" /><figcaption><em>Performance comparison between FastAPI and Triton implementations</em></figcaption></figure><h3>What is it?</h3><p>Triton is NVIDIA’s specialized inference serving system, designed for high-performance model deployment at scale.</p><pre># model_repository/model/config.pbtxt<br>name: &quot;model&quot;<br>platform: &quot;pytorch_libtorch&quot;<br>max_batch_size: 8<br>input [<br>  {<br>    name: &quot;INPUT&quot;<br>    data_type: TYPE_FP32<br>    dims: [ 3, 224, 224 ]<br>  }<br>]<br>output [<br>  {<br>    name: &quot;OUTPUT&quot;<br>    data_type: TYPE_FP32<br>    dims: [ 1000 ]<br>  }<br>]</pre><h3>Pros 👍</h3><ul><li><strong>Optimized Performance</strong>: Built for speed and efficiency.</li><li><strong>Multi-Framework Support</strong>: Works with TensorRT, PyTorch, ONNX.</li><li><strong>Production-Ready Features</strong>: Dynamic batching, Model versioning, Concurrent execution and Multiple GPU support.</li><li><strong>Built-in Monitoring</strong>: Metrics and health checks included.</li></ul><h3>Cons 👎</h3><ul><li><strong>Steeper Learning Curve</strong>: More complex initial setup.</li><li><strong>Less Flexible</strong>: Fixed deployment patterns.</li><li><strong>Resource Heavy</strong>: Needs more infrastructure.</li><li><strong>Configuration Overhead</strong>: Detailed setup required.</li></ul><h3>Making the Right Choice</h3><h3>Choose FastAPI when:</h3><ul><li>🎯 Building MVPs or prototypes.</li><li>🔧 Need maximum flexibility.</li><li>🚀 Want rapid development.</li><li>💻 Have simple deployment needs.</li></ul><h3>Choose Triton when:</h3><ul><li>🌐 Deploying at scale.</li><li>⚡ Need maximum performance.</li><li>🔄 Using multiple ML frameworks.</li><li>🖥️ Have GPU infrastructure.</li></ul><h3>Real-World Performance Considerations</h3><p>Let’s look at some key metrics that matter in production:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*oZqFtRupHoaYR2PqJbHxrQ.png" /><figcaption>key metrics that matter in production</figcaption></figure><h3>Deployment Quick Start</h3><h3>FastAPI Deployment</h3><pre># Simple deployment<br>pip install fastapi uvicorn gunicorn<br>gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker</pre><h3>Triton Deployment</h3><pre># Using Docker<br>docker run --gpus=all -p8000:8000 -p8001:8001 -p8002:8002 \<br>    -v ${PWD}/model_repository:/models \<br>    nvcr.io/nvidia/tritonserver:22.12-py3 \<br>    tritonserver --model-repository=/models</pre><h3>Conclusion</h3><p>The choice between FastAPI and Triton isn’t about which is better — it’s about which better suits your needs. FastAPI shines in development and simple deployments, while Triton excels in production-scale deployments where performance is crucial.</p><h3>Quick Decision Guide</h3><ul><li>🔬 <strong>Starting Small?</strong> Go with FastAPI.</li><li>🏭 <strong>Going to Production at Scale?</strong> Consider Triton.</li><li>📈 <strong>Need Both?</strong> Start with FastAPI, migrate to Triton as you scale.</li></ul><h3>What’s Next?</h3><ul><li>📚 Explore the documentation of both platforms.</li><li>🧪 Run performance tests with your specific models.</li><li>🔄 Consider a gradual migration strategy if needed.</li></ul><p>Remember: The best choice is the one that solves your specific problems while allowing for future growth.</p><p><em>Have you used either of these solutions in production? Share your experiences in the comments below!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e6c771f3cf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>