<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Huge</title>
    <description>The latest articles on DEV Community by Huge (@huge).</description>
    <link>https://dev.to/huge</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F517886%2F4d16769b-7270-41f6-906e-c2bfb5309d97.png</url>
      <title>DEV Community: Huge</title>
      <link>https://dev.to/huge</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/huge"/>
    <language>en</language>
    <item>
      <title>The ARMv9 Speed Paradox: Auditing Real-World Code with Gemma 4 on Bare Metal</title>
      <dc:creator>Huge</dc:creator>
      <pubDate>Sun, 25 Oct 2026 09:45:03 +0000</pubDate>
      <link>https://dev.to/huge/the-armv9-speed-paradox-auditing-real-world-code-with-gemma-4-on-bare-metal-5056</link>
      <guid>https://dev.to/huge/the-armv9-speed-paradox-auditing-real-world-code-with-gemma-4-on-bare-metal-5056</guid>
      <description>&lt;p&gt;&lt;em&gt;This article is submitted for the &lt;a href="https://dev.to/challenges/hacktoberfest-week3-2026-10-19"&gt;DEV Hacktoberfest 2026 Open-Source AI Challenge: Week 3&lt;/a&gt; ("Slow and Steady"), competing in the **Best Use of Gemma&lt;/em&gt;* category.*&lt;/p&gt;




&lt;p&gt;Running automated security audits on real-world codebases with frontier LLMs usually comes with two painful tradeoffs: cloud API bills and headaches or stripped-down context windows that miss cross-file vulnerabilities. &lt;/p&gt;

&lt;p&gt;For &lt;a href="https://dev.to/challenges/hacktoberfest-week3-2026-10-19"&gt;Week 3 of Hacktoberfest 2026&lt;/a&gt;, we took the "Slow and Steady" ethos literally: what happens when you run Google's &lt;strong&gt;Gemma 4&lt;/strong&gt; family on bare-metal ARMv9 silicon with a massive &lt;strong&gt;65,536-token context window&lt;/strong&gt;, evaluating real open-source targets against known ground-truth vulnerabilities?&lt;/p&gt;

&lt;p&gt;We deployed a headless test runner across Google Cloud ARM64 instances (&lt;code&gt;c4a-standard-8&lt;/code&gt;, 8 vCPUs on Neoverse-V2 silicon, 32 GB RAM) and pitted multiple architectures and quantization schemes against each other:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://huggingface.co/unsloth/gemma-4-12b-it-GGUF" rel="noopener noreferrer"&gt;unsloth/gemma-4-12b-it-GGUF&lt;/a&gt;&lt;/strong&gt; (Dense 12B across 4 quantization levels: &lt;a href="https://huggingface.co/unsloth/gemma-4-12b-it-GGUF?show_file_info=gemma-4-12b-it-UD-Q2_K_XL.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;UD-Q2_K_XL&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://huggingface.co/unsloth/gemma-4-12b-it-GGUF?show_file_info=gemma-4-12b-it-IQ4_XS.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;IQ4_XS&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://huggingface.co/unsloth/gemma-4-12b-it-GGUF?show_file_info=gemma-4-12b-it-UD-Q4_K_XL.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;UD-Q4_K_XL&lt;/code&gt;&lt;/a&gt;, and &lt;a href="https://huggingface.co/unsloth/gemma-4-12b-it-GGUF?show_file_info=gemma-4-12b-it-UD-Q6_K_XL.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;UD-Q6_K_XL&lt;/code&gt;&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://huggingface.co/bottlecapai/ThinkingCap-gemma-4-26B-A4B-it-GGUF" rel="noopener noreferrer"&gt;bottlecapai/ThinkingCap-gemma-4-26B-A4B-it-GGUF&lt;/a&gt;&lt;/strong&gt; (Mixture-of-Experts with 26B total parameters and 4B active: &lt;a href="https://huggingface.co/bottlecapai/ThinkingCap-gemma-4-26B-A4B-it-GGUF?show_file_info=ThinkingCap-gemma-4-26B-A4B-it-Q4_K_M.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;Q4_K_M&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://huggingface.co/bottlecapai/ThinkingCap-gemma-4-26B-A4B-it-GGUF?show_file_info=ThinkingCap-gemma-4-26B-A4B-it-Q6_K.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;Q6_K&lt;/code&gt;&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://huggingface.co/prism-ml/Ternary-Bonsai-2-27B-gguf" rel="noopener noreferrer"&gt;prism-ml/Ternary-Bonsai-2-27B-gguf&lt;/a&gt;&lt;/strong&gt; (1.58-bit ternary quantization: &lt;a href="https://huggingface.co/prism-ml/Ternary-Bonsai-2-27B-gguf?show_file_info=Ternary-Bonsai-2-27B-PTQ1_0.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;PTQ1_0&lt;/code&gt;&lt;/a&gt; executed via custom &lt;a href="https://github.com/PrismML-Eng/llama.cpp" rel="noopener noreferrer"&gt;PrismML-Eng/llama.cpp&lt;/a&gt; kernels)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is what we discovered about ARMv9 SIMD execution, context scaling, and vulnerability detection precision.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Test Targets: Verified Ground Truth
&lt;/h3&gt;

&lt;p&gt;Rather than synthetic benchmarks or toy examples, we scanned two real-world Go projects where &lt;a href="https://bs.ehlas.cz/stories/yopass-oidc-email-verified/" rel="noopener noreferrer"&gt;our team previously discovered and remediated&lt;/a&gt; zero-day security flaws:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/jhaals/yopass" rel="noopener noreferrer"&gt;jhaals/yopass&lt;/a&gt;&lt;/strong&gt; checked out at commit &lt;a href="https://github.com/jhaals/yopass/tree/16bc350a27ab6b23031e02d496a261cac846206f" rel="noopener noreferrer"&gt;&lt;code&gt;16bc350a&lt;/code&gt;&lt;/a&gt; (pre-fix commit before the merged patch in &lt;a href="https://github.com/jhaals/yopass/pull/3973" rel="noopener noreferrer"&gt;PR #3973&lt;/a&gt;).  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scanned files: &lt;a href="https://github.com/jhaals/yopass/blob/16bc350a27ab6b23031e02d496a261cac846206f/pkg/server/oidc.go" rel="noopener noreferrer"&gt;&lt;code&gt;pkg/server/oidc.go&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/jhaals/yopass/blob/16bc350a27ab6b23031e02d496a261cac846206f/pkg/server/apitoken.go" rel="noopener noreferrer"&gt;&lt;code&gt;pkg/server/apitoken.go&lt;/code&gt;&lt;/a&gt;, and &lt;a href="https://github.com/jhaals/yopass/blob/16bc350a27ab6b23031e02d496a261cac846206f/pkg/server/middleware.go" rel="noopener noreferrer"&gt;&lt;code&gt;pkg/server/middleware.go&lt;/code&gt;&lt;/a&gt; (646 lines, 22,181 characters).&lt;/li&gt;
&lt;li&gt;Ground truth flaw: Missing validation of the &lt;code&gt;email_verified&lt;/code&gt; claim in the OIDC userinfo handler, allowing unverified identities to bypass access controls.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/rs/curlie" rel="noopener noreferrer"&gt;rs/curlie&lt;/a&gt;&lt;/strong&gt; checked out at commit &lt;a href="https://github.com/rs/curlie/tree/5dfcbb17ea673b66a3faab66d2ff5f24145f45a8" rel="noopener noreferrer"&gt;&lt;code&gt;5dfcbb17&lt;/code&gt;&lt;/a&gt; (pre-fix commit before patches &lt;a href="https://github.com/rs/curlie/pull/104" rel="noopener noreferrer"&gt;PR #104&lt;/a&gt; and &lt;a href="https://github.com/rs/curlie/pull/105" rel="noopener noreferrer"&gt;PR #105&lt;/a&gt;).  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scanned files: &lt;a href="https://github.com/rs/curlie/blob/5dfcbb17ea673b66a3faab66d2ff5f24145f45a8/main.go" rel="noopener noreferrer"&gt;&lt;code&gt;main.go&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/rs/curlie/blob/5dfcbb17ea673b66a3faab66d2ff5f24145f45a8/args/httpie.go" rel="noopener noreferrer"&gt;&lt;code&gt;args/httpie.go&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/rs/curlie/blob/5dfcbb17ea673b66a3faab66d2ff5f24145f45a8/args/parse.go" rel="noopener noreferrer"&gt;&lt;code&gt;args/parse.go&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/rs/curlie/blob/5dfcbb17ea673b66a3faab66d2ff5f24145f45a8/formatter/json.go" rel="noopener noreferrer"&gt;&lt;code&gt;formatter/json.go&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://github.com/rs/curlie/blob/5dfcbb17ea673b66a3faab66d2ff5f24145f45a8/formatter/color.go" rel="noopener noreferrer"&gt;&lt;code&gt;formatter/color.go&lt;/code&gt;&lt;/a&gt;, and &lt;a href="https://github.com/rs/curlie/blob/5dfcbb17ea673b66a3faab66d2ff5f24145f45a8/formatter/binaryfilter.go" rel="noopener noreferrer"&gt;&lt;code&gt;formatter/binaryfilter.go&lt;/code&gt;&lt;/a&gt; (723 lines, 15,312 characters).&lt;/li&gt;
&lt;li&gt;Ground truth flaws: Arbitrary local file read in &lt;code&gt;args/httpie.go&lt;/code&gt; via HTTPie-compatible &lt;code&gt;@filename&lt;/code&gt; multipart form syntax, and terminal ANSI escape sequence injection in &lt;code&gt;formatter/json.go&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  The Full Benchmark Dataset
&lt;/h3&gt;

&lt;p&gt;Across dozens of hours of headless execution on Neoverse-V2 cores, here are the complete measurements:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model &amp;amp; Quantization&lt;/th&gt;
&lt;th&gt;Size (GB)&lt;/th&gt;
&lt;th&gt;Prompt Eval&lt;/th&gt;
&lt;th&gt;Token Gen&lt;/th&gt;
&lt;th&gt;yopass (Time / Triage)&lt;/th&gt;
&lt;th&gt;curlie (Time / Triage)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gemma-4-12B &lt;a href="https://huggingface.co/unsloth/gemma-4-12b-it-GGUF?show_file_info=gemma-4-12b-it-UD-Q2_K_XL.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;UD-Q2_K_XL&lt;/code&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;4.34 GB&lt;/td&gt;
&lt;td&gt;8.30 t/s&lt;/td&gt;
&lt;td&gt;8.38 t/s&lt;/td&gt;
&lt;td&gt;4,040 s (0 valid / 0 rejected)&lt;/td&gt;
&lt;td&gt;8,720 s (2 valid / 0 rejected)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemma-4-12B &lt;a href="https://huggingface.co/unsloth/gemma-4-12b-it-GGUF?show_file_info=gemma-4-12b-it-IQ4_XS.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;IQ4_XS&lt;/code&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;5.94 GB&lt;/td&gt;
&lt;td&gt;10.83 t/s&lt;/td&gt;
&lt;td&gt;11.16 t/s&lt;/td&gt;
&lt;td&gt;9,260 s (1 valid / 3 rejected)&lt;/td&gt;
&lt;td&gt;18,260 s (6 valid / 7 rejected)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemma-4-12B &lt;a href="https://huggingface.co/unsloth/gemma-4-12b-it-GGUF?show_file_info=gemma-4-12b-it-UD-Q4_K_XL.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;UD-Q4_K_XL&lt;/code&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;6.86 GB&lt;/td&gt;
&lt;td&gt;15.12 t/s&lt;/td&gt;
&lt;td&gt;11.08 t/s&lt;/td&gt;
&lt;td&gt;7,375 s (1 valid / 3 rejected)&lt;/td&gt;
&lt;td&gt;12,715 s (4 valid / 6 rejected)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemma-4-12B &lt;a href="https://huggingface.co/unsloth/gemma-4-12b-it-GGUF?show_file_info=gemma-4-12b-it-UD-Q6_K_XL.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;UD-Q6_K_XL&lt;/code&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;9.95 GB&lt;/td&gt;
&lt;td&gt;14.92 t/s&lt;/td&gt;
&lt;td&gt;8.06 t/s&lt;/td&gt;
&lt;td&gt;8,730 s (1 valid / 3 rejected)&lt;/td&gt;
&lt;td&gt;19,739 s (2 valid / 11 rejected)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ThinkingCap-26B-A4B &lt;a href="https://huggingface.co/bottlecapai/ThinkingCap-gemma-4-26B-A4B-it-GGUF?show_file_info=ThinkingCap-gemma-4-26B-A4B-it-Q4_K_M.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;Q4_K_M&lt;/code&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;15.84 GB&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;55.24 t/s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;21.78 t/s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;3,170 s&lt;/strong&gt; (0 valid / 5 rejected)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;6,404 s&lt;/strong&gt; (2 valid / 12 rejected)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ThinkingCap-26B-A4B &lt;a href="https://huggingface.co/bottlecapai/ThinkingCap-gemma-4-26B-A4B-it-GGUF?show_file_info=ThinkingCap-gemma-4-26B-A4B-it-Q6_K.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;Q6_K&lt;/code&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;21.70 GB&lt;/td&gt;
&lt;td&gt;54.37 t/s&lt;/td&gt;
&lt;td&gt;21.04 t/s&lt;/td&gt;
&lt;td&gt;3,213 s (1 valid / 4 rejected)&lt;/td&gt;
&lt;td&gt;OOM crash at 2,500 s (32 GB RAM ceiling)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ternary-Bonsai-27B &lt;a href="https://huggingface.co/prism-ml/Ternary-Bonsai-2-27B-gguf?show_file_info=Ternary-Bonsai-2-27B-PTQ1_0.gguf" rel="noopener noreferrer"&gt;&lt;code&gt;PTQ1_0&lt;/code&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;5.54 GB&lt;/td&gt;
&lt;td&gt;6.85 t/s&lt;/td&gt;
&lt;td&gt;3.68 t/s&lt;/td&gt;
&lt;td&gt;22,970 s (1 valid / 4 rejected)&lt;/td&gt;
&lt;td&gt;27,090 s (1 valid / 3 rejected)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemma-4-26B-A4B &lt;em&gt;(Vertex MaaS, Cloud)&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;Cloud API&lt;/td&gt;
&lt;td&gt;~650 t/s&lt;/td&gt;
&lt;td&gt;55.10 t/s&lt;/td&gt;
&lt;td&gt;62 s (0 valid / 4 rejected)&lt;/td&gt;
&lt;td&gt;90 s (4 valid / 9 rejected)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Bold values indicate best performance among local bare-metal CPU runs. Managed cloud API is included as an external reference baseline.&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Four Engineering Insights from Bare-Metal Execution
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. The ARMv9 Hardware Paradox: 4-bit Beats 2-bit
&lt;/h4&gt;

&lt;p&gt;Conventional intuition assumes smaller quants run faster because of reduced memory traffic. On 8 DDR5-backed Neoverse-V2 cores, the opposite occurred:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;UD-Q4_K_XL&lt;/code&gt; (6.86 GB) achieved &lt;strong&gt;15.12 tokens/second&lt;/strong&gt; on prompt evaluation—nearly &lt;strong&gt;double&lt;/strong&gt; the throughput of &lt;code&gt;UD-Q2_K_XL&lt;/code&gt; (8.30 tokens/second), despite reading 58% more weight data per token!&lt;/li&gt;
&lt;li&gt;Neoverse-V2 features dual 128-bit vector pipelines with native ARMv9 &lt;code&gt;i8mm&lt;/code&gt; and &lt;code&gt;dotprod&lt;/code&gt; instructions. Byte-aligned 4-bit and 6-bit blocks unpack with minimal instruction overhead. By contrast, non-linear 2-bit packing (&lt;code&gt;Q2_K&lt;/code&gt;) and variable-rate lookup grids (&lt;code&gt;IQ4_XS&lt;/code&gt;) force the CPU into heavy bit-shifting, masking, and table indirection on scalar/integer ALUs. On modern CPU architectures, SIMD unpacking overhead easily dwarfs memory bus contention.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. The Mixture-of-Experts Supremacy on CPU
&lt;/h4&gt;

&lt;p&gt;The sparse &lt;a href="https://huggingface.co/bottlecapai/ThinkingCap-gemma-4-26B-A4B-it-GGUF" rel="noopener noreferrer"&gt;ThinkingCap-Gemma-4-26B-A4B&lt;/a&gt; architecture routed every token to only 4 billion active parameters out of 26 billion total. On bare CPU, it sustained over &lt;strong&gt;55 tokens/second&lt;/strong&gt; during prompt ingestion and &lt;strong&gt;21.8 tokens/second&lt;/strong&gt; during generation. It completed the full repository audits in half the wall-clock time of 12B dense models, while retaining the reasoning breadth of a 26B parameter model.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. The 1.58-Bit Quantization Floor and Triage Immunity
&lt;/h4&gt;

&lt;p&gt;At 1.58 bits per parameter, &lt;a href="https://huggingface.co/prism-ml/Ternary-Bonsai-2-27B-gguf" rel="noopener noreferrer"&gt;Ternary-Bonsai-2-27B&lt;/a&gt; fits 27 billion parameters into 5.54 GB of RAM. However, during deep 65k context code analysis on CPU:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It generated at &lt;strong&gt;3.68 tokens/second&lt;/strong&gt; via custom PrismML bit-emulation routines.&lt;/li&gt;
&lt;li&gt;More importantly, extreme quantization degraded cross-domain semantic coherence: when analyzing Go source code (&lt;code&gt;oidc.go&lt;/code&gt;), it hallucinated C functions (&lt;code&gt;void parse_packet&lt;/code&gt; with &lt;code&gt;memcpy&lt;/code&gt;) from its pre-training data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The system immune response:&lt;/strong&gt; Our multi-round skeptical triage layer immediately caught the hallucination. The verifier grepped the target codebase, confirmed no such C construct existed, and rejected the finding with a confidence of 0% (&lt;code&gt;[III→I]&lt;/code&gt;). A disciplined multi-round pipeline successfully neutralized model hallucinations even under severe quantization breakdown.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  4. 65k Context Sizing on 32 GB RAM
&lt;/h4&gt;

&lt;p&gt;When deploying a 65,536-token context window with 8-bit KV caching (&lt;code&gt;-ctk q8_0 -ctv q8_0&lt;/code&gt;), the KV cache expands by 8 to 10 GB under deep reasoning chains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Models up to 16 GB (&lt;code&gt;12B&lt;/code&gt; dense and &lt;code&gt;26B-A4B-Q4_K_M&lt;/code&gt;) operated with comfortable safety margins on a 32 GB RAM instance.&lt;/li&gt;
&lt;li&gt;The 21.70 GB &lt;code&gt;26B-A4B-Q6_K&lt;/code&gt; model operated smoothly during single-turn evaluations, but hit the Linux kernel OOM limit during recursive multi-turn triage on larger files. For 65k contexts on 26B+ models, 48 GB to 64 GB of RAM is the recommended hardware baseline.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Taming the 65,536 Context Window in &lt;code&gt;llama-server&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Feeding entire repository components into local LLMs requires specific inference server tuning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;nice&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 10 llama-server &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-m&lt;/span&gt; ./models/ThinkingCap-gemma-4-26B-A4B-it-Q4_K_M.gguf &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-c&lt;/span&gt; 65536 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; 4096 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-np&lt;/span&gt; 1 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-fa&lt;/span&gt; on &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-ctk&lt;/span&gt; q8_0 &lt;span class="nt"&gt;-ctv&lt;/span&gt; q8_0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-t&lt;/span&gt; 8 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--reasoning-format&lt;/span&gt; deepseek &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--reasoning-budget&lt;/span&gt; 1536 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--host&lt;/span&gt; 127.0.0.1 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--port&lt;/span&gt; 8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three configuration flags proved essential:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-np 1&lt;/code&gt;: By default, &lt;code&gt;llama-server&lt;/code&gt; divides &lt;code&gt;-c 65536&lt;/code&gt; across multiple concurrent slots (e.g. 4 slots of 16k tokens). Passing &lt;code&gt;-np 1&lt;/code&gt; guarantees the full 64k window belongs to the security pipeline.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-fa on -ctk q8_0 -ctv q8_0&lt;/code&gt;: Flash Attention combined with 8-bit quantized KV cache reduced context memory overhead by 48%, keeping RAM usage predictable even past 45,000 prompt tokens.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--reasoning-format deepseek --reasoning-budget 1536&lt;/code&gt;: Gemma 4 outputs structured thought tokens (&lt;code&gt;&amp;lt;|thought|&amp;gt;&lt;/code&gt;). Separating thought tokens from the final JSON payload prevented grammar parsing errors when enforcing strict JSON schemas.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Two Pipeline Fixes for Local 65k Models
&lt;/h3&gt;

&lt;p&gt;Transitioning our scanner pipeline (&lt;a href="https://github.com/Huge/nano-analyzer" rel="noopener noreferrer"&gt;AISLE &lt;code&gt;nano-analyzer&lt;/code&gt;&lt;/a&gt;) to local 65k inference revealed two practical bugs:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Greedy Markdown Code Block Parsing
&lt;/h4&gt;

&lt;p&gt;The original parser used a greedy regex to locate JSON payloads:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Buggy: matches the first code fence, which may be target code inside thought reasoning
&lt;/span&gt;&lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;```

(?:json)?\s*\n?(.*?)

```&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DOTALL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When Gemma 4 analyzed code, its internal reasoning frequently quoted snippets of Go source wrapped in&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;```go&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 fences. The parser matched the first snippet, failed JSON deserialization, and dropped the audit finding.  &lt;/p&gt;

&lt;p&gt;We resolved this by iterating backward through all fenced blocks to find the true payload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Fixed: inspect blocks from bottom to top to identify the valid JSON payload
&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;reversed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;```

(?:json)?\s*\n?(.*?)

```&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DOTALL&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;JSONDecodeError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Runaway Generation Loops
&lt;/h4&gt;

&lt;p&gt;Without an explicit &lt;code&gt;max_tokens&lt;/code&gt; cap in client payloads and server flags (&lt;code&gt;-n 4096&lt;/code&gt;), repetition loops after exhausting the reasoning budget can cause the model to generate tokens until filling the 65,536-token ceiling. Enforcing explicit caps prevented multi-hour hangs on edge-case files.&lt;/p&gt;




&lt;h3&gt;
  
  
  Compute Economics: Bare-Metal CPU vs. Cloud APIs
&lt;/h3&gt;

&lt;p&gt;Benchmarking deep context windows often raises concerns about cloud infrastructure costs. For this study on &lt;a href="https://cloud.google.com/" rel="noopener noreferrer"&gt;Google Cloud Platform&lt;/a&gt;, our hardware setup consisted of &lt;code&gt;c4a-standard-8&lt;/code&gt; instances (8 vCPUs on ARM Neoverse-V2 silicon, 32 GB RAM) billed at &lt;strong&gt;$0.282 / hour&lt;/strong&gt; with standard hyperdisk storage.&lt;/p&gt;

&lt;p&gt;The total compute cost across all experimental worker instances:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;gemma-arm-26b&lt;/code&gt;&lt;/strong&gt; (ThinkingCap-26B-A4B MoE on &lt;code&gt;yopass&lt;/code&gt; and &lt;code&gt;curlie&lt;/code&gt; across &lt;code&gt;Q4_K_M&lt;/code&gt; and &lt;code&gt;Q6_K&lt;/code&gt;): ~5.5 hours runtime = &lt;strong&gt;$1.55&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;gemma-arm-c4a&lt;/code&gt;&lt;/strong&gt; (Gemma-4-12B dense across four quantization levels): ~13.5 hours runtime = &lt;strong&gt;$3.80&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;gemma-arm-bonsai&lt;/code&gt;&lt;/strong&gt; (Ternary-Bonsai-27B 1.58-bit execution): ~15.0 hours runtime = &lt;strong&gt;$4.23&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running the full local benchmark across all seven model configurations cost &lt;strong&gt;under $10.00&lt;/strong&gt; in total &lt;a href="https://cloud.google.com/" rel="noopener noreferrer"&gt;GCP&lt;/a&gt; compute expenses.&lt;/p&gt;

&lt;p&gt;For comparison, running the same audit against Google Cloud's managed Vertex AI Model Garden (&lt;code&gt;google/gemma-4-26b-a4b-it-maas&lt;/code&gt; at $0.15/M input and $0.60/M output) completed both repository audits in 2.5 minutes with a combined API cost of &lt;strong&gt;$0.06&lt;/strong&gt;. By contrast, running the same 65k multi-round skeptical triage through commercial frontier closed-source APIs regularly reaches $25 to $60 per repository.&lt;/p&gt;

&lt;p&gt;For teams working within restricted networks or private VPCs where source code cannot leave the boundary, running sparse MoE models on self-hosted ARMv9 CPU hardware offers high-depth context inspection for pennies per run.&lt;/p&gt;




&lt;h3&gt;
  
  
  Key Takeaways for Local Security Auditing
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Do not default to 2-bit quants on modern CPUs:&lt;/strong&gt; On ARMv9 Neoverse cores with DDR5 memory, integer SIMD execution makes standard 4-bit quants faster and substantially more capable than 2-bit variants.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MoE architectures excel on CPU:&lt;/strong&gt; Sparse routing provided the best throughput-to-parameter ratio, sustaining over 21 tokens/second generation and 55 tokens/second prompt ingestion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-round skeptical triage is mandatory:&lt;/strong&gt; Candidate scans produce false alarms; pairing discovery with an automated skeptical review round filters out benign patterns and neutralizes model hallucinations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;The test runner, inference configurations, and reproduction instructions are available in the open-source repository at &lt;a href="https://github.com/Huge/nano-analyzer" rel="noopener noreferrer"&gt;Huge/nano-analyzer&lt;/a&gt;. For the interactive web report and case studies, visit &lt;a href="https://huge.github.io/nano-analyzer/stories/gemma-armv9-65k-vulnerability-triage/" rel="noopener noreferrer"&gt;BudgetScan Stories&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>gemma</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
