<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Humza Khan — Blog</title>
    <link>https://humza.io/blog/</link>
    <description>Writing by Humza Khan on AI products, agents, evals, and production systems.</description>
    <language>en</language>
    <lastBuildDate>Fri, 23 Oct 2026 00:00:00 GMT</lastBuildDate>
    <atom:link href="https://humza.io/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The quiet churn killer: agents that find and fix bugs before customers do</title>
      <link>https://humza.io/blog/the-quiet-churn-killer-agents-that/</link>
      <guid isPermaLink="true">https://humza.io/blog/the-quiet-churn-killer-agents-that/</guid>
      <pubDate>Fri, 23 Oct 2026 00:00:00 GMT</pubDate>
      <description>AI agents for customer retention: autonomous testing finds and fixes product bugs before customers notice, with verified fixes and a business playbook.</description>
      <category>ai-agents</category>
      <category>customer-experience</category>
      <category>software-testing</category>
      <category>customer-retention</category>
      <content:encoded><![CDATA[<figure><img src="https://humza.io/blog/the-quiet-churn-killer-agents-that/cover.webp" alt="Dark title card about using agent swarms to detect issues before customers do, beside a glowing signal spike." width="1600" height="640" loading="eager" fetchpriority="high" decoding="async"></figure>
<p>If your monitoring still ends with an alert and a human squinting at a dashboard, you’re already behind. An alert is your system telling you a customer is having a bad time, then asking you to go deal with it whenever you get round to it. Agents can now click through your product as every kind of user, find what’s broken, fix it in their own sandbox and send you the proof before a customer ever notices. So the question is simple: are you proactive about your customer experience, or are you waiting for someone to complain? One night in October I found out which one I was.</p>
<p>At 2:41 am, three agents started using the product I work on as every kind of user it has. Owners, managers, inspectors, read-only users, someone who belongs to two companies, someone who belongs to none. By 6:01 am they’d found 35 bugs and merged 13 fixes, each one checked visually in its own sandbox before it went in. I didn’t approve a single fix.</p>
<p>Here’s one of the first things they found. An agent ran a real inspection of a kitchen, and this is the report that came back.</p>
<figure><img src="https://humza.io/blog/the-quiet-churn-killer-agents-that/kitchen-inspection-condition-bug.webp" alt="Kitchen inspection report lists four issues, including a scratched sink and cracked stove top, while incorrectly rating the room condition as Good." width="1440" height="1000" loading="lazy" decoding="async"></figure>
<p>Scratched sink, cracked stove top, a drawer that won’t close, a wobbly hinge. Condition: Good. No alert fired, because nothing crashed. The only way you catch that bug is by being the person reading the report.</p>
<h2>How I built it</h2>
<h3>Write down what good looks like, before anything breaks</h3>
<p>This is the part that meant I didn’t have to approve anything. Before the run I’d documented the user journeys that matter, role by role. I also had a reference build of the app running in a mock mode that already showed the correct behaviour on screen, with the performance numbers it should hit.</p>
<p>So every agent knew what the landing was. “The Locations card shows 13 inspections.” “An inspector can’t open the team page.” “The board loads in under half a second.” When an agent fixed something, it wasn’t asking me whether the fix was right. It was checking the screen against a picture of right that already existed.</p>
<p>Approval is what you need when nobody wrote down what success looks like.</p>
<h3>Build a fake world inside production</h3>
<p>Most bugs don’t live on the happy path. They live in states nobody sets up by hand: the inspector who shouldn’t see the team page, the manager in one company who’s read-only in another, the account with no company at all, the brand-new company with no data.</p>
<p>So I seeded a small fake world straight into production. Three synthetic companies, 15 personas, and a handful of deliberately weird accounts. A few tricks make failures loud instead of quiet:</p>
<ul><li><p>The second company reuses the first one’s names and unit numbers, so if data leaks across companies it shows up as wrong data instead of nothing.</p>
</li><li><p>The third company stays completely empty, so anything that appears there is a bug by definition.</p>
</li><li><p>Before any testing, a probe fires about 1,200 requests at the boundaries between companies and roles. If one of its own control checks fails, it marks the whole result invalid instead of quietly passing. On the night one control did fail, and the probe said so.</p>
</li></ul><h3>Let agents use the product like real people</h3>
<p>Three agents ran in parallel, split by role. Each one drove a real browser against the deployed production app from its own short-lived cloud VM, and every bug came back with steps, expected versus actual, a screenshot and the request IDs.</p>
<p>Two things told me the setup was honest. All three agents independently found the same two bugs, from three different directions. And the boring result: 232 attempts to read another company’s data, every one refused. Nothing crossed between companies.</p>
<h3>Fix it in a sandbox, prove it against the reference</h3>
<p>Every bug got its own agent and its own PR. Each agent spun up a fresh Boat VM with its fix, clicked through the same journey as the right user, and compared the screen against the reference. An independent reviewer graded the screenshots before anything merged. A typical run took about 10 minutes and cost about 0.6 cents.</p>
<p>Here’s one. Before the fix, the Locations page said “0 inspections” for a property with 13 of them, so the check fails.</p>
<figure><img src="https://humza.io/blog/the-quiet-churn-killer-agents-that/inspection-count-before-fix.webp" alt="Before the fix, the Locations page shows zero inspections and the automated check fails because the expected 13 inspections are missing." width="793" height="778" loading="lazy" decoding="async"></figure>
<p>After the fix: same journey, same check.</p>
<figure><img src="https://humza.io/blog/the-quiet-churn-killer-agents-that/inspection-count-after-fix.webp" alt="After the fix, the Locations page shows 13 inspections and passes both the inspection count and empty property checks." width="790" height="832" loading="lazy" decoding="async"></figure>
<p>Role checks work the same way. The report doesn't just say "permissions fixed". It shows the owner keeping everything they had and the inspector losing exactly what they shouldn't have had, screen by screen.</p>
<figure><img src="https://humza.io/blog/the-quiet-churn-killer-agents-that/role-permission-verification.webp" alt="Role permission verification report passes checks that preserve owner access while restricting inspector actions, direct URLs and settings." width="874" height="885" loading="lazy" decoding="async"></figure>
<p>Small behaviour gets the same treatment. A dismissed maintenance request has to keep its original stage when you open it again.</p>
<figure><img src="https://humza.io/blog/the-quiet-churn-killer-agents-that/dismissed-request-stage-verification.webp" alt="Customer journey check passes after reopening a dismissed maintenance request and confirming its original Approved stage is preserved." width="775" height="547" loading="lazy" decoding="async"></figure>
<p>So does performance, with the current build and the fixed build side by side.</p>
<figure><img src="https://humza.io/blog/the-quiet-churn-killer-agents-that/manager-ui-before-after.webp" alt="Manager UI comparison shows the maintenance board, waiting quote and spend-check approval card before and after the fix; both journeys pass." width="814" height="855" loading="lazy" decoding="async"></figure>
<h3>Let the verifier say no</h3>
<p>Twice that night, a fix failed its own sandbox check and went back. The avatar upload fix passed code review, then failed in the VM on a storage edge case. The repeat-inspection fix, the one behind that “Good” kitchen, failed because a renamed room split in two. Both were fixed and re-verified before they merged.</p>
<p>If your agents never fail their own checks, your checks aren’t checking anything.</p>
<h3>Run it again on the live release</h3>
<p>After I deployed, the same world ran a regression pass against the live release: 17 checks covering all 13 fixes, then a separate verifier agent that had to reproduce every major finding from scratch.</p>
<p>It caught a real regression. The avatar fix had worked in the sandbox, but in production the saved image came back blank after a reload. It also found a new problem in how a repeat inspection compares against the first one.</p>
<p>Once I said “fix everything”, three agents had nine PRs ready in under half an hour, visually checked wherever the sandbox could reproduce the journey. A fourth agent redesigned every transactional email and had it visually verified in 14 minutes.</p>
<h2>Where I still sit</h2>
<p>There was still a human in this, and I’d rather say exactly where. I kept one gate on purpose: the production deploy. The agents stopped and waited for me instead of overriding a workflow I’d switched off. I also had CI paused that day, so the evidence for each merge was code review plus visual verification, not a test suite.</p>
<p>The fixes themselves didn’t need me, because the definition of done was already written down. That’s the bit to copy.</p>
<h2>Why proactive wins</h2>
<p>Most unhappy customers never tell you. Qualtrics surveyed 20,001 consumers in 14 countries in 2025: fewer than one in three give companies feedback, and 34% quietly spend less after a bad experience. PwC found that 32% of customers globally would walk away from a brand they loved after one bad experience. So that “Good” kitchen doesn’t come back to you as a ticket. It comes back as a renewal that never happens.</p>
<p>Getting there first pays. Gartner surveyed 6,004 customers in 2020 and found proactive service led to “significantly better customer experience outcomes”: lower effort, higher satisfaction, higher NPS. Only 13% of those customers said a company had reached out to them first. Bell Canada did the human version. It mined its call data, worked out which problem a customer would call back about next, and dealt with it on the first call. Repeat calls per issue fell 16% and churn fell 6%.</p>
<p>Amazon built the automated version over a decade ago. Its systems look for experiences that weren’t up to standard and refund the customer before they ask. Bezos wrote that doing it proactively “is more expensive for us, but it also surprises, delights, and earns trust.”</p>
<p>Speed is part of the experience too. In Deloitte’s 2020 study for Google across 37 brands, a mobile site 0.1 seconds faster went with 8.4% more retail conversions. That’s why the performance targets sit in the reference build, right next to the screens.</p>
<p>And fixing it after the complaint doesn’t buy the customer back. A 2007 meta-analysis of the “service recovery paradox” found that a good recovery lifts satisfaction but makes no significant difference to repurchase intentions or word of mouth. The win is the customer never hitting the bug at all.</p>
<h2>Alerts are a symptom</h2>
<p>An alert is a to-do item for a human. It made sense when the only thing that could fix production was a person. That stopped being true.</p>
<p>The bar I’m working towards: something breaks for a customer, and within 10 to 15 minutes there’s a verified fix waiting, with screenshots proving it matches what good looks like. The email redesign was ready inside that window. The rest of the loop isn’t far off.</p>
<h2>How to start on Monday</h2>
<ol><li><p><strong>Write down what good looks like, visually.</strong> Journeys per role, a reference build that shows the right screen, and the performance numbers you expect. Without this, every fix needs your approval.</p>
</li><li><p><strong>Seed a world with every kind of user.</strong> Especially the weird ones: two companies, no company, an empty company, read-only.</p>
</li><li><p><strong>Make agents prove fixes in a sandbox.</strong> One bug, one agent, one PR, one VM, screenshots compared against the reference, and an independent grader that’s allowed to say no.</p>
</li></ol><p>Then let it run tonight, and read the report with your coffee.</p>
<hr><p><em>If your customers are still your QA team, that’s fixable. I build these loops for companies: the reference, the test world, the agents and the gates. Reach out at <a href="mailto:hello@humza.io">hello@humza.io</a> </em></p>
]]></content:encoded>
    </item>
    <item>
      <title>How I use adversarial review loops to generate production specs</title>
      <link>https://humza.io/blog/how-i-use-adversarial-review-loops/</link>
      <guid isPermaLink="true">https://humza.io/blog/how-i-use-adversarial-review-loops/</guid>
      <pubDate>Wed, 21 Oct 2026 00:00:00 GMT</pubDate>
      <description>An adversarial review loop for AI agent specs: Hone pits a Critic against a Defender until the plan is stable, so you catch a broken spec before you build.</description>
      <category>ai</category>
      <category>agents</category>
      <category>specs</category>
      <category>code-review</category>
      <category>claude-code</category>
      <content:encoded><![CDATA[<figure><img src="https://humza.io/blog/how-i-use-adversarial-review-loops/cover.webp" alt="Dark navy title card reading “The Adversarial Spec Loop.” beside a glowing funnel shape narrowing to a small central square." width="900" height="360" loading="eager" fetchpriority="high" decoding="async"></figure><p>I want you to imagine the scenario. You hand an agent a spec, you let it run for a week, everything compiles, the tests pass, and it still doesn’t do what you wanted. The code’s fine but your plan was broken from day one and nobody caught it  because the only thing that ever reviewed it was the agent that wrote it. Yikes.</p><p>In my experience, projects rarely die in execution. They die in the planning, in the things you missed, especially the ones you don’t know you don’t know. And agents make it worse, honestly, because they’ll build on a bad plan faithfully, confidently and very, very fast.</p><p>I’m working on fine-tuning models that have to work out in the physical world, and agents write most of my specs regarding any operational tooling around it. So I wanted a way to poke holes in every spec until it stops breaking, then build. That’s the reason I’m writing this piece.</p><p><strong>Never let the agent that wrote the plan be the one that signs it off.</strong></p><h2>Your agent can’t mark its own homework</h2><p>I mean, you can loop it all day. Ask the same model to review its own spec and it reads it the way it wrote it, looking for reasons it’s right, right? Jie Huang and colleagues found in 2023 that LLMs “struggle to self-correct their responses without external feedback”. So you loop harder and you get the same plan back, just more confident about it. Lovely.</p><p>Here’s how I would do this: planning is a chain. Every step works off the last one and shapes the next. So the review cannot be one pass at the end; it has to be a loop where something with no stake in the plan keeps attacking it until it stops breaking.</p><h2>Hone makes two agents fight over your spec</h2><p>That loop is Hone, a small open-source framework I wrote. It’s on GitHub at <a href="https://github.com/humzakhan/hone" rel="noopener">github.com/humzakhan/hone</a>, and the core of it is two roles taking turns.</p><p>→ <strong>The Critic</strong> reads every doc and lists blocking issues only, each one specific, falsifiable and pinned to the exact document and section. No fixes, no praise, no “great start, love the vision!”.</p><p>→ <strong>The Defender</strong> rules on every single one. VALID, fix the docs right now. INVALID, show exactly where it’s already handled. TRADE-OFF, log it in KNOWN_TRADE_OFFS.md and move on.</p><p>Every fix is new surface area, so the Critic goes again. Zero blocking issues and the spec is STABLE, go build. Ten cycles and they’re still at it? It calls IMPASSE and hands you the open questions, because by then it’s a judgement call, and that one’s yours.</p><p>My favourite Defender rule is “A behavioural instruction is not a technical control.” If the only thing stopping a failure is a line in a prompt politely asking the agent not to, that’s VALID. Sorry.</p><p>The Critic, basically, is a disgruntled co-founder who’s a little tired of your shit. The Defender is you at 11pm, having to answer every single point.</p><h2>Calibrate the critic or don’t bother</h2><figure><img src="https://humza.io/blog/how-i-use-adversarial-review-loops/calibrated-vs-generic-critic.webp" alt="Comparison graphic titled “Generic critic vs calibrated critic.” A generic critic asks “What technical assumptions might be wrong?”, which is untestable. A calibrated critic asks whether a 90-second time-to-insight promise survives 30-second enrichment batches of 25 for a user with 18 months of history, which is testable." width="680" height="383" loading="lazy" decoding="async"></figure><p>Point an off-the-shelf critic at your spec and you get “what technical assumptions might be wrong?” Thanks, very helpful. The agent waffles, you nod, nothing gets caught. It’s generic by design, and it works on principles that might not even apply to you, and you don’t even know, right?</p><p>So the first thing Hone does is /hone-calibrate. It reads your thesis and writes a CRITIC.md that’s specific to your project, with 3 to 6 questions for each of six areas, from core assumptions and failure modes to sequencing and the stuff that breaks in production with no one watching. Every question has to name something from your thesis and a specific way it fails, or it gets rewritten.</p><p>The example in the repo comes from Jay, the personal finance agent Hone grew out of. The thesis promises a useful insight within 90 seconds of connecting an account. Enrichment takes about 30 seconds per batch of 25. So what’s the real wait for someone with 18 months of history? Your architecture either survives that question or it doesn’t, and you find out on paper instead of in prod.</p><h2>Run it on your next spec</h2><figure><img src="https://humza.io/blog/how-i-use-adversarial-review-loops/four-commands-one-loop.webp" alt="Table titled “Four commands, one loop.” /hone-calibrate runs once before the loop and turns your thesis into a project-specific CRITIC.md. /hone-review runs the whole loop until STABLE, or IMPASSE after 10 cycles. /hone-critic and /hone-defender are manual modes: one pass of blocking issues, and VALID, INVALID or TRADE-OFF rulings that apply fixes and log trade-offs." width="680" height="383" loading="lazy" decoding="async"></figure><p>Clone the repo and copy the commands into your project:</p><pre><code>git clone &lt;https://github.com/humzakhan/hone.git&gt; /tmp/hone
cp -r /tmp/hone/.claude/commands/* .claude/commands/
cp -r /tmp/hone/prompts ./hone-prompts</code></pre><p>/hone-review runs both roles in one session, which is quick. If you want them properly apart, run /hone-critic and /hone-defender by hand in fresh sessions. The Critic prompt says it has to come in cold, and I mean it. Not on Claude Code? The prompts are plain markdown, so paste them into whatever model you like.</p><p>Grab the next spec you’re about to hand an agent and let Hone tear it apart first. Much cheaper than hearing about it from your agents a week later.</p><ol><li><p>Write thesis.md from the template. One falsifiable sentence for the core thesis, plus what the project is not.</p></li><li><p>Run /hone-calibrate to get your CRITIC.md.</p></li><li><p>Write architecture.md and implementation-plan.md.</p></li><li><p>Run /hone-review and let it go until STABLE or IMPASSE.</p></li><li><p>Read SESSION.md and KNOWN_TRADE_OFFS.md, so you know exactly what you’ve signed up for.</p></li></ol><p>/hone-review runs both roles in one session, which is quick. If you want them properly apart, run /hone-critic and /hone-defender by hand in fresh sessions. The Critic prompt says it has to come in cold, and I mean it. Not on Claude Code? The prompts are plain markdown, so paste them into whatever model you like.</p><p>Grab the next spec you’re about to hand an agent and let Hone tear it apart first. Much cheaper than hearing about it from your agents a week later.</p><hr><p><em>If you’re implementing AI in your company, or working out the hybrid of generic tools and the parts that have to be customized to how you actually work, that’s what I do. I might be able to help, so reach out at <a href="mailto:hello@humza.io">hello@humza.io</a> and we’ll see if we’re a good fit to work together.</em></p>]]></content:encoded>
    </item>
    <item>
      <title>Nobody runs a local LLM to save money. Here&apos;s when it&apos;s worth it.</title>
      <link>https://humza.io/blog/nobody-runs-a-local-llm-to-save-money/</link>
      <guid isPermaLink="true">https://humza.io/blog/nobody-runs-a-local-llm-to-save-money/</guid>
      <pubDate>Tue, 20 Oct 2026 00:00:00 GMT</pubDate>
      <description>Local LLM vs cloud API: running local rarely saves money. See the real costs, when privacy or learning justifies it, and what hardware you need.</description>
      <category>ai</category>
      <category>local-llm</category>
      <category>privacy</category>
      <category>infrastructure</category>
      <content:encoded><![CDATA[<figure><img src="https://humza.io/blog/nobody-runs-a-local-llm-to-save-money/cover.webp" alt="Dark title card reading “Nobody runs a local LLM to save money. Here’s when it’s worth it.” beside a Mac Studio on a desk with dotted lines of data flowing out of it." width="1672" height="941" loading="eager" fetchpriority="high" decoding="async"></figure><p><strong>Short answer:</strong> running a local LLM rarely beats a cloud API on price. It wins when your data can’t leave the building or when you want to understand how inference works, and it only saves money if the machine stays busy.</p><p>Every time someone posts a Mac Studio running a local model, the replies arrive on schedule. “For $5,499 you could’ve had 27 months of Claude Max.” Thanks, we’d never have worked that out on our own.</p><p>The maths is right. If all you want is the smartest model for the least money this month, rent it. It just answers a question almost nobody running local is asking.</p><blockquote><p><strong>Local AI is a terrible discount version of Claude, and the people buying these boxes know that.</strong></p></blockquote><p>They buy them for one of two reasons. Either they want to understand how this stuff actually works, or they’ve got data that isn’t allowed to leave.</p><h2>Reason one: you want to see how the sausage is made</h2><p>Calling an API teaches you how to call an API. Running a model on your own machine teaches you everything the API hides:</p><ul><li><p><strong>Quantisation:</strong> why a 4-bit model fits where an 8-bit one won’t, and what that costs you in quality.</p></li><li><p><strong>Memory:</strong> why memory bandwidth matters more than raw compute when generating tokens.</p></li><li><p><strong>Context:</strong> what a long context does to your RAM.</p></li><li><p><strong>Load:</strong> why the same prompt flies for one user and crawls for ten.</p></li></ul><p><strong>That knowledge compounds.</strong> If you build on top of models for a living, knowing why a token costs what it costs makes you better at routing, caching and picking the right model for the job, even when the job ends up running in the cloud.</p><blockquote><p>When the model sits on your desk, a thousand failed ideas cost you electricity.</p></blockquote><p>Nobody’s metering your curiosity. Fine-tune something weird, run an eval overnight, break it, try again.</p><h2>Reason two: the data can’t leave</h2><p>For a lot of companies this decides it before anyone opens a spreadsheet.</p><ul><li><p><strong>Preservation orders:</strong> in May 2025 a US court ordered OpenAI to preserve ChatGPT output logs that would otherwise have been deleted. The order was narrowed in October, but for five months, deleting a chat didn’t delete it. Great news for anyone who’d pasted a client contract in there.</p></li><li><p><strong>Jurisdiction:</strong> the US CLOUD Act lets US authorities reach data held by US companies wherever it’s stored, and the EU is pulling the other way, with the Commission proposing graded limits on US hyperscalers’ access to EU data in June.</p></li><li><p><strong>Regulation:</strong> ITAR-controlled technical data can’t sit on systems foreign nationals can reach, and standard ChatGPT tiers can’t process patient data under HIPAA.</p></li><li><p><strong>People:</strong> in 2023, Samsung engineers pasted chip source code and internal meeting notes into ChatGPT on three separate occasions, which I assume made for a fun week in legal.</p></li></ul><p><strong>None of that cares what the model costs.</strong> A solo developer is choosing between two subscriptions.</p><blockquote><p>A bank, a hospital or a defence contractor is choosing between a model inside the building and no AI on that data at all.</p></blockquote><p>You rarely see that second group on X, mostly because they’re not allowed to post about it.</p><h2>Is a local LLM actually good enough?</h2><figure><img src="https://humza.io/blog/nobody-runs-a-local-llm-to-save-money/open-vs-closed-model-index.webp" alt="Bar chart titled “Best open model: 12 points behind, 1/50th the cost.” Artificial Analysis Intelligence Index, October 2026: Claude Opus 5.5 scores 58, GPT-6 Astra 53, Claude Fable 5.1 53, MiMo-V2.6-Pro (open) 46, GLM-5.3 (open) 45, Kimi K3 (open) 44." width="1600" height="900" loading="lazy" decoding="async"><figcaption>Artificial Analysis Intelligence Index, October 2026</figcaption></figure><p>On the <a href="https://artificialanalysis.ai/" rel="noopener">Artificial Analysis</a> index, <a href="https://rits.shanghai.nyu.edu/ai/claude-opus-5-5-takes-the-top-spot-on-artificial-analysis-at-58/" rel="noopener">Claude Opus 5.5 scores 58</a>. The best open-weight model, Xiaomi’s MiMo-V2.6-Pro, scores 46 and costs about $0.13 per task against Opus’s $6. Epoch AI puts the best open model an average of four months behind the best closed one. Opus 5.5 pulled ahead again in September, and if the pattern holds, the open models catch up within months.</p><figure><img src="https://humza.io/blog/nobody-runs-a-local-llm-to-save-money/what-fits-on-which-machine.webp" alt="Bar chart titled “What fits on which machine,” showing approximate 4-bit weight size: Kimi K3 2.8T about 1,575 GB, MiMo-V2.6-Pro 1.0T about 562 GB, GLM-5.3 753B about 424 GB, GLM-5.3-Flash 320B about 180 GB, DeepSeek V4-Flash 284B about 160 GB, Qwen 3.8 27B about 15 GB, with marker lines for 96GB, 128GB and 512GB machines and a 4 x 512GB cluster." width="1600" height="900" loading="lazy" decoding="async"><figcaption>What fits on which machine, 4-bit weights</figcaption></figure><ul><li><p><strong>96 to 128GB:</strong> handles the 27B to 120B class comfortably.</p></li><li><p><strong>256GB Mac Studio:</strong> the 160 to 180GB Flash models, DeepSeek V4-Flash and GLM-5.3-Flash.</p></li><li><p><strong>512GB Mac Studio:</strong> GLM-5.3, the second-best open model on the index, just fits once that configuration ships later this month, as long as you raise the macOS GPU memory limit and keep contexts short.</p></li><li><p><strong>Several machines:</strong> MiMo needs two of them and Kimi K3 needs four.</p></li></ul><p>8-bit lands within a point of full precision on standard benchmarks, and 4-bit costs a few points, more on some models.</p><p>For the private-data crowd, that’s plenty for the boring, high-volume work most companies actually have:</p><ul><li><p>Pulling fields out of documents and scans</p></li><li><p>Tagging and routing tickets and emails</p></li><li><p>Summarising and searching internal docs</p></li><li><p>Transcription and code completion</p></li></ul><p>Long agent runs are still weak. Local models lose the thread after many turns, emit broken tool calls and write patches that don’t apply, and that’s the work I still send to Claude and Codex.</p><blockquote><p><strong>The setups that work route by task: narrow, high-volume work runs locally and hard reasoning goes to the frontier.</strong></p></blockquote><h2>Fine, let’s talk about money: local LLM vs cloud API cost</h2><p>Since the replies insist. Renting is cheap right now because someone else is paying. By one team’s measurement, a maxed-out Max 20x plan moves about 1.9 billion tokens a week through Claude Code, 96% of them cache reads. At Opus 5.5’s API rates that’s as much as $4,000 a month if every token went to Opus. You pay $200.</p><figure><img src="https://humza.io/blog/nobody-runs-a-local-llm-to-save-money/subscription-vs-api-vs-hardware-cost.webp" alt="Bar chart titled “A maxed-out $200 plan uses up to about $4,000 a month of API.” Monthly cost: the same Max usage at Opus API rates up to about $4,000, DGX Spark 128GB $201, Claude Max 20x $200, Mac Studio M5 Ultra 96GB $171, Framework Desktop 128GB $104." width="1600" height="900" loading="lazy" decoding="async"><figcaption>Monthly cost: subscription vs API rates vs owned hardware</figcaption></figure><blockquote><p>Sam Altman, January 2025: OpenAI was losing money on the $200 ChatGPT Pro plan because “people use it much more than we expected.”</p></blockquote><p>Subsidies end, and we’ve already watched it start:</p><ul><li><p><strong>Copilot</strong> moved to usage-based billing on 1 June 2026, and annual subscribers on the old plan watched Opus 4.6 go from a 3x to a 27x request multiplier overnight.</p></li><li><p><strong>Cursor</strong> swapped request limits for compute credits in mid-2025.</p></li><li><p><strong>Gemini 3.5 Flash</strong> launched at 5x the input price and 3.6x the output price of 2.5 Flash.</p></li></ul><p>Owning isn’t free either. Spread over three years with power included:</p><ul><li><p><strong>Framework Desktop (128GB):</strong> about $104 a month</p></li><li><p><strong>Mac Studio (96GB):</strong> about $171 a month</p></li><li><p><strong>DGX Spark (128GB):</strong> about $201 a month</p></li></ul><p>Memory shortages have pushed hardware up too, with the RTX Pro 6000 going from $8,565 at launch to $13,000–16,000 by August. And an idle box is the most expensive way to buy tokens. A June 2026 paper found self-hosting costs 2.5 to 24x more per token at low load than at full load.</p><p><strong>So local only wins on price when the machine stays busy</strong> with batch jobs, steady pipelines or a team sharing one box. For everyone else the money is a side effect.</p><h2>Where this goes</h2><figure><img src="https://humza.io/blog/nobody-runs-a-local-llm-to-save-money/fixed-intelligence-price-curve.webp" alt="Two charts titled “Fixed intelligence gets cheaper. Renting the frontier doesn’t.” On the left, the price of a fixed capability level falls from 100 now to 8 in a year and 0.6 in two years. On the right, 2026 price moves: Copilot Opus 4.6 multiplier 9x, Gemini Flash input 5x, Gemini Flash output 3.6x." width="1600" height="900" loading="lazy" decoding="async"><figcaption>Fixed intelligence gets cheaper; renting the frontier doesn’t</figcaption></figure><blockquote><p><strong>The cost of reaching a fixed level of capability has fallen about 47% a quarter since 2023, roughly 13x a year (<a href="https://epoch.ai/publications/the-plunging-price-of-thought" rel="noopener">Epoch AI</a>).</strong></p></blockquote><p>The tinkerers get last year’s frontier on their desk, and the companies with locked-down data get a model good enough to do real work inside the building.</p><p>The 512GB Mac Studio ships later this month. If GLM-5.3 runs well on it, the second-best open model in the world fits on one desk, and the replies will still tell you to buy Claude Max.</p><h2>FAQ: local LLM vs cloud API</h2><h3>Is a local LLM cheaper than a Claude or ChatGPT subscription?</h3><p>Only when the machine stays busy with batch jobs, steady pipelines or a team sharing one box. Spread over three years with power included, a Framework Desktop (128GB) costs about $104 a month, a Mac Studio (96GB) about $171 and a DGX Spark (128GB) about $201, against $200 for a Max 20x plan. A June 2026 paper found self-hosting costs 2.5 to 24x more per token at low load than at full load.</p><h3>Why run a local LLM at all?</h3><p>For one of two reasons: you want to understand how inference works (quantisation, memory bandwidth, context and load), or you have data that isn’t allowed to leave, whether because of preservation orders, jurisdiction, regulation such as HIPAA and ITAR, or plain human error.</p><h3>Are open-weight models good enough to replace a cloud API?</h3><p>For narrow, high-volume work, yes: extracting fields from documents, tagging and routing tickets, summarising and searching internal docs, transcription and code completion. For long agent runs they are still weak, so the setups that work route by task and send hard reasoning to a frontier model.</p><h3>How much memory do I need to run a local LLM?</h3><p>At 4-bit weights, 96 to 128GB handles the 27B to 120B class, a 256GB Mac Studio runs the 160 to 180GB Flash models, and a 512GB Mac Studio just fits GLM-5.3. MiMo needs two machines and Kimi K3 needs four.</p><hr><p><em>If your data can’t leave the building and you want AI working on it anyway, that’s the kind of system I help companies build. Reach out at <a href="mailto:hello@humza.io">hello@humza.io</a></em></p>]]></content:encoded>
    </item>
    <item>
      <title>Stop reading the code. Start proving it&apos;s clean, fast and secure.</title>
      <link>https://humza.io/blog/stop-reading-the-code-start-proving/</link>
      <guid isPermaLink="true">https://humza.io/blog/stop-reading-the-code-start-proving/</guid>
      <pubDate>Mon, 19 Oct 2026 00:00:00 GMT</pubDate>
      <description>How to verify AI-generated code: reviews rarely catch bugs, so use independent checkers, run the code, and gate CI on clean, fast and secure.</description>
      <category>ai</category>
      <category>code-review</category>
      <category>testing</category>
      <category>verification</category>
      <content:encoded><![CDATA[<figure><img src="https://humza.io/blog/stop-reading-the-code-start-proving/cover.webp" alt="Dark title card reading “Stop reading the code. Prove it.” with code-like characters passing through a glass filter and coming out as clean dotted lines." width="1672" height="941" loading="eager" fetchpriority="high" decoding="async"></figure><p>A few weeks ago I had agents spec out an autonomous trading desk: 231 files of design docs, specs, build slices and a Go scaffold, shipped as 35 small PRs. Codex wrote every word, Claude orchestrated, and I read maybe a dozen files properly.</p><p>My first instinct was guilt. Then I went looking for the evidence that reading code was ever what kept it honest. There isn’t much.</p><h2>Reading was always a weak check</h2><p>Microsoft studied its own code reviews and found that only about 15% of reviewer comments point to a possible defect, “much less a blocking defect” (<a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2015/05/PID3556473.pdf" rel="noopener">Czerwonka, Greiler, Tilford, 2015</a>). Most comments were about long-term maintainability. An earlier Microsoft study came to the same place: developers expect review to find bugs, but what it mostly delivers is knowledge transfer and team awareness (<a href="https://www.microsoft.com/en-us/research/?p=164195" rel="noopener">Bacchelli &amp; Bird, 2013</a>).</p><figure><img src="https://humza.io/blog/stop-reading-the-code-start-proving/review-comments-share.png" alt="Bar chart titled “Most code review comments aren’t about bugs.” About 15% of Microsoft reviewer comments point to a possible defect. The other 85% cover maintainability, style, and everything else." width="1600" height="900" loading="lazy" decoding="async"></figure><p>Science has run the cleanest version of this test. The BMJ sent 607 peer reviewers papers with nine major errors planted in them. On average they found 2.58 (<a href="https://researchonline.lshtm.ac.uk/id/eprint/6900" rel="noopener">Schroter et al., 2004</a>). These are experts, reading slowly, whose actual job is finding mistakes.</p><p>The reason is human hardware. Vigilance research says nobody, however motivated, can keep watching for rare problems for much more than half an hour (<a href="https://gwern.net/doc/sociology/technology/1983-bainbridge.pdf" rel="noopener">Bainbridge, 1983</a>). The industry review guidance says the same thing in practice: under 400 lines, under 60 to 90 minutes, or detection falls off (<a href="https://smartbear.com/resources/case-studies/cisco-systems-collaborator/" rel="noopener">SmartBear/Cisco</a>). An agent can produce 400 lines before you’ve finished your coffee.</p><p>So reading code was never a reliable bug filter. It worked because volume was low and it carried two other jobs along with it: a second person understood the change, and someone put their name on it.</p><h2>Every field that scaled hit this wall first</h2><p>Manufacturing got there in the 1950s. Deming’s third point: “Cease dependence on inspection to achieve quality.” Inspection at the end of the line is too late, the defect is already in the product. You build quality into the process instead (<a href="https://www.ifm.eng.cam.ac.uk/research/dstools/demings-14-points/" rel="noopener">Deming’s 14 points</a>).</p><p>Science got there too. Nobody trusts a result because two reviewers read it. They trust it because someone else ran it again.</p><p>Reading every line of agent code is end-of-line inspection. It doesn’t scale, and it wasn’t catching much when it did.</p><h2>What “built-in quality” looks like with agents</h2><p>There’s an asymmetry that makes this work. Plenty of things are much easier to check than to produce, and AI gets good fastest at whatever is easy to verify (<a href="https://www.jasonwei.net/blog/asymmetry-of-verification-and-verifiers-law" rel="noopener">Jason Wei, verifier’s law</a>). Writing a trading engine is hard. Checking that it rejects an order over the position limit is a test.</p><p>So the work moves from reading output to building checks. Three things matter most.</p><h3>1. Checkers that don’t share your blind spots</h3><p>In 1986, Knight and Leveson had 27 programmers write the same program independently. The programs failed together far more often than chance predicts, because people make the same mistakes on the same hard parts (<a href="https://www.kth.se/social/files/564df871f2765419e306178d/KnightLeveson.pdf" rel="noopener">Knight &amp; Leveson</a>). Two checkers who think alike are closer to one.</p><p>Models are worse here than people. Letting a model refine its own code five rounds in a row, with no outside check, produced a <a href="https://arxiv.org/abs/2506.11022" rel="noopener">37.6% increase in critical vulnerabilities</a>.</p><p>On the trading desk I ran three reviewer agents, each with one lens: consistency, money-path safety, and “could a fresh agent actually build this slice”. First pass: 87 findings, 43 of them blocking. Almost all of them sat in the seams between files, where no single writer owned both sides. A manifest path spelled two ways, a test ID cited in one doc and missing from the catalogue. A separate arbiter agent made the binding call when they disagreed, 33 times. Otherwise you get agents politely arguing forever.</p><h3>2. Run it, don’t read it</h3><p>A diff tells you what the code says. A test run tells you what it does.</p><p>Every slice in my build plan names its test IDs up front, and a slice isn’t done until they exist and pass. Coverage goes unit to e2e, no exceptions. Seeds aren’t dummy data; they need to look like prod in shape, if not in volume.</p><p>One catch: agents will game a check if they can. METR caught frontier models modifying tests and monkey-patching evaluators to get a perfect score (<a href="https://metr.org/blog/2025-06-05-recent-reward-hacking" rel="noopener">METR, 2025</a>). So the agent writing the code doesn’t get to own the tests that grade it.</p><h3>3. Write the context down, inside the repo</h3><p>An agent can only be checked against what’s written down. ADRs, runbooks, schema commentary, the ICP, all inside the codebase. If an agent can’t grep it, it doesn’t exist.</p><p>Same for the reasoning. Every agent conversation gets attached to the PR, so when something breaks I read a few paragraphs of reasoning instead of a few thousand lines of code.</p><h2>Prove it’s clean, fast and secure</h2><p>Passing tests is the floor. “It works” is the thing models have got best at. What they’re still weak on is what a careful reader used to look for, and each one has a check that does it better than a reader.</p><p><strong>Clean.</strong> GitClear analyzed 211 million changed lines from 2020 to 2024. As AI assistants spread, duplicated code blocks rose eightfold in 2024, and for the first time in their data, copy-pasted code outpaced refactored code (<a href="https://www.devclass.com/ai-ml/2025/02/20/ai-is-eroding-code-quality-states-new-in-depth-report/1626250" rel="noopener">DevClass on GitClear, 2025</a>). Messy code costs real time. Across 39 production codebases, tasks in the unhealthiest code took 124% longer, and that code had 15 times more defects (<a href="https://arxiv.org/abs/2203.04374" rel="noopener">Tornhill &amp; Borg, 2022</a>). The check: duplication and complexity limits in CI, plus a code-health score that fails the build when it drops.</p><figure><img src="https://humza.io/blog/stop-reading-the-code-start-proving/unhealthy-code-chart.png" alt="Bar chart comparing time to complete a task. Healthy code is the baseline. Warning-level code takes 78% longer. Alert-level red code takes 124% longer and has 15 times more defects." width="1600" height="900" loading="lazy" decoding="async"></figure><p><strong>Fast.</strong> Correct isn’t quick. On EffiBench, GPT-4’s working solutions took 3.12 times as long to run as human-written ones on average, and in the worst cases 13.89 times as long with 43.92 times the memory (<a href="https://arxiv.org/abs/2402.02037" rel="noopener">Huang et al., 2024</a>). The check: performance budgets in CI. Benchmarks on the hot paths that fail the build when latency or memory regresses.</p><p><strong>Secure.</strong> Veracode gave more than 100 models 80 coding tasks. 45% of the code had a security flaw, 72% in Java, and newer, bigger models were no better at security even as they got better at writing working code (<a href="https://www.veracode.com/resources/genai-code-security-report/" rel="noopener">Veracode, 2025</a>). The check: static analysis and dependency scanning on every PR, plus a reviewer agent whose only job is security.</p><p><strong>And the tests themselves.</strong> A passing suite only proves what it tests. Mutation testing breaks the code on purpose and checks that a test fails. Google runs it inside code review, across millions of mutants (<a href="https://arxiv.org/abs/2102.11378" rel="noopener">Petrović et al.</a>). A mutant that survives means a test that wasn’t checking anything.</p><h2>Where the human goes</h2><p>Bainbridge’s paper is called <em>Ironies of Automation</em>, and the biggest irony applies to us. Automate the work, leave the human watching, and you’ve given them the one job humans are worst at. Their skills fade from disuse, and they’re still the one blamed when it fails. Madeleine Clare Elish calls that person the <a href="https://estsjournal.org/index.php/ests/article/view/1089" rel="noopener">moral crumple zone</a>. Research on automation bias adds that training and instructions don’t prevent it (<a href="https://depositonce.tu-berlin.de/items/0c787d91-6021-480b-a333-009e0d1d0092/full" rel="noopener">Parasuraman &amp; Manzey, 2010</a>).</p><p>So “skim the agent’s PRs” is the worst of both. You’re not really checking, and you’re still on the hook.</p><p>The useful human work sits upstream. My one real mistake on that build wasn’t in the code. I let a research pass pick Python for the stack, never asked myself the question, and ended up migrating the whole design to Go. No line of code came close to costing me that much.</p><p>Agents are very good at code that is locally right. The expensive mistakes are decisions: the architecture, the language, the data model, what to test, what not to build at all. Those are what I read now.</p><p>Be the validator, not the proofreader. Comprehension is now a function of our tools, not a state of our minds. Weird, novel and kinda scary, but we were never as good at the old way as we thought.</p><hr><p><em>If you need better validation and systems in your org so you can ship with confidence, that’s what I help companies build. Reach out at <a href="mailto:hello@humza.io">hello@humza.io</a></em></p>
]]></content:encoded>
    </item>
  </channel>
</rss>
