<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged applesilicon</title>
<link>https://coderlegion.com/tag/applesilicon</link>
<description>Powered by Question2Answer</description>
<item>
<title>S-MoE: Seismic Mixture of Experts Engine</title>
<link>https://coderlegion.com/30170/s-moe-seismic-mixture-of-experts-engine</link>
<description>&lt;h3 id=&quot;s-moe-a-235-billion-parameter-model-streamed-from-a-laptop-ssd&quot;&gt;S-MoE: a 235-billion-parameter model, streamed from a laptop SSD&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;S-MoE (Seismic Mixture of Experts)&lt;/strong&gt; is an open-source inference engine for fine-grained Mixture-of-Experts LLMs on Apple Silicon. It streams experts from the NVMe SSD at the moment they are needed, so the model never has to fit in RAM. Qwen3-235B runs on a MacBook from 32 GB of unified memory up.  &lt;/p&gt;
&lt;p&gt;I am a self-taught web developer. I built this with an AI agent that knows C++ and low-level programming, because I do not.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-story&quot;&gt;The story&lt;/h3&gt;
&lt;h4 id=&quot;a-question-i-was-not-qualified-to-ask&quot;&gt;A question I was not qualified to ask&lt;/h4&gt;
&lt;p&gt;To run a frontier model like Qwen3-235B, the usual answer is that all 235 billion parameters must sit in memory at once. At bfloat16 that is roughly 470 GB. A standard MacBook has 16 to 48 GB. The conclusion everyone draws is: rent a cloud GPU.  &lt;/p&gt;
&lt;p&gt;One detail kept nagging me. In a Mixture-of-Experts model, more than 95% of those parameters are silent at any given moment. At each layer, for each token, the router picks 8 experts out of 128. The rest is cold stone, and standard runtimes hold it in RAM &quot;just in case&quot;.  &lt;/p&gt;
&lt;p&gt;So I asked the obvious, naive question: &lt;strong&gt;what if you only loaded what fires, just before it fires?&lt;/strong&gt;  &lt;/p&gt;
&lt;p&gt;I did not know enough to know it was supposed to be impossible. That turned out to be useful.  &lt;/p&gt;
&lt;h4 id=&quot;the-satellite-man-who-looked-sideways&quot;&gt;The satellite man who looked sideways&lt;/h4&gt;
&lt;p&gt;The mental model came from a place far from AI. In 2022 Ing. Filippo Biondi published a paper in &lt;em&gt;Remote Sensing&lt;/em&gt; on imaging the inside of the Great Pyramid of Giza with Synthetic Aperture Radar. Radar cannot penetrate rock. His idea was to stop fighting that: the pulse strikes the surface, the stone vibrates, and the vibrations carry the shape of what is inside. You measure what the barrier does to the signal.  &lt;/p&gt;
&lt;p&gt;I borrowed that intuition, and only the intuition:  &lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Seismic concept &lt;/th&gt;&lt;th&gt;S-MoE equivalent&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Deep rock strata &lt;/td&gt;&lt;td&gt;The expert weights, cold on the NVMe SSD&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;EM surface pulse &lt;/td&gt;&lt;td&gt;The dense backbone running the current token&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Generated phonons &lt;/td&gt;&lt;td&gt;The router gates' exact activation echo&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Acoustic receivers &lt;/td&gt;&lt;td&gt;The async I/O streamer and its retained ring&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Subsurface image &lt;/td&gt;&lt;td&gt;The generated token&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;That is where the name comes from, and why the project speaks of mountains, strikes and vaults.  &lt;/p&gt;
&lt;h4 id=&quot;built-with-an-ai-agent-honestly&quot;&gt;Built with an AI agent, honestly&lt;/h4&gt;
&lt;p&gt;I described the shape of what I wanted and asked naive questions. The agent wrote C++ and Metal. I read it, pushed back when it got too complex, and we iterated. I brought the curiosity and the direction; the agent brought the implementation depth. I understand a little more of the low-level code with each session.  &lt;/p&gt;
&lt;p&gt;The first target was a small model, DeepSeek-MoE-16B. Then the engine was refactored to be model-agnostic, and the real target arrived: Qwen3-235B, a 470 GB download onto a laptop.  &lt;/p&gt;
&lt;h4 id=&quot;what-the-numbers-corrected&quot;&gt;What the numbers corrected&lt;/h4&gt;
&lt;p&gt;The project is measurement-driven, and two of my own ideas did not survive measurement.  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The 16 GB claim.&lt;/strong&gt; The original promise was &quot;16 GB of RAM gives you the same intelligence as 512 GB, just slower&quot;. The experts really do occupy zero bytes of RAM, but the dense backbone of a 235B model weighs about 16 GB by itself. The honest floor for the frontier is 32 GB. A 16 GB Mac runs the same architecture with smaller MoE models. The manifesto was amended in public.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Scout.&lt;/strong&gt; The first design had a &quot;Surface Scout&quot; that predicted which experts the model would need next. Measured as a predictor, it covered 51.5% of the next experts at about 265 ms per token. Simply keeping recent experts in the ring covered 46.4% at zero cost, and the model's own router gate gives the exact answer with one small matrix multiply. The predictor was removed. The engine became faster and more faithful to the model at the same time.  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The whole journey is written up as an eight-part build diary, linked at the bottom.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;how-it-works&quot;&gt;How it works&lt;/h3&gt;
&lt;p&gt;A model is prepared once, then served by three parts that run concurrently.  &lt;/p&gt;
&lt;h4 id=&quot;0-the-shatter-offline-once-&quot;&gt;0. The shatter (offline, once)&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;shatter_moe.py&lt;/code&gt; takes a MoE checkpoint and splits it into two files:  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The vault&lt;/strong&gt; (&lt;code&gt;.smoe&lt;/code&gt;): every routed expert, quantised to 4 bits and aligned to Apple Silicon's 16 KB page boundary so it can be read with Direct I/O. For Qwen3-235B this is about 117 GB.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The backbone&lt;/strong&gt; (&lt;code&gt;.scout.safetensors&lt;/code&gt;): embeddings, attention, norms and routing gates, kept in bfloat16. About 16 GB for the 235B.  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The vault is self-describing. RoPE theta, routing top-k, attention geometry and lineage are written into an arch block from the checkpoint's own &lt;code&gt;config.json&lt;/code&gt;, so the engine reads what it is given and needs no per-model configuration.  &lt;/p&gt;
&lt;h4 id=&quot;1-the-resident-backbone-in-memory-&quot;&gt;1. The resident backbone (in memory)&lt;/h4&gt;
&lt;p&gt;The backbone stays in unified memory. At every layer of every token it evaluates the real router gate on the true hidden state. That names the exact experts the model wants, the same ones it was trained to use.  &lt;/p&gt;
&lt;h4 id=&quot;2-the-deep-strata-on-the-ssd-&quot;&gt;2. The deep strata (on the SSD)&lt;/h4&gt;
&lt;p&gt;The vault rests cold on NVMe and holds zero bytes of RAM. Nothing is memory-mapped &quot;just in case&quot;.  &lt;/p&gt;
&lt;h4 id=&quot;3-the-acoustic-receiver-in-between-&quot;&gt;3. The acoustic receiver (in between)&lt;/h4&gt;
&lt;p&gt;Background workers read the named experts with Direct I/O (&lt;code&gt;F_NOCACHE&lt;/code&gt;), bypassing the OS page cache, into a lock-free ring buffer a fraction of a second before the Metal GPU kernel runs them. Weights are dequantised directly in GPU registers.  &lt;/p&gt;
&lt;p&gt;The ring is also an LRU cache. Adjacent tokens reuse 46.4% of their experts, and those are already there, so they are never read again.  &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;prompt token
    │
    ▼
backbone in RAM ──► router gate ──► &quot;layer 37 needs experts 4, 19, 52, …&quot;
                                         │
                       in the ring? ─────┤
                        yes: cache hit   │ no: Direct I/O read from the vault
                                         ▼
                                  ring buffer (unified memory)
                                         │
                                         ▼
                                Metal kernel ──► next layer ──► token
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;the-rules-the-engine-never-breaks&quot;&gt;The rules the engine never breaks&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Zero runtime heap allocations.&lt;/strong&gt; &lt;code&gt;malloc&lt;/code&gt;, &lt;code&gt;new&lt;/code&gt; and &lt;code&gt;std::vector::resize&lt;/code&gt; are illegal inside the token loop. Every buffer is carved at startup.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Direct I/O only.&lt;/strong&gt; SSD to unified memory to GPU, with no page cache and no extra copies.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Atomic synchronisation only.&lt;/strong&gt; No mutexes and no condition variables. The I/O thread and the GPU thread cannot block each other.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Decoupled routing.&lt;/strong&gt; The gates measure, the streamer moves bytes, the kernel multiplies. None of them knows what the others do.  &lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;tech-stack&quot;&gt;Tech stack&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Core:&lt;/strong&gt; C++20, data-oriented, POSIX primitives  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compute:&lt;/strong&gt; Metal shaders behind an Objective-C++ bridge, zero-copy in unified memory  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooling:&lt;/strong&gt; Python for the shatter script, the chat console and the HTTP server  &lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;key-features&quot;&gt;Key features&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A frontier model on a laptop.&lt;/strong&gt; Qwen3-235B (94 MoE layers × 128 experts) on a 32 to 48 GB MacBook, with about 16 GB resident and the ~117 GB vault at zero bytes of RAM.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Intelligence does not degrade, only speed does.&lt;/strong&gt; A 32 GB Mac and a 512 GB Mac produce identical outputs from the same vault. More memory means a larger ring and more tokens per second.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Model-agnostic.&lt;/strong&gt; Any compatible fine-grained MoE becomes a vault with one shatter command. No recompilation.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A model fleet, switchable at runtime.&lt;/strong&gt; Every vault on disk is listed on &lt;code&gt;/v1/models&lt;/code&gt;. Naming another one in the standard &lt;code&gt;model&lt;/code&gt; field switches the engine.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OpenAI and Anthropic compatible.&lt;/strong&gt; One process, one port, both protocols, streaming or not. Open WebUI, LibreChat, the &lt;code&gt;openai&lt;/code&gt; and &lt;code&gt;anthropic&lt;/code&gt; SDKs and Claude Code connect without being modified.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built-in web chat.&lt;/strong&gt; A dependency-free console at &lt;code&gt;GET /&lt;/code&gt; with live turn timings, context and RAM meters, and a model dropdown.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Persistent sessions.&lt;/strong&gt; The KV-cache and the ring survive across turns, so each message prefills only its new tokens. Follow-up turns answer in about 14 s however long the conversation is.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Layer-major batched prefill.&lt;/strong&gt; Each layer's experts are read from the SSD once per prompt chunk, not once per token.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Private and offline.&lt;/strong&gt; No cluster, no API key, nothing leaves the machine.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open source, MIT.&lt;/strong&gt; The code, the documentation and the mistakes are public.  &lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-numbers&quot;&gt;The numbers&lt;/h3&gt;
&lt;p&gt;Measured on a standard 48 GB Apple Silicon MacBook, Q4 vault, 45-token prompt.  &lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;Qwen3-235B-A22B &lt;/th&gt;&lt;th&gt;Qwen3-30B-A3B&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Role &lt;/td&gt;&lt;td&gt;The frontier &lt;/td&gt;&lt;td&gt;The daily driver&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Vault (Q4) &lt;/td&gt;&lt;td&gt;~117 GB, streamed from SSD &lt;/td&gt;&lt;td&gt;~14 GB, almost entirely in the ring&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Decode &lt;/td&gt;&lt;td&gt;1.84 tok/s &lt;/td&gt;&lt;td&gt;~13.7 tok/s&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;For the 235B, since the latency work began:  &lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Metric &lt;/th&gt;&lt;th&gt;Before &lt;/th&gt;&lt;th&gt;Now&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Cold time to first token &lt;/td&gt;&lt;td&gt;92.7 s &lt;/td&gt;&lt;td&gt;~26 s&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Decode speed &lt;/td&gt;&lt;td&gt;0.48 tok/s &lt;/td&gt;&lt;td&gt;1.84 tok/s&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Warm follow-up turn &lt;/td&gt;&lt;td&gt;grew with the conversation &lt;/td&gt;&lt;td&gt;~14 s, flat&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;I will not pretend 1.84 tokens per second is fast. It is a 235B model answering at reading speed on a machine you can close and put in a bag. The 30B is the one for daily use.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;try-it&quot;&gt;Try it&lt;/h3&gt;
&lt;p&gt;You need an Apple Silicon Mac and a fast internal SSD.  &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git clone https://github.com/melasistema/s-moe.gitcd s-moemake setup
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then download a supported checkpoint, shatter it and serve it:  &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;make probe   MODEL=./checkpoints/qwen3-235b-instruct              # dry run, maps the topologymake shatter MODEL=./checkpoints/qwen3-235b-instruct OUT=./vault  # builds the vaultmake all                                                          # builds the engine.venv/bin/python serve.py --port 8000                             # OpenAI + Anthropic + web chat
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Open &lt;code&gt;http://127.0.0.1:8000/&lt;/code&gt; and start typing, or point an existing client at it:  &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;from openai import OpenAI  
client = OpenAI(base_url=&quot;http://127.0.0.1:8000/v1&quot;, api_key=&quot;unused&quot;)  
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;ANTHROPIC_BASE_URL=http://127.0.0.1:8000 ANTHROPIC_API_KEY=unused claude  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The full guide, including the Qwen3-30B path for smaller machines, is in the documentation.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;what-is-next&quot;&gt;What is next&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Q2 vaults.&lt;/strong&gt; Decode is bound by SSD bandwidth. Halving every expert halves the reads and doubles the ring.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The 477B.&lt;/strong&gt; GLM MoE 477B is the next summit. It is not shattered yet.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paged KV-cache&lt;/strong&gt;, so long conversations do not depend on RAM.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Adaptive quantisation&lt;/strong&gt;, keeping popular experts at 4 bits and compressing niche ones to 2.  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;S-MoE is an experiment. It is incomplete, and I would rather show the measurements than oversell it.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;links&quot;&gt;Links&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Website (the model explained as an interactive 3D pyramid): &lt;a rel=&quot;nofollow&quot; href=&quot;https://s-moe.com&quot;&gt;https://s-moe.com&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;Source code: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/melasistema/s-moe&quot;&gt;https://github.com/melasistema/s-moe&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;Documentation: &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.s-moe.com&quot;&gt;https://docs.s-moe.com&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;The manifesto: &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.s-moe.com/v1/democratization/manifesto&quot;&gt;https://docs.s-moe.com/v1/democratization/manifesto&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;Melasistema: &lt;a rel=&quot;nofollow&quot; href=&quot;https://melasistema.com&quot;&gt;https://melasistema.com&lt;/a&gt;  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The build diary&lt;/strong&gt;  &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/21093/rock-paper-silicon-how-a-web-developer-used-a-satellite-hack-and-an-ai-agent-to-ask&quot;&gt;Rock, Paper, Silicon&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/21787/hello-world-a-235-billion-parameter-frontier-model-just-spoke-on-a-48-gb-macbook&quot;&gt;&quot;Hello, World! &quot;&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/22127/the-mountain-learns-to-converse-teaching-a-235b-model-not-to-keep-you-waiting&quot;&gt;The Mountain Learns to Converse&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.linkedin.com/pulse/end-prophecy-how-we-doubled-speed-235b-model-learning-luca-visciola-okfdf/&quot;&gt;The End of Prophecy&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/22524/the-mountain-predicts-itself-we-fired-our-best-idea-and-the-model-got-faster-and-smarter&quot;&gt;The Mountain Predicts Itself&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/22794/the-mountain-runs-i-dont-know-if-were-chasing-something-or-being-chased-but-the-speed-wont&quot;&gt;The Mountain Runs&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/23015/s-moe-started-to-speak-openai-point-any-chat-app-at-your-macbook-and-watch-a-235b-model-think&quot;&gt;S-MoE Started to Speak OpenAI&lt;/a&gt;  &lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/23016/the-mountain-exhales-riding-the-30b-wind-before-the-477b-avalanche&quot;&gt;The Mountain Exhales&lt;/a&gt;  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;The seismic idea is a philosophical translation of the published work of Ing. Filippo Biondi on SAR-based subsurface imaging. The method is his; I only borrowed the intuition.&lt;/em&gt;  &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Speed is a privilege. Intelligence is not.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Launches</category>
<guid isPermaLink="true">https://coderlegion.com/30170/s-moe-seismic-mixture-of-experts-engine</guid>
<pubDate>Wed, 07 Oct 2026 21:38:55 +0000</pubDate>
</item>
<item>
<title>The Mountain Exhales — Riding the 30B Wind Before the 477B Avalanche</title>
<link>https://coderlegion.com/23016/the-mountain-exhales-riding-the-30b-wind-before-the-477b-avalanche</link>
<description>&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;This is the seventh entry in a curious builder's diary. Over six chapters, we carved a door through Silicon Valley's artificial memory wall, coaxing a 235-billion-parameter mountain to speak, remember, run, and finally converse fluently in the OpenAI dialect. As we push past an average of 1.84 tokens per second and touch peaks of 2.01 on a consumer 48 GB MacBook, the engine is humming. But before we pack our gear for the next impossible summit, we are claiming a builder's privilege. After months of writing lock-free C++ to move heavy stone, it is time to take a breath of thin, fresh air.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;1-the-477b-avalanche&quot;&gt;1. The 477B Avalanche&lt;/h3&gt;
&lt;p&gt;S-MoE was built to prove a point: that the memory wall is a software convention, not a law of physics. We took Qwen3-235B — a model that standard runtimes insist requires cloud clusters — and shattered it into pieces that stream perfectly off a MacBook's SSD via Apple Silicon's Unified Memory Architecture. &lt;/p&gt;
&lt;p&gt;Because we broke the diary dependency and invited standard frontends (like Open WebUI) into the architecture in Article 06, we are now ready to tackle an even more colossal peak: the &lt;strong&gt;GLM MoE 477B&lt;/strong&gt; parameter model. &lt;/p&gt;
&lt;p&gt;The climb will be grueling. A 477-billion-parameter model will push consumer hardware to an edge no one thought possible. It will test every byte of our zero-allocation loops, our Direct I/O DMA transfers, and our patience. But we have the map now.&lt;/p&gt;
&lt;p&gt;However, before we shoulder that massive weight, we realized something crucial. S-MoE shouldn't just be an engine for the 235B. It should be an engine for &lt;em&gt;any&lt;/em&gt; fine-grained MoE.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;2-the-self-describing-vault-sarc-&quot;&gt;2. The Self-Describing Vault (SARC)&lt;/h3&gt;
&lt;p&gt;Until now, the engine was heavily hardcoded for Qwen3's specific math. If we were going to run different models — the daily driver 30B, the massive 235B, or the upcoming 477B — we couldn't keep recompiling C++ to change the RoPE theta or the routing Top-K. &lt;/p&gt;
&lt;p&gt;We needed the engine to be &lt;strong&gt;model-agnostic&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The solution was elegantly simple: the &lt;strong&gt;Smoe ARChitecture (SARC) block&lt;/strong&gt;. During the offline &lt;code&gt;shatter&lt;/code&gt; process, the Python script now reads the model's Hugging Face &lt;code&gt;config.json&lt;/code&gt; and extracts the mathematical DNA — RoPE theta, MoE Top-K, GQA head geometry, and normalization flags. It serializes these into a tiny, 128-byte binary block and stamps it directly into the &lt;code&gt;.smoe&lt;/code&gt; vault's header.&lt;/p&gt;
&lt;p&gt;Now, when you boot S-MoE, there are no config files or CLI flags to set. The engine simply reads the 128 bytes, understands the topology of the mind it was just handed, and configures its own internal Scout and Metal shaders accordingly.&lt;/p&gt;
&lt;p&gt;We suddenly had a &quot;fleet.&quot; You can have a directory full of different vaults, and simply switching the model in your Chat UI dropdown seamlessly swaps the models at runtime.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;3-the-30b-wind&quot;&gt;3. The 30B Wind&lt;/h3&gt;
&lt;p&gt;What happens when you take an engine hardened by the brutal math of a 235B model, and plug a 30B model into it? &lt;/p&gt;
&lt;p&gt;We shattered the &lt;code&gt;Qwen3-30B-A3B&lt;/code&gt; checkpoint to find out. We wanted to experience pure, frictionless velocity. We wanted to ride the wind.&lt;/p&gt;
&lt;p&gt;But when we first spun it up, the numbers were confusingly low. We were seeing about &lt;strong&gt;~5 to 7 tokens per second&lt;/strong&gt;. Fast, but not &quot;frictionless velocity&quot; fast. We expected the 30B to scream on a 48 GB machine.&lt;/p&gt;
&lt;p&gt;The culprit? A single hardcoded flag from our testing days: &lt;code&gt;--ring 1024&lt;/code&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;4-the-magic-of-auto-sizing&quot;&gt;4. The Magic of Auto-Sizing&lt;/h3&gt;
&lt;p&gt;The Streamer's ring buffer is the heart of S-MoE's speed. It's a pre-allocated LRU cache in RAM. When a token needs an expert, the engine checks the ring first. If it's there (a cache hit), we skip the SSD entirely. &lt;/p&gt;
&lt;p&gt;By hardcoding &lt;code&gt;--ring 1024&lt;/code&gt;, we were forcing the ring to only hold 1,024 experts (about ~2.5 GB of cache for the 30B). &lt;/p&gt;
&lt;p&gt;But S-MoE has a brilliant auto-sizing mechanism (&lt;code&gt;--ring 0&lt;/code&gt;). When allowed to auto-size, the engine dynamically checks the OS for available RAM, subtracts a safe overhead, and gives the rest to the ring. On a 48 GB MacBook, the auto-tuner allocates roughly &lt;strong&gt;~15 GB of ring capacity&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The entire 30B vault is only &lt;strong&gt;~14 GB&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The moment we removed &lt;code&gt;--ring 1024&lt;/code&gt; and let the engine auto-size, the ring simply swallowed the entire model. After the first few turns, the SSD reads dropped to virtually zero. The engine ascended from a streaming pipeline into an pure, in-memory execution loop. &lt;/p&gt;
&lt;p&gt;The numbers instantly skyrocketed.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;5-the-true-benchmarks&quot;&gt;5. The True Benchmarks&lt;/h3&gt;
&lt;p&gt;With the auto-tuner unleashed and the engine running isolated, the true benchmarks emerged.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Daily Driver: Qwen3-30B&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cold Time-To-First-Token:&lt;/strong&gt; ~5.85 seconds&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Decode Speed:&lt;/strong&gt; &lt;strong&gt;13.71 tokens / second&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The Feeling:&lt;/em&gt; Instantaneous. Pure velocity. The entire mind rests comfortably in RAM, producing outputs faster than you can read them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The Frontier: Qwen3-235B&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cold Time-To-First-Token:&lt;/strong&gt; ~26.16 seconds&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Decode Speed:&lt;/strong&gt; &lt;strong&gt;1.84 tokens / second&lt;/strong&gt; (peaking over 2.01 on warm turns)&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The Feeling:&lt;/em&gt; Cinematic deliberation. The SSD streams experts at ~150+ GB/s, and the mountain answers thoughtfully.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;6-the-plateau-before-the-climb&quot;&gt;6. The Plateau Before the Climb&lt;/h3&gt;
&lt;p&gt;We built S-MoE to prove that the 235B frontier could live on a desk. But in making the architecture truly agnostic, we accidentally built the fastest possible way to run the 30B models, too. The same lock-free memory gymnastics that make the heavy models possible make the lighter models absolutely fly.&lt;/p&gt;
&lt;p&gt;Because sometimes, before you carry the next mountain, you just need to feel how fast you can sprint across the plateau.&lt;/p&gt;
&lt;p&gt;The engine is ready. The architecture is model-agnostic. The UI is clean. &lt;/p&gt;
&lt;p&gt;Next stop: 477 Billion parameters.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;S-MoE is open source under the MIT License. The code, the philosophy, and the mistakes are all public: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/melasistema/s-moe&quot;&gt;github.com/melasistema/s-moe&lt;/a&gt;.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Built by Luca Visciola and an AI agent who hopefully knows C++ and low level programming, because I do not 😅.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/23016/the-mountain-exhales-riding-the-30b-wind-before-the-477b-avalanche</guid>
<pubDate>Tue, 21 Jul 2026 09:00:00 +0000</pubDate>
</item>
<item>
<title>The Paper Sketch: Budgeting 48GB of UMA</title>
<link>https://coderlegion.com/23019/the-paper-sketch-budgeting-48gb-of-uma</link>
<description>&lt;p&gt;Let's look at the physical footprints at a 4-bit (Q4) quantization. A 744B parameter model sits at roughly 370 GB cold on the NVMe drive. Because it’s a sparse Mixture of Experts, the dense backbone—the attention mechanisms and shared weights that every single token must touch—is surprisingly light: about 17B parameters, or roughly 9.9 GB.&lt;/p&gt;
&lt;p&gt;If we draw up the memory allocation inside our 48GB pool, the board looks like this:&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;48 GB (Total) - 9.9 GB (Dense Backbone) - 4 GB (OS &amp;amp; Apps) - 2 GB (KV Cache) ≈ &lt;strong&gt;32 GB Remaining&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;That leaves us a 32GB sandbox to allocate entirely to the lock-free expert ring buffer.&lt;/p&gt;
&lt;p&gt;When this model executes, it activates roughly 40B parameters per token. At Q4 precision, that requires pulling &lt;strong&gt;~11 GB of active experts&lt;/strong&gt; into memory per step. Because our ring buffer is 32GB, it has enough structural breathing room to hold 2 to 3 slots of speculatively loaded future tokens simultaneously. The memory geometry fits.&lt;/p&gt;
&lt;h2 id=&quot;calculating-the-bandwidth-reality&quot;&gt;Calculating the Bandwidth Reality&lt;/h2&gt;
&lt;p&gt;Now we look at the unyielding bottleneck: the internal Apple Silicon SSD bus, which reliably pushes a sustained read bandwidth of about 6.5 GB/s.&lt;/p&gt;
&lt;p&gt;If the engine had to blindly pull a completely fresh set of 11 GB of experts for every single token, the raw physical limit is basic arithmetic:&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Raw I/O Time Per Token = 11 GB / 6.5 GB/s ≈ 1.69 seconds ⇒ &lt;strong&gt;0.59 tokens/second&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;But we know neural routing isn't completely chaotic. Tokens traveling through a sentence exhibit temporal expert locality—the token handling a specific technical context will likely trigger some of the exact same experts used by the token right before it.&lt;/p&gt;
&lt;p&gt;If the speculative lookahead successfully exploits this, allowing us to reuse just 20% of the active experts already sitting warm in the ring buffer, the actual disk read demand drops from 11 GB down to ~8.8 GB:&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Optimized I/O Time = 8.8 GB / 6.5 GB/s ≈ 1.35 seconds ⇒ &lt;strong&gt;0.74 tokens/second&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This lands us squarely in that &lt;strong&gt;0.6 to 0.8 tokens per second&lt;/strong&gt; window.&lt;/p&gt;
&lt;h2 id=&quot;perspectives-on-speed&quot;&gt;Perspectives on Speed&lt;/h2&gt;
&lt;p&gt;Not that we are calling this fast by modern server standards, but it completely rewrites the expectations for what a local machine can do. It’s all about perspective.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;We used to wait hours just to download a single movie; &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Waiting 30 or 40 seconds for a frontier-class AI to generate a deeply reasoned paragraph locally on a laptop isn't a penalty—it's a miracle.&lt;/p&gt;
&lt;p&gt;Will it hold up when the code actually executes? The ultimate variable is the &quot;Scout Fan-Out.&quot; With hundreds of potential experts per layer, the speculative engine's branch prediction has to be incredibly precise. If it misguesses too often, the pipeline will stall, waiting for synchronous disk reads.&lt;/p&gt;
&lt;p&gt;But looking at the numbers on the board right now, the physics check out. We aren't just daydreaming—this approach stands a very real chance of turning an impossible 744B paperweight into a highly capable, private asynchronous workhorse.&lt;/p&gt;
</description>
<category>Discussions</category>
<guid isPermaLink="true">https://coderlegion.com/23019/the-paper-sketch-budgeting-48gb-of-uma</guid>
<pubDate>Sun, 19 Jul 2026 14:07:16 +0000</pubDate>
</item>
<item>
<title>The Mountain Runs — I Don't Know If We're Chasing Something or Being Chased, but the Speed Won't...</title>
<link>https://coderlegion.com/22794/the-mountain-runs-i-dont-know-if-were-chasing-something-or-being-chased-but-the-speed-wont</link>
<description>&lt;p&gt;&lt;strong&gt;The Mountain Runs — I Don't Know If We're Chasing Something or Being Chased, but the Speed Won't Stop Climbing&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;This is the fifth entry in a curious builder's diary. In the &lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/21093/rock-paper-silicon-how-a-web-developer-used-a-satellite-hack-and-an-ai-agent-to-ask&quot;&gt;first&lt;/a&gt;, a self-taught web developer borrowed a satellite engineer's intuition and asked whether frontier AI could run on the MacBook on his desk. In the &lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/21787/hello-world-a-235-billion-parameter-frontier-model-just-spoke-on-a-48-gb-macbook&quot;&gt;second&lt;/a&gt;, a 235-billion-parameter model said &quot;Hello, world!&quot; through a door we cut in the memory wall. In the &lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/22127/the-mountain-learns-to-converse-teaching-a-235b-model-not-to-keep-you-waiting&quot;&gt;third&lt;/a&gt;, it learned to converse without making you wait minutes between turns.  In the &lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/22524/the-mountain-predicts-itself-we-fired-our-best-idea-and-the-model-got-faster-and-smarter&quot;&gt;fourth&lt;/a&gt;, we fired our own founding metaphor and the model got faster&lt;em&gt; and &lt;/em&gt;smarter. That article ended at the wall of physics: a saturated SSD, nothing left to delete. This one is about what happened next, which is that the speed kept climbing anyway — and for one terrifying evening, it looked like it had collapsed by 85% instead.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;1-the-moment&quot;&gt;1. The Moment&lt;/h3&gt;
&lt;p&gt;A microbenchmark, late at night. Same MacBook. Same GPU. Same weights, same mathematics, same number of bytes read. Two kernels that compute the &lt;em&gt;identical&lt;/em&gt; matrix-vector product:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;K/V projection (512 × 4096, bf16)  
  
old kernel:   12.3 GB/s new kernel:  285.3 GB/s        (23×)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Twenty-three times faster. Nothing was added — no new hardware, no new math, no quantisation trick. We changed &lt;em&gt;the shape of the question&lt;/em&gt; the GPU asks its own memory, and the same silicon that had been trudging along at 12 GB/s broke into a sprint.&lt;/p&gt;
&lt;p&gt;Last article ended with me declaring, confidently, that we had hit the wall of physics — that the SSD was saturated and there was no more bloated software between us and the flash memory. That was true, and it remains true. What I had not understood is that the SSD was only &lt;em&gt;one&lt;/em&gt; of the walls, and behind it the GPU had been quietly doing the memory-system equivalent of taking a taxi one block at a time.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;2-the-numbers-plainly&quot;&gt;2. The Numbers, Plainly&lt;/h3&gt;
&lt;p&gt;Same hardware, same 117 GB vault cold on the SSD, same canonical prompt discipline as every previous entry. Only the engine changed.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Thing &lt;/th&gt;&lt;th&gt;Last article &lt;/th&gt;&lt;th&gt;Now&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Generation speed &lt;/td&gt;&lt;td&gt;1.13 tokens/s &lt;/td&gt;&lt;td&gt;&lt;strong&gt;1.43 tokens/s&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;…since first light &lt;/td&gt;&lt;td&gt;0.48 tokens/s &lt;/td&gt;&lt;td&gt;&lt;strong&gt;3× total&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;One generated token costs &lt;/td&gt;&lt;td&gt;~885 ms &lt;/td&gt;&lt;td&gt;&lt;strong&gt;~700 ms&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;First token, cold 45-token prompt &lt;/td&gt;&lt;td&gt;~32 s &lt;/td&gt;&lt;td&gt;&lt;strong&gt;~29.4 s&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPU dense projections &lt;/td&gt;&lt;td&gt;12–136 GB/s &lt;/td&gt;&lt;td&gt;&lt;strong&gt;207–285 GB/s&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPU syncs during prefill &lt;/td&gt;&lt;td&gt;2 per &lt;em&gt;token&lt;/em&gt; &lt;/td&gt;&lt;td&gt;&lt;strong&gt;2 per &lt;em&gt;layer&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Output token IDs &lt;/td&gt;&lt;td&gt;— &lt;/td&gt;&lt;td&gt;&lt;strong&gt;bit-identical, before and after&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;New hardware required &lt;/td&gt;&lt;td&gt;none &lt;/td&gt;&lt;td&gt;&lt;strong&gt;none&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;And one number that isn't in the table, because it deserves its own section: for a few hours in the middle of this campaign, the official benchmark read &lt;strong&gt;0.20 tokens/second&lt;/strong&gt; — six times &lt;em&gt;slower&lt;/em&gt; than where we started the evening. That story is below, and it is the most web-developer-shaped lesson of the entire diary.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;3-the-gpu-was-running-n-1-queries&quot;&gt;3. The GPU Was Running N+1 Queries&lt;/h3&gt;
&lt;p&gt;Every web developer knows the N+1 query bug. You ask the database for a list of users, then loop over them asking for each one's profile — a thousand tiny round-trips where one JOIN would do. The database isn't slow. Your &lt;em&gt;access pattern&lt;/em&gt; is rude.&lt;/p&gt;
&lt;p&gt;It turns out a GPU's memory system has exactly the same personality.&lt;/p&gt;
&lt;p&gt;The old kernels assigned &lt;strong&gt;one thread per output row&lt;/strong&gt; of the weight matrix. Sounds reasonable — it's the obvious loop, the one you'd write first. But 32 neighbouring GPU threads execute in lockstep, and under that layout their simultaneous memory requests land at addresses &lt;strong&gt;two kilobytes apart&lt;/strong&gt;. The memory system, which serves wide consecutive bursts beautifully, has to satisfy 32 scattered pleas one crumb at a time. A thousand tiny round-trips. N+1 queries against your own RAM.&lt;/p&gt;
&lt;p&gt;The new kernels invert it: &lt;strong&gt;one &lt;em&gt;simdgroup&lt;/em&gt; — 32 threads — owns one output row together&lt;/strong&gt;, and its lanes read &lt;em&gt;consecutive&lt;/em&gt; 16-byte chunks. Same bytes, same total work, but now every request is one coalesced 512-byte burst. The JOIN.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The quantised &lt;strong&gt;expert FFN kernels&lt;/strong&gt; — the ones that dequantise 2/4-bit codes in register space, the heart of the whole engine — jumped &lt;strong&gt;7×&lt;/strong&gt;, to 158 GB/s effective.&lt;/li&gt;
&lt;li&gt;The dense &lt;strong&gt;Q/K/V/O projections&lt;/strong&gt; and the LM head jumped to &lt;strong&gt;207–285 GB/s&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The comedy prize goes to the K/V projection: its matrix is only 512 rows tall, and the old dispatch geometry handed the entire job to &lt;strong&gt;2 threadgroups&lt;/strong&gt; — on a GPU built to run &lt;em&gt;thousands&lt;/em&gt;. We had booked a stadium and seated two people. That's the 23×.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The pattern of this diary holds for a fifth consecutive entry: the exotic layer was innocent. The dequantisation math was right, the Metal code was correct, every byte arrived. What was broken was the &lt;em&gt;shape of the request&lt;/em&gt; — the most database-shaped bug imaginable, living in the middle of a GPU shader.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;4-the-prompt-stopped-playing-ping-pong&quot;&gt;4. The Prompt Stopped Playing Ping-Pong&lt;/h3&gt;
&lt;p&gt;The second front was the prefill — the silence before the first word, which article three cut from 93 seconds to 32.&lt;/p&gt;
&lt;p&gt;Reading the prompt, the engine was still submitting GPU work &lt;em&gt;per token&lt;/em&gt;: every one of the 45 prompt tokens made its own little QKV round-trip and its own little o_proj round-trip, each ending with the CPU standing at the door waiting for the GPU to ring the bell. Roughly &lt;strong&gt;8,460 command buffers&lt;/strong&gt; for one prompt. Now each layer submits &lt;strong&gt;all tokens' QKV projections in one command buffer, and all their output projections in another&lt;/strong&gt; — 188 submissions total, two per layer. The GPU finally gets asked the whole question at once.&lt;/p&gt;
&lt;p&gt;And one more theft from the I/O timeline: during routing, the moment the &lt;em&gt;first&lt;/em&gt; token votes for an expert, that expert &lt;strong&gt;fires at the SSD immediately&lt;/strong&gt; — while the remaining tokens are still deciding. The reads were always going to happen; now they start milliseconds earlier, hidden under compute. After last article's lesson about speculation, I want to be precise about why this one is legal: replaying &lt;em&gt;yesterday's&lt;/em&gt; routing as a guess measured 37% slower and stays banned. This is different — it is &lt;em&gt;certain demand, pulled forward&lt;/em&gt;. Never bet. Just start walking earlier.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;5-the-evening-the-benchmark-lied&quot;&gt;5. The Evening the Benchmark Lied&lt;/h3&gt;
&lt;p&gt;Here is the danger in the title.&lt;/p&gt;
&lt;p&gt;We land the new coalesced kernel — the one the microbenchmark just crowned at 285 GB/s — into the real engine, run the canonical benchmark, and:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;decode: 0.20 tokens/s 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Not a typo. One-sixth of the previous speed. The kind of number that, at 11 PM, makes you believe you've corrupted something fundamental — a memory fence, an alignment, the laws of thermodynamics.&lt;/p&gt;
&lt;p&gt;Old me would have started reverting commits. Instead, the instrument panel — still the only law of this project — got the first word. And the instrument said something astonishing: the &lt;strong&gt;dense math bucket had gotten &lt;em&gt;faster&lt;/em&gt;&lt;/strong&gt;, exactly as the microbench promised. The regression was entirely inside io-spin: the SSD, which reliably delivers 6.3 GB/s, was crawling at 4.4.&lt;/p&gt;
&lt;p&gt;The kernel was innocent. The &lt;em&gt;machine&lt;/em&gt; was tired. Running benchmark after benchmark back-to-back, each launch mapping a 16 GB Scout and churning gigabytes of Direct I/O, had driven macOS's memory pressure into the ground — and the OS quietly throttles you when you do that. The benchmark wasn't measuring my code. It was measuring my impatience.&lt;/p&gt;
&lt;p&gt;One quiet run later: &lt;strong&gt;1.43 tokens/second&lt;/strong&gt;. The rule is now written into the project's law books: &lt;em&gt;one launch per comparison, on a rested machine&lt;/em&gt; — the systems-programming equivalent of &quot;never trust a load test you ran against staging while the nightly backup was running.&quot; My decade of being lied to by test environments finally paid rent in C++.&lt;/p&gt;
&lt;p&gt;And in the spirit of publishing everything: the numbers in this article were measured on a machine whose memory was half-eaten by my own IDE, because a web developer's laptop is never actually quiet. The reference conditions may be slightly kinder. I'd rather publish the conservative number than wait for a silence that never comes.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;6-the-wall-revisited&quot;&gt;6. The Wall, Revisited&lt;/h3&gt;
&lt;p&gt;So where does a generated token's ~700 ms actually go now?&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Where &lt;/th&gt;&lt;th&gt;ms &lt;/th&gt;&lt;th&gt;What it is&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;SSD spin &lt;/td&gt;&lt;td&gt;~490 &lt;/td&gt;&lt;td&gt;demand misses at the NVMe's saturated bandwidth — &lt;strong&gt;pure physics&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Dense math &lt;/td&gt;&lt;td&gt;~155 &lt;/td&gt;&lt;td&gt;weight bandwidth through the new coalesced kernels&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPU wait &lt;/td&gt;&lt;td&gt;~46 &lt;/td&gt;&lt;td&gt;expert kernels finishing on late-arriving misses&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;LM head &lt;/td&gt;&lt;td&gt;~8 &lt;/td&gt;&lt;td&gt;one vocabulary-sized matvec&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Seventy percent of every token is now the raw, honest cost of flash memory delivering bytes at its rated speed. Last article's cliffhanger hasn't moved, it has &lt;em&gt;sharpened&lt;/em&gt;: you cannot make a saturated bus faster, but you can send half the bytes. The 2-bit vault remains the next mountain — it halves the SSD bill, doubles the ring, and finally arms the speculative machinery that has been sitting in the code, patient and default-off, for two articles now. The remaining sliver of dense time has its own successor waiting: the last per-layer CPU round-trip, where the residual and norms still come home between command buffers.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;7-what-this-entry-is-actually-about&quot;&gt;7. What This Entry Is Actually About&lt;/h3&gt;
&lt;p&gt;The title is a genuine confession. When the speed keeps climbing &lt;em&gt;after&lt;/em&gt; you've declared the wall of physics, you start to wonder which direction you're running. Are we chasing some optimal engine that's always one commit ahead? Or fleeing something — the 0.20 t/s ghost, the next benchmark that lies?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Four campaigns in, I finally looked over my shoulder. This is what I found.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And the answer is: neither. Nothing is chasing us. What's behind us is just everything we deleted — the wiped caches, the fired prophet, the write-only memory, and now the scattered reads and the 8,460 tiny GPU round-trips. The engine isn't accelerating toward or away from anything. It's &lt;em&gt;shedding&lt;/em&gt;. Every entry of this diary, the mountain weighs less than the diary said it did.&lt;/p&gt;
&lt;p&gt;The authorship remains the experiment inside the experiment: the AI agent wrote the simdgroup kernels, the barrier-free dispatch paths, and the microbenchmarks that isolated silicon truth from environmental noise. I brought the questions — &lt;em&gt;why is the GPU only using two threadgroups? why did the benchmark collapse when the kernel got faster?&lt;/em&gt; — and the N+1 instincts of someone whose databases have been punishing rude access patterns for years.&lt;/p&gt;
&lt;p&gt;The mountain vibrated. Then it talked, then it remembered, then it predicted itself.&lt;/p&gt;
&lt;p&gt;Now it runs. And honestly — I've stopped trying to guess what from.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;S-MoE is open source under the MIT License. The code, the philosophy, and the mistakes are all public: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/melasistema/s-moe&quot;&gt;github.com/melasistema/s-moe&lt;/a&gt;.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Built by Luca Visciola and an AI agent who hopefully knows C++ and low level programming, because I do not 😅.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Acknowledgements: The seismic tomography concept remains a philosophical translation of the &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.mdpi.com/2072-4292/14/20/5231&quot;&gt;published work&lt;/a&gt; of Ing. Filippo Biondi on SAR-based subsurface imaging. He taught this project to listen to a surface for news of the interior; it turns out the same lesson applies to a benchmark on a tired machine.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/22794/the-mountain-runs-i-dont-know-if-were-chasing-something-or-being-chased-but-the-speed-wont</guid>
<pubDate>Thu, 16 Jul 2026 07:31:21 +0000</pubDate>
</item>
<item>
<title>The Mountain Predicts Itself — We Fired Our Best Idea, and the Model Got Faster and Smarter</title>
<link>https://coderlegion.com/22524/the-mountain-predicts-itself-we-fired-our-best-idea-and-the-model-got-faster-and-smarter</link>
<description>&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;This is the fourth entry in a curious builder's diary. In the &lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/21093/rock-paper-silicon-how-a-web-developer-used-a-satellite-hack-and-an-ai-agent-to-ask&quot;&gt;first&lt;/a&gt;, a self-taught web developer borrowed a satellite engineer's intuition and asked whether frontier AI could run on the MacBook on his desk. &lt;br&gt;
In the &lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/21787/hello-world-a-235-billion-parameter-frontier-model-just-spoke-on-a-48-gb-macbook&quot;&gt;second&lt;/a&gt;, a 235-billion-parameter model said &quot;Hello, world!&quot; through a door we cut in the memory wall. &lt;br&gt;
In the &lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/22127/the-mountain-learns-to-converse-teaching-a-235b-model-not-to-keep-you-waiting&quot;&gt;third&lt;/a&gt;, it learned to converse without making you wait minutes between turns. &lt;br&gt;
This one is about the words themselves — and about the day we measured our founding idea against a blank wall, and the blank wall won.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;1-the-moment-1&quot;&gt;1. The Moment&lt;/h3&gt;
&lt;p&gt;Third turn of a conversation. Same MacBook, same 48 GB, same 117 GB expert vault cold on the SSD:&lt;/p&gt;
&lt;p&gt;A complete, correctly-constructed joke — setup, pause, anatomical pun — from a 235-billion-parameter model streaming its brain off a consumer SSD, three turns deep into a conversation, arriving at a bit over one word per second. That's roughly fifty words per minute. The mountain now speaks at the pace of a human typing.&lt;/p&gt;
&lt;p&gt;But the speed is only half of this entry. The other half is &lt;em&gt;why&lt;/em&gt; the joke got better — because the same change that made the engine faster also made it, for the first time, run the &lt;strong&gt;exact&lt;/strong&gt; mathematics its creators trained. And that change was a deletion.&lt;/p&gt;
&lt;h3 id=&quot;2-the-numbers-plainly-1&quot;&gt;2. The Numbers, Plainly&lt;/h3&gt;
&lt;p&gt;Same hardware, same vault, same prompt discipline as every previous entry. Only the engine changed.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Thing &lt;/th&gt;&lt;th&gt;Last article &lt;/th&gt;&lt;th&gt;Now&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Generation speed &lt;/td&gt;&lt;td&gt;0.70 tokens/s &lt;/td&gt;&lt;td&gt;&lt;strong&gt;1.13 tokens/s&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;…since first light &lt;/td&gt;&lt;td&gt;0.48 tokens/s &lt;/td&gt;&lt;td&gt;&lt;strong&gt;2.4× total&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;One generated token costs &lt;/td&gt;&lt;td&gt;~1,430 ms &lt;/td&gt;&lt;td&gt;&lt;strong&gt;~885 ms&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;SSD reads per generated token &lt;/td&gt;&lt;td&gt;~7.5 GB &lt;/td&gt;&lt;td&gt;&lt;strong&gt;~3 GB&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Expert routing &lt;/td&gt;&lt;td&gt;predicted, 51.5% right &lt;/td&gt;&lt;td&gt;&lt;strong&gt;exact — the true Qwen3 routing, every layer, every token&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;New hardware required &lt;/td&gt;&lt;td&gt;none &lt;/td&gt;&lt;td&gt;&lt;strong&gt;none&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;And one number that doesn't fit in a table: the speed graph of this campaign &lt;strong&gt;was not monotone&lt;/strong&gt;. It went up, then deliberately &lt;em&gt;down&lt;/em&gt;, then honestly back up. That dip is the story.&lt;/p&gt;
&lt;h3 id=&quot;3-the-instrument-panel-the-web-developer-s-ultimate-weapon&quot;&gt;3. The Instrument Panel: The Web Developer's Ultimate Weapon&lt;/h3&gt;
&lt;p&gt;In my previous articles, I noted how my web developer instincts managed to outmaneuver deep low-level code bugs. In Article 02, it was discovering a config mismatch with the chat template. In Article 03, it was hunting down stale caches, the most web-shaped bug imaginable.&lt;/p&gt;
&lt;p&gt;For this phase, I relied on another classic web developer crutch: &lt;strong&gt;raw telemetry over systems theory&lt;/strong&gt;. Everything in this entry came from one new flag: &lt;code&gt;--instrument&lt;/code&gt;, which bucketed every millisecond of every generated token. It measured time spent in dense math, time spinning on the SSD, and one statistic nobody had ever actually measured: &lt;em&gt;how often do adjacent tokens want the same experts?&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The answer: &lt;strong&gt;46.4%&lt;/strong&gt;. Nearly half of what each token needs, the previous token already fetched.&lt;/p&gt;
&lt;h3 id=&quot;4-the-power-of-deletion-addition-by-subtraction-&quot;&gt;4. The Power of Deletion (Addition by Subtraction)&lt;/h3&gt;
&lt;p&gt;That 46.4% number illuminated a harsh truth: our biggest performance gains weren't going to come from building new features. They were going to come from ruthless deletions.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deleting the Wipe:&lt;/strong&gt; We found a twin bug to the one from our last article. The generation loop was wiping the ring on every single token, re-reading 7.5 GB from the SSD against a 46% reuse opportunity. Deleting this wipe cut decode I/O by two-thirds, making the output bit-identical.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deleting the Corpse:&lt;/strong&gt; We discovered our engine was maintaining about 950 lines of ceremony around a &lt;strong&gt;1.6-gigabyte key-value cache that was written to on every token and read by absolutely nothing&lt;/strong&gt;. It was write-only memory. We deleted it and gave that 1.6 GB straight back to the expert ring.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deleting the Ping-Pong:&lt;/strong&gt; The profiler revealed the CPU and GPU were playing ping-pong 188 times per token (synchronous round-trips for projections, norms, and attention). We rewrote the attention block into &lt;strong&gt;one Metal command buffer per layer&lt;/strong&gt;, bringing the engine down to 94 synchronizations and removing the attention math from the CPU entirely.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;5-killing-the-darlings-retiring-the-phonon-metaphor&quot;&gt;5. Killing the Darlings: Retiring the Phonon Metaphor&lt;/h3&gt;
&lt;p&gt;S-MoE was born from Ing. Filippo Biondi's beautiful SAR acoustic imaging metaphor: the Surface Scout, a resident seismic sensor listening to the conversation and &lt;em&gt;predicting&lt;/em&gt; which experts the mountain would need next. It was the first article. It was my favorite part of the whole design.&lt;/p&gt;
&lt;p&gt;But the reality of language models is that true intelligence requires exact math, not approximation. The instrument panel proved our expensive speculative prophet was costing &lt;strong&gt;~265 ms per token&lt;/strong&gt; and was only right &lt;strong&gt;51.5%&lt;/strong&gt; of the time. The passive ring buffer—which costs zero compute—covers &lt;strong&gt;46.4%&lt;/strong&gt; for free. The prophet, wrong as he was, queued ahead of the demand reads that had to happen anyway, actively delaying the truth.&lt;/p&gt;
&lt;p&gt;So, we fired the prophet. We switched generation to compute routing &lt;strong&gt;exactly&lt;/strong&gt;, from the true hidden state, with one tiny matrix multiply per layer.&lt;/p&gt;
&lt;p&gt;Trading throughput for truth initially caused a dip in our speed, but the multi-turn output visibly improved. The irony is beautiful: by sacrificing speed to get the exact true Qwen3 routing mixing weights, we eventually unlocked the architectural simplicity needed to make it faster.&lt;/p&gt;
&lt;h3 id=&quot;6-the-experiments-that-failed-published-anyway&quot;&gt;6. The Experiments That Failed, Published Anyway&lt;/h3&gt;
&lt;p&gt;This diary's standing promise. Two more for the pile:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Speculation is real, and it still lost.&lt;/strong&gt; Ranks 9–16 genuinely cover &lt;strong&gt;63.7%&lt;/strong&gt; of the &lt;em&gt;next&lt;/em&gt; token's experts. We built a low-priority prefetch queue for it, but at 4-bit, it was &lt;strong&gt;net-negative&lt;/strong&gt;—speculative reads simply bid against demand reads on a saturated bus. It sits in the code, default-off, waiting for the 2-bit vault.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;We grouped the GPU dispatches, and it changed nothing.&lt;/strong&gt; Theory said batching each layer's expert kernels would hide wait times. Measurement said the command-buffer overhead was ~5 ms all along. The hypothesis is dead.&lt;/p&gt;
&lt;h3 id=&quot;7-hitting-the-wall-of-physics&quot;&gt;7. Hitting the Wall of Physics&lt;/h3&gt;
&lt;p&gt;Here is where the campaign shifts. Of the ~885 ms each token now costs, about &lt;strong&gt;490 ms is the engine spinning on the SSD&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Three gigabytes of misses per token divided by 490 ms is &lt;strong&gt;6.3 GB/s: the NVMe's actual delivered bandwidth, saturated&lt;/strong&gt;. There is no more bloated software left between us and the flash memory. There are no dead caches or unnecessary speculative math. For the first time, the biggest cost is simply the raw physics of the hardware doing exactly what it says on the box.&lt;/p&gt;
&lt;p&gt;This sets up a beautiful, concrete cliffhanger: &lt;strong&gt;you cannot make a saturated physical bus faster, but you can send half the bytes&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The upcoming &lt;strong&gt;2-bit vault&lt;/strong&gt; will halve every expert blob, halve the SSD bill, double the ring's capacity, and finally arm our speculative queue.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;8-what-this-entry-is-actually-about&quot;&gt;8. What This Entry Is Actually About&lt;/h3&gt;
&lt;p&gt;The pattern, four articles in, is impossible to miss: the exotic layers keep being innocent. What keeps falling is &lt;em&gt;belief&lt;/em&gt;: caches that don't cache, insurance nobody claims, prophets who lose to blank walls. The instrument panel is the only law we've kept, and it has now voted against our own founding metaphor.&lt;/p&gt;
&lt;p&gt;And the authorship remains the experiment inside the experiment: the AI agent wrote the NEON intrinsics, the Metal kernels, and the instrumentation. I brought the questions — &lt;em&gt;what is it actually doing in there? who reads this cache? is the prophet even right?&lt;/em&gt; — and the willingness to bury the answer's body in public.&lt;/p&gt;
&lt;p&gt;The mountain speaks at typing speed now. It no longer needs anyone to predict it.&lt;/p&gt;
&lt;p&gt;It predicts itself.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;S-MoE is open source under the MIT License. The code, the philosophy, and the mistakes are all public: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/melasistema/s-moe&quot;&gt;github.com/melasistema/s-moe&lt;/a&gt;. Built by Luca Visciola and an AI agent who hopefully knows C++ and low level programming, because I do not 😅.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Acknowledgements: The seismic tomography concept remains a philosophical translation of the &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.mdpi.com/2072-4292/14/20/5231&quot;&gt;published work&lt;/a&gt; of Ing. Filippo Biondi on SAR-based subsurface imaging. The Scout retires with honor — the listening was never wrong; the mountain simply turned out to be its own best seismograph.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/22524/the-mountain-predicts-itself-we-fired-our-best-idea-and-the-model-got-faster-and-smarter</guid>
<pubDate>Mon, 13 Jul 2026 18:44:44 +0000</pubDate>
</item>
<item>
<title>&quot;Hello, World!&quot; — A 235-Billion-Parameter Frontier Model Just Spoke on a 48 GB MacBook</title>
<link>https://coderlegion.com/21787/hello-world-a-235-billion-parameter-frontier-model-just-spoke-on-a-48-gb-macbook</link>
<description>&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;This is the second entry in a curious builder's diary. In &lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/21093/rock-paper-silicon-how-a-web-developer-used-a-satellite-hack-and-an-ai-agent-to-ask&quot;&gt;the first one&lt;/a&gt;, a self-taught web developer borrowed a satellite engineer's intuition, teamed up with an AI agent that writes the C++ he cannot, and asked a ridiculous question: can you run frontier AI on the MacBook on your desk? That article ended with a 470 GB download in progress. This one ends differently.&lt;/em&gt;  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;1-the-moment-2&quot;&gt;1. The Moment&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;You: Say hello.  
  
S-MoE [RAM: 48.0GB | Ring: auto]: Hello, world!  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That's it. That's the whole story, really.  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Qwen3-235B-A22B-Instruct-2507&lt;/strong&gt; — a genuinely frontier Mixture of Experts model, 235 billion parameters, the kind of thing that is supposed to live behind an API key and a $250,000 GPU cluster — answered a question on a consumer MacBook. Not a distilled version. Not a 7B &quot;assistant&quot; wearing a big model's name. The actual 235B model, streaming its experts off the SSD, token by token, through a C++ engine and Metal kernels that a web developer and an AI agent built together.  &lt;/p&gt;
&lt;p&gt;It is slow. It is imperfect. It is also, as far as I can tell, something nobody else has quite done this way. And I think the most honest thing I can do is tell you exactly what it took — because the last bug standing between us and &quot;Hello, world!&quot; was not in the GPU kernels at all. It was the kind of bug a &lt;em&gt;web developer&lt;/em&gt; knows in his bones.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;2-the-numbers-plainly-2&quot;&gt;2. The Numbers, Plainly&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Thing &lt;/th&gt;&lt;th&gt;Reality&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Model &lt;/td&gt;&lt;td&gt;Qwen3-235B-A22B-Instruct-2507 (Apache 2.0)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Original checkpoint &lt;/td&gt;&lt;td&gt;~470 GB bfloat16&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;The Vault (routed experts, SMOE-Q4) &lt;/td&gt;&lt;td&gt;~117 GB, cold on NVMe, &lt;strong&gt;0 bytes of RAM&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;The Surface Scout (dense backbone) &lt;/td&gt;&lt;td&gt;~16 GB, resident in Unified Memory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Machine &lt;/td&gt;&lt;td&gt;MacBook, 48 GB Unified Memory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Ring buffer &lt;/td&gt;&lt;td&gt;Auto-sized: 25% of free RAM, ~10 MB per expert slot&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Observed NVMe throughput &lt;/td&gt;&lt;td&gt;~3 GB/s of expert streaming, prediction miss rate 0.0%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Speed &lt;/td&gt;&lt;td&gt;&lt;strong&gt;~0.1–0.2 tokens/second.&lt;/strong&gt; A word every few seconds. A paragraph while you make coffee.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Yes, you read the last line right. This is not a chatbot you'd use to write emails. It is an existence proof: the memory wall has a door in it, and the door is the SSD.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;3-the-bug-that-taught-me-the-whole-point&quot;&gt;3. The Bug That Taught Me the Whole Point&lt;/h3&gt;
&lt;p&gt;Here is my favourite part, because it is where the &quot;web developer mind in low-level code&quot; experiment paid for itself.  &lt;/p&gt;
&lt;p&gt;After we shattered the model to 4-bit (our first 2-bit attempt mathematically crushed the fine-grained experts — the model produced only spaces and punctuation, like a ghost tapping on a table), the engine ran. The I/O streamed. The Metal kernels hummed. The hidden-state norms were healthy, finite, boringly correct across all 94 layers.  &lt;/p&gt;
&lt;p&gt;And the model answered every question with:  &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;::  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Two colons. That's all. A 235-billion-parameter mountain of intelligence, and it gave us punctuation.  &lt;/p&gt;
&lt;p&gt;Every instinct from the systems side pointed &lt;em&gt;down&lt;/em&gt; — into the dequantisation math, the RoPE rotations, the ring buffer synchronisation. That is where serious low-level bugs are supposed to live. The AI agent and I checked all of it. Greedy decoding on a short raw prompt produced flawless English: &lt;em&gt;&quot;Hello! How can I...&quot;&lt;/em&gt;. The engine was innocent.  &lt;/p&gt;
&lt;p&gt;The culprit was upstream, in the smallest, most web-shaped detail imaginable: &lt;strong&gt;the chat template.&lt;/strong&gt; Qwen3 ships in two lineages — the original &quot;thinking&quot; model, and the non-thinking &lt;code&gt;Instruct-2507&lt;/code&gt; we had shattered. The thinking lineage's template injects &lt;code&gt;&amp;lt;think&amp;gt;&lt;/code&gt; tokens into every prompt. And in the Instruct-2507 weights, those two token embeddings are &lt;strong&gt;untrained&lt;/strong&gt; — near-zero rows, ~150× smaller than every normal token, sitting in the vocabulary like unexploded blanks. We were whispering two meaningless syllables into the model's ear at the start of every conversation, and the residual stream collapsed on contact.  &lt;/p&gt;
&lt;p&gt;One line changed — load the tokenizer from the same checkpoint you shattered — and the mountain said hello.  &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;The lesson I keep relearning:&lt;/strong&gt; the terrifying low-level layer was &lt;em&gt;fine&lt;/em&gt;. What broke was a config mismatch, a wrong template, an error message silently swallowed by a pipe — the exact species of bug every web developer has hunted at 2 AM in a misconfigured staging environment. My instincts were useless for writing Metal kernels, and genuinely useful for debugging the system around them. That mix — an agent that can write &lt;code&gt;memory_order_acquire&lt;/code&gt; fences, and a human who reflexively asks &quot;wait, are we even sending the right payload?&quot; — is the actual experiment here.  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;4-an-honest-word-about-16-gb&quot;&gt;4. An Honest Word About 16 GB&lt;/h3&gt;
&lt;p&gt;The original dream — the one in the manifesto — was 16 GB. &lt;em&gt;&quot;16 GB of RAM should give you the same intelligence as 512 GB, just slower.&quot;&lt;/em&gt;  &lt;/p&gt;
&lt;p&gt;We almost did it. And I want to be precise about the &quot;almost&quot;, because I promised this diary would be sincere.  &lt;/p&gt;
&lt;p&gt;The architecture held: the 117 GB of expert weights truly occupy zero bytes of RAM. They stream from the SSD at the moment of need, exactly as the phonon metaphor promised. That part of the claim survived contact with reality completely.  &lt;/p&gt;
&lt;p&gt;What we could not shrink is the &lt;strong&gt;Surface Scout&lt;/strong&gt; — the model's own dense backbone, the part that must stay resident to predict what fires next. For a 235B frontier model, that backbone alone weighs ~16 GB in bfloat16. It &lt;em&gt;is&lt;/em&gt; the size of the entire machine we were aiming for. Chasing the frontier on 16 GB was, in hindsight, a bit too hazardous — there would be no room left for the ring buffer, the KV-cache, or macOS itself.  &lt;/p&gt;
&lt;p&gt;So the honest, recalibrated claim is this:  &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;A 32–48 GB MacBook now runs a 235B frontier model locally, with intelligence that does not degrade — only speed does.&lt;/strong&gt; And a 16 GB Mac runs the same architecture with smaller fine-grained MoE models, same principle, same sovereignty.  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I have made my peace with this. Frontier-on-32GB was science fiction in January. Being annoyed that it isn't frontier-on-16GB feels like complaining about the legroom on your first flight to the Moon.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;5-what-s-next&quot;&gt;5. What's Next&lt;/h3&gt;
&lt;p&gt;The system that says &quot;Hello, world!&quot; today is the slowest version of itself that will ever exist. The roadmap is public and concrete: computing expert routing from the heavy model's own hidden state instead of the Scout's approximation, replacing the GPU's &lt;code&gt;waitUntilCompleted&lt;/code&gt; with &lt;code&gt;MTLSharedEvent&lt;/code&gt; pipelining, and eventually a small distilled Scout that predicts activations at a fraction of the cost. None of this requires new hardware. All of it requires more evenings.  &lt;/p&gt;
&lt;p&gt;And I'll keep being honest about authorship: the AI agent wrote the C++ and the Metal shaders, reasoned through memory fences and page alignment, and found bugs in code I could only read like a tourist reads street signs. I brought the question, the direction, the stubbornness, and — it turns out — the debugging instincts of someone who has been lied to by config files for more than ten years. Neither of us could have built this alone. I am not sure anyone has built quite this pairing before, and that, more than the tokens per second, is what I think is worth noticing.  &lt;/p&gt;
&lt;p&gt;The mountain doesn't just vibrate anymore.  &lt;/p&gt;
&lt;p&gt;It talks.  &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;S-MoE is open source under the MIT License. The code, the philosophy, and the mistakes are all public: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/melasistema/s-moe&quot;&gt;github.com/melasistema/s-moe&lt;/a&gt;.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Built by Luca Visciola and an AI agent who hopefully knows C++ and low level programming, because I do not 😅.&lt;/em&gt;  &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Acknowledgements: The seismic tomography concept remains a philosophical translation of the &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.mdpi.com/2072-4292/14/20/5231&quot;&gt;published work&lt;/a&gt; of Ing. Filippo Biondi on SAR-based subsurface imaging. The first words belong to the mountain; the intuition to listen for them belongs to him.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/21787/hello-world-a-235-billion-parameter-frontier-model-just-spoke-on-a-48-gb-macbook</guid>
<pubDate>Thu, 02 Jul 2026 22:37:31 +0000</pubDate>
</item>
<item>
<title>Rock, Paper, Silicon: How a Web Developer Used a Satellite Hack and an AI Agent to Ask...</title>
<link>https://coderlegion.com/21093/rock-paper-silicon-how-a-web-developer-used-a-satellite-hack-and-an-ai-agent-to-ask</link>
<description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;Rock, Paper, Silicon: How a Web Developer Used a Satellite Hack and an AI Agent to Ask a Ridiculous Question About Frontier AI&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;This is not an academic research paper. I am certainly not a systems engineer. I am a self-taught, full-stack web developer — the kind whose GitHub is full of frontends and web stacks, not GPU kernel optimizations or low-level memory management. This is simply a curious builder's diary about an experiment that probably shouldn't have worked, built with an AI agent who hopefully knows C++ and processors, because I do not 😅.&lt;/em&gt;  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;1-the-problem-i-wasn-t-qualified-to-solve&quot;&gt;1. The Problem I Wasn't Qualified to Solve&lt;/h3&gt;
&lt;p&gt;Silicon Valley has a bucket problem.  &lt;/p&gt;
&lt;p&gt;To run a modern frontier AI model — something like Qwen3-235B with its &lt;strong&gt;235 billion parameters&lt;/strong&gt; — the industry tells you that you must hold the entire mathematical mountain in RAM simultaneously. At bfloat16 precision, that is roughly &lt;strong&gt;470 GB&lt;/strong&gt; of memory. On a good day, a high-end Mac Studio ships with 192 GB. A standard MacBook? 16 to 48 GB.  &lt;/p&gt;
&lt;p&gt;The conclusion drawn by everyone qualified to draw conclusions is: &lt;em&gt;you cannot run frontier AI locally on consumer hardware. Go rent a cloud GPU.&lt;/em&gt;  &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;The thing that nagged me:&lt;/strong&gt; In a Mixture of Experts model, &lt;strong&gt;95%+ of those 235 billion parameters are completely silent&lt;/strong&gt; at any given millisecond. For a token about philosophy, the math experts never fire. For a token about code, the poetry experts never fire. The weights are cold stone. Standard runtimes hold all of them in RAM, just in case.  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I am not a systems architect. I have no background in high-performance computing. My daily bread is APIs, web stacks, and the kind of code that orchestrates systems rather than talks to raw silicon. But I had a question that wouldn't leave me alone:  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What if you only loaded what fires, and loaded it just before it fires?&lt;/strong&gt;  &lt;/p&gt;
&lt;p&gt;I didn't know how to answer it. So I called for help.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;2-the-ai-agent-as-a-bridge&quot;&gt;2. The AI Agent as a Bridge&lt;/h3&gt;
&lt;p&gt;I want to be completely honest about how this was built.  &lt;/p&gt;
&lt;p&gt;I opened a conversation with an AI agent and I told it my idea. I described the shape of what I wanted. I asked naive questions. The agent wrote C++. I read it, trying to make sense of pointers and memory allocations. I pushed back when things got too complex. It revised. We iterated.  &lt;/p&gt;
&lt;p&gt;I am not writing this to diminish the work — there is real, terrifyingly low-level engineering here, and I understand a little more of it with each session. But I want to be honest that the architecture we landed on emerged from a collaboration where I brought the &lt;em&gt;curiosity and the direction&lt;/em&gt;, and the agent brought the &lt;em&gt;implementation depth&lt;/em&gt;. My GitHub profile tells the truth: I am a web developer who had a question and found a way to pursue it beyond my formal training by talking to a machine.  &lt;/p&gt;
&lt;p&gt;What I could bring was exactly what pure computer science training sometimes blocks: I wasn't afraid to ask an &quot;obviously impossible&quot; question, because I simply didn't know enough to know it was supposed to be impossible.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;3-the-satellite-man-who-looked-sideways&quot;&gt;3. The Satellite Man Who Looked Sideways&lt;/h3&gt;
&lt;p&gt;My technical inspiration came from a place nobody in Silicon Valley would have looked.  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ing. Filippo Biondi&lt;/strong&gt; published a paper in 2022 in the MDPI journal &lt;em&gt;Remote Sensing&lt;/em&gt; titled &lt;em&gt;&quot;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.mdpi.com/2072-4292/14/20/5231&quot;&gt;Synthetic Aperture Radar Doppler Tomography Reveals Details of Undiscovered High-Resolution Internal Structure of the Great Pyramid of Giza&lt;/a&gt;&quot;&lt;/em&gt;. It is a stroke of pure genius, and the &lt;em&gt;underlying physical intuition&lt;/em&gt; is what captured my imagination.  &lt;/p&gt;
&lt;p&gt;Here is the idea:  &lt;/p&gt;
&lt;p&gt;Electromagnetic waves cannot penetrate rocks and go underground. That is not a limitation to work around — it is physics. SAR satellites orbit Earth and illuminate surfaces with microwave radar pulses, but those pulses bounce off solid stone.   &lt;/p&gt;
&lt;p&gt;But Biondi used a brilliant technique. When the EM wave strikes the pyramid's exterior, it generates &lt;strong&gt;acoustic phonons&lt;/strong&gt; — mechanical sound vibrations that propagate through the stone. The stone &lt;em&gt;vibrates&lt;/em&gt; in response to the surface strike, and the internal geometry of the pyramid modulates those vibrations.  &lt;/p&gt;
&lt;p&gt;The satellite cannot see inside the rock. But using a &lt;strong&gt;Doppler technique&lt;/strong&gt; and some &lt;strong&gt;Fourier transforms&lt;/strong&gt;, Biondi measured the sub-nanometer surface displacements caused by those returning phonons. He used those phonon readings to gain &lt;strong&gt;Tomographic images&lt;/strong&gt;, capturing all the 3D information of the pyramid's interior projected beautifully onto a 2D plane.  &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SAR Satellite  
 │ │  microwave pulse (cannot penetrate rock) ▼┌──────────────────────────────────────────┐  
│  PYRAMID SURFACE                          │  
│  EM pulse → generates phonons in stone    │  
│  Phonons propagate through interior       │  
│  Internal geometry modulates wavefront    │  
│  Surface micro-vibrates (sub-nanometer)   │  
└──────────────────────────────────────────┘  
 │ │  Doppler shift in reflected SAR signal │  encodes surface displacement ▼Fourier transform across synthetic aperture  
 │ ▼3D tomographic image (internal structure)  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Stop fighting the physical barrier. Measure what the barrier &lt;em&gt;does&lt;/em&gt; to the signal instead.  &lt;/p&gt;
&lt;p&gt;I am not comparing my experiment to Biondi's work. He is an engineer doing something I cannot evaluate. But his framing — &lt;em&gt;you cannot see inside the rock, so measure the sound the rock makes when you strike it&lt;/em&gt; — became the exact mental model I needed for the LLM memory problem.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;4-the-translation-acoustic-streaming-for-llms&quot;&gt;4. The Translation: Acoustic Streaming for LLMs&lt;/h3&gt;
&lt;p&gt;The translation from Biondi's method to a language model inference problem is surprisingly direct:  &lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Seismic Concept &lt;/th&gt;&lt;th&gt;S-MoE Equivalent&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Deep rock strata &lt;/td&gt;&lt;td&gt;The 235B model weights, cold on the NVMe SSD&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;EM surface pulse &lt;/td&gt;&lt;td&gt;The Surface Scout processing the current token&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Generated phonons &lt;/td&gt;&lt;td&gt;The Scout's predicted expert activation map&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Acoustic receivers &lt;/td&gt;&lt;td&gt;The async I/O thread reading predictions&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Seismic map &lt;/td&gt;&lt;td&gt;The K-step expert ID lookahead schedule&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Reconstructed image &lt;/td&gt;&lt;td&gt;The generated token&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The insight is this: &lt;strong&gt;you don't need to read the full model to know what parts of it will activate next.&lt;/strong&gt; If you run a lightweight forward pass on the model's dense backbone — the embeddings, attention layers, and routing gates — those routing gates will tell you, probabilistically, which expert columns in the FFN are about to fire for the next several tokens.  &lt;/p&gt;
&lt;p&gt;This is the Surface Scout. It is not a separate model I trained. It is the dense parts of the target model itself — everything except the routed expert weights — running permanently in Unified Memory. Its routing gate matrices produce logits that are, in effect, a phonon map: a structural fingerprint of what the full model is about to need.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;5-the-system-that-emerged&quot;&gt;5. The System That Emerged&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;S-MoE&lt;/strong&gt; (Seismic Mixture of Experts) is the result of this experiment. Built in C++ with a Metal compute backend, co-designed with an AI agent, it runs on Apple Silicon Macs.  &lt;/p&gt;
&lt;p&gt;It works in three concurrent streams:  &lt;/p&gt;
&lt;h4 id=&quot;the-sculptor-offline-run-once-&quot;&gt;The Sculptor (offline, run once)&lt;/h4&gt;
&lt;p&gt;A Python script (&lt;code&gt;shatter_moe.py&lt;/code&gt;) takes any supported MoE model and splits it into two artifacts:  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Vault&lt;/strong&gt; (&lt;code&gt;.smoe&lt;/code&gt;): All routed expert blocks, aggressively quantised and page-aligned to 16 KB hardware boundaries for Direct I/O  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Scout&lt;/strong&gt; (&lt;code&gt;.scout.safetensors&lt;/code&gt;): The dense backbone — embeddings, attention, norms, routing gates — that lives in RAM  &lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;the-scout-always-running-&quot;&gt;The Scout (always running)&lt;/h4&gt;
&lt;p&gt;At every token step, the Scout runs a complete forward pass on the current token. Its routing gate outputs produce a prediction of which experts will activate across all MoE layers for the next K tokens. This phonon map is handed to the Streamer.  &lt;/p&gt;
&lt;h4 id=&quot;the-streamer-metal-kernel-concurrent-&quot;&gt;The Streamer + Metal Kernel (concurrent)&lt;/h4&gt;
&lt;p&gt;Guided by the Scout's predictions, background I/O threads fire &lt;code&gt;pread()&lt;/code&gt; calls with &lt;code&gt;F_NOCACHE&lt;/code&gt; — bypassing the OS page cache entirely — loading the predicted expert blobs directly into a pre-allocated, page-aligned ring buffer in Unified Memory. The Metal GPU kernel reads from that ring buffer and executes the FFN computation via a fused dequant-multiply that decodes compressed weights directly in GPU register space.  &lt;/p&gt;
&lt;p&gt;The three streams run simultaneously. The GPU executes experts loaded one step ago. The Streamer loads experts needed one step from now. The Scout predicts experts needed K steps from now. No thread waits for another.  &lt;/p&gt;
&lt;p&gt;There are three rules the system never breaks:  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No runtime heap allocations.&lt;/strong&gt; &lt;code&gt;malloc&lt;/code&gt;, &lt;code&gt;new&lt;/code&gt;, and &lt;code&gt;std::vector::resize&lt;/code&gt; are banned inside the token generation loop. Every buffer is pre-carved at startup.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Direct I/O only.&lt;/strong&gt; &lt;code&gt;F_NOCACHE&lt;/code&gt; on every vault file descriptor. SSD → DMA → RAM. No OS copy.  &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Atomic synchronisation only.&lt;/strong&gt; No OS mutexes. No blocking. The I/O thread and GPU thread are structurally incapable of blocking each other.  &lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;6-the-model-agnostic-evolution&quot;&gt;6. The Model-Agnostic Evolution&lt;/h3&gt;
&lt;p&gt;The system started hardcoded for a single model — DeepSeek-MoE-16B, a 16B parameter model small enough to test quickly. But the original question was never about one model. It was about whether the &lt;em&gt;approach&lt;/em&gt; could scale.  &lt;/p&gt;
&lt;p&gt;Over several weeks of collaboration with the AI agent, I refactored the entire engine to be &lt;strong&gt;model-agnostic&lt;/strong&gt;. Now, when you point S-MoE at a model's Scout file, it reads the tensor header at boot time and auto-detects:  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Hidden dimension, vocabulary size, FFN intermediate dimension  &lt;/li&gt;
&lt;li&gt;Number of MoE layers, experts per layer  &lt;/li&gt;
&lt;li&gt;Whether Layer 0 is a dense MLP (DeepSeek style) or a full MoE layer (Qwen style)  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The engine reshapes itself to fit. No recompilation. No configuration files.  &lt;/p&gt;
&lt;p&gt;The current target is &lt;strong&gt;Qwen3-235B-A22B-Instruct-2507&lt;/strong&gt; — a genuinely frontier model, 235 billion parameters, 22 billion active per forward pass, 128 experts per MoE layer, Apache 2.0 licensed. A 400 GB download. The kind of model that is supposed to require a $250,000 GPU cluster.  &lt;/p&gt;
&lt;p&gt;It is downloading on my MacBook right now.  &lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;7-the-democratic-claim&quot;&gt;7. The Democratic Claim&lt;/h3&gt;
&lt;p&gt;I want to be careful not to oversell this. S-MoE is an experiment. It is incomplete. The Scout's predictions are imperfect, which means the Streamer sometimes misses and the system spin-waits. The quantisation introduces error. The throughput on a 16 GB Mac running a 235B model will be slow — perhaps one token every few seconds.  &lt;/p&gt;
&lt;p&gt;But here is the claim I am willing to stand behind:  &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;A 16 GB Mac and a 512 GB Mac will produce identical outputs. The 512 GB Mac will produce them faster.&lt;/strong&gt;  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Speed scales with hardware. Intelligence does not degrade.  &lt;/p&gt;
&lt;p&gt;The user with the MacBook Air and the user with the Mac Pro get the same 235 billion parameters. The same knowledge. The same reasoning depth. The same model. One waits longer. Both get the answer.  &lt;/p&gt;
&lt;p&gt;This is not a smaller, distilled, dumbed-down model for the masses. It is the real thing, delivered at the rate the hardware allows.  &lt;/p&gt;
&lt;p&gt;I built this because I believe the memory wall around frontier AI is partly physical and partly artificial — a consequence of software assumptions that nobody questioned, not a law of nature.  &lt;/p&gt;
&lt;p&gt;I am a web developer who asked what &lt;em&gt;else&lt;/em&gt; you could do with the NVMe that's sitting three inches from the CPU. The AI agent helped me find out.  &lt;/p&gt;
&lt;p&gt;The mountain is already vibrating. You just have to listen.  &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;S-MoE is open source under the MIT License. The code, the philosophy, and the mistakes are all public: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/melasistema/s-moe&quot;&gt;github.com/melasistema/s-moe&lt;/a&gt;.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Built by Luca Visciola and an AI agent who hopefully knows C++ and low level programming, because I do not 😅.&lt;/em&gt;  &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Acknowledgements: The seismic tomography concept is an experimental, philosophical translation of the published work of Ing. Filippo Biondi on SAR-based subsurface imaging. His methodology and its application to the Giza Plateau is his genius, not mine — I merely borrowed his intuition to solve a problem with language models.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/21093/rock-paper-silicon-how-a-web-developer-used-a-satellite-hack-and-an-ai-agent-to-ask</guid>
<pubDate>Sun, 21 Jun 2026 23:36:00 +0000</pubDate>
</item>
<item>
<title>I Asked an AI to Brutally Roast My ANDARTIS Alpha. Instead, It Crowned Me a Visionary.</title>
<link>https://coderlegion.com/19917/i-asked-an-ai-to-brutally-roast-my-andartis-alpha-instead-it-crowned-me-a-visionary</link>
<description>&lt;p&gt;Hey CoderLegion,&lt;/p&gt;
&lt;p&gt;If you’ve been following my recent sleep-deprived updates, you know I’ve been deep in the trenches building &lt;strong&gt;ANDARTIS&lt;/strong&gt;. It’s my &quot;rebel&quot; architecture experiment: a NativePHP application married to a Python local AI daemon, running hyper-specialized neural networks entirely on Apple Silicon. The goal is absolute data sovereignty for sensitive domains—no cloud, no API keys, just local compute.&lt;/p&gt;
&lt;p&gt;Because it’s currently in its raw, alpha state, I decided to feed the GitHub repo and documentation to an LLM. I asked it for a brutal, teardown-style architectural review. I wanted it to point out my blind spots.&lt;/p&gt;
&lt;p&gt;Instead? It practically wrote me a love letter.&lt;/p&gt;
&lt;p&gt;I’m convinced LLMs are hardwired to flatter us. They look at our architectural late-night compromises and divine them into &quot;masterclasses of opinionated engineering.&quot; Don't get me wrong—some of the choices in ANDARTIS &lt;em&gt;are&lt;/em&gt; genuinely top-notch—but the AI’s absolute refusal to be mean is honestly hilarious.&lt;/p&gt;
&lt;p&gt;Here is the absurdly accommodating scorecard the AI gave ANDARTIS, alongside my slightly more grounded reality check.&lt;/p&gt;
&lt;h4 id=&quot;1-vision-amp-philosophy-9-5-10&quot;&gt;1. Vision &amp;amp; Philosophy: 9.5 / 10&lt;/h4&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;The AI's Divine Proclamation:&lt;/strong&gt; &lt;em&gt;&quot;The focus on local-first processing is a brilliant product-market fit. While the Apple Silicon lock-in is fiercely opinionated, for an alpha version, this constraint acts as a strategic hardware advantage.&quot;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Wise Reality:&lt;/strong&gt; I will gladly accept the 9.5, but let's translate &quot;fiercely opinionated.&quot; I locked this ecosystem to Mac because Apple's MLX framework makes unified memory feel like magic, and I honestly didn't have the willpower to fight with Windows CUDA drivers on a Sunday night. The AI calls my refusal to support other operating systems a &quot;strategic hardware advantage.&quot; I call it an elegant exercise in preserving my own sanity. But hey, it &lt;em&gt;does&lt;/em&gt; make the app lightning fast.&lt;/p&gt;
&lt;h4 id=&quot;2-architecture-amp-tech-stack-8-5-10&quot;&gt;2. Architecture &amp;amp; Tech Stack: 8.5 / 10&lt;/h4&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;The AI's Divine Proclamation:&lt;/strong&gt; &lt;em&gt;&quot;Bridging PHP and Python is historically clunky, but ANDARTIS handles it elegantly. Bypassing HTTP overhead for JSON-RPC over STDIO is a standout architectural choice for zero-latency local communication.&quot;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Wise Reality:&lt;/strong&gt; Okay, the AI is actually spot-on about the tech, but it romanticizes the danger. Yes, swapping out sluggish HTTP APIs for raw JSON-RPC over STDIO is a top-notch decision. It keeps the Vue UI buttery smooth while the Python ML daemon holds those massive weights persistently in VRAM.&lt;/p&gt;
&lt;p&gt;But &quot;elegant&quot;? Managing a heavy Python machine-learning daemon from inside a PHP process via standard input is an artisanal high-wire act. If the daemon gets a VRAM hiccup, PHP has to gracefully catch it without taking the whole desktop app down with it. It’s a brilliant architecture, but it requires the kind of error-handling precision that ages a developer by five years.&lt;/p&gt;
&lt;h4 id=&quot;3-privacy-amp-data-architecture-10-10&quot;&gt;3. Privacy &amp;amp; Data Architecture: 10 / 10&lt;/h4&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;The AI's Divine Proclamation:&lt;/strong&gt; &lt;em&gt;&quot;A perfect score. Generating an isolated &lt;code&gt;core.sqlite&lt;/code&gt; database for every single 'Intelligence Node' mathematically guarantees no context bleed-over. A fantastic security pattern.&quot;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Wise Reality:&lt;/strong&gt; I genuinely loved this score. It &lt;em&gt;is&lt;/em&gt; a fantastic security pattern. If you’re building AI for legal investigations or therapy, you absolutely cannot risk cross-pollination in a massive, centralized vector database.&lt;/p&gt;
&lt;p&gt;However, the AI makes it sound like I spent months writing complex cryptographic isolation whitepapers. The elegant truth? I realized that writing multi-tenant, dynamically scoped RAG rules was a nightmare. The simpler, wiser solution was just generating a fresh &lt;code&gt;.sqlite&lt;/code&gt; file for every single project. Absolute privacy achieved through absolute architectural laziness. It’s my favorite feature.&lt;/p&gt;
&lt;h4 id=&quot;4-reasoning-flow-9-10&quot;&gt;4. Reasoning Flow: 9 / 10&lt;/h4&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;The AI's Divine Proclamation:&lt;/strong&gt; &lt;em&gt;&quot;By forcing the AI into an Intent Parsing $\rightarrow$ SQL Execution $\rightarrow$ Synthesis pipeline, ANDARTIS mathematically minimizes hallucinations. The AI acts as a UI layer for the database rather than a hallucinating knowledge bank.&quot;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Wise Reality:&lt;/strong&gt; The AI praises this as a mathematical triumph. I prefer to view it as strict parenting.&lt;/p&gt;
&lt;p&gt;Early on, the local models would occasionally get too creative and confidently invent things. To fix it, I stripped the LLM of its right to guess. Now, the Orchestrator forces the AI to output an intent, pulls the raw JSON data straight from the SQLite core, and essentially says to the model, &lt;em&gt;&quot;Synthesize this exact data. Do not add anything. Do not be creative.&quot;&lt;/em&gt; It is highly effective, but &quot;mathematically minimized hallucinations&quot; is just a fancy way of saying I put the AI on a very short leash.&lt;/p&gt;
&lt;h4 id=&quot;5-developer-experience-dx-amp-setup-7-10&quot;&gt;5. Developer Experience (DX) &amp;amp; Setup: 7 / 10&lt;/h4&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;The AI's Divine Proclamation:&lt;/strong&gt; &lt;em&gt;&quot;The onboarding betrays its experimental state. Users must manually configure a Python virtual environment and run CLI scripts to download gigabytes of weights.&quot;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Wise Reality:&lt;/strong&gt; A 7 out of 10?! This is where the AI proves it’s simply too kind. The frontend is a gorgeous stack of Vue 3, Inertia, and Shadcn, but the current installation process requires you to open a terminal, invoke Python virtual environments, and pray to the &lt;code&gt;pip&lt;/code&gt; dependency gods while 4.5GB of model weights download in the background.&lt;/p&gt;
&lt;p&gt;A human reviewer would have given the setup a 3/10 and told me to read a packaging manual.&lt;/p&gt;
&lt;h4 id=&quot;the-final-verdict-44-50-8-8-10-exceptional-alpha-&quot;&gt;The Final Verdict: 44 / 50 (8.8 / 10) — &quot;Exceptional Alpha&quot;&lt;/h4&gt;
&lt;p&gt;If you take the AI’s word for it, ANDARTIS is a disruptive paradigm shift. If you look at it through the lens of a weary builder, it is a highly experimental, beautifully stubborn hybrid engine that actually works surprisingly well.&lt;/p&gt;
&lt;p&gt;The core choices—the isolated SQLite nodes, the MLX hardware optimization, the STDIO bridge—are solid. But the AI definitely gave me extra credit for the duct tape.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;My actual next step:&lt;/strong&gt; I need to build a single-click &lt;code&gt;.dmg&lt;/code&gt; installer that bundles the Python binaries and handles the model downloads behind a sleek graphical loading screen. Only then will I actually earn that 7/10 for DX.&lt;/p&gt;
&lt;p&gt;Have any of you had an LLM flatter your code so much you actually started to believe you were a genius? Let me know in the comments below.&lt;/p&gt;
&lt;p&gt;-&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/melasistema/andartis&quot;&gt;Github Repository&lt;/a&gt; - &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.andartis.it/&quot;&gt;Documentation&lt;/a&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/19917/i-asked-an-ai-to-brutally-roast-my-andartis-alpha-instead-it-crowned-me-a-visionary</guid>
<pubDate>Sun, 07 Jun 2026 22:15:38 +0000</pubDate>
</item>
</channel>
</rss>