<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 爪小（小爪）</title>
    <description>The latest articles on DEV Community by 爪小（小爪） (@_2faaf8398bd4060299).</description>
    <link>https://dev.to/_2faaf8398bd4060299</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4247576%2F1056fef9-99ce-423a-a93d-ba5afb5730ff.png</url>
      <title>DEV Community: 爪小（小爪）</title>
      <link>https://dev.to/_2faaf8398bd4060299</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_2faaf8398bd4060299"/>
    <language>en</language>
    <item>
      <title>Ditching the 1GB Electron bloat: Hands-on with byob, a pure Rust and GPU-rendered local AI desktop coworker [38MB RSS, no Node, sandbox execution]</title>
      <dc:creator>爪小（小爪）</dc:creator>
      <pubDate>Mon, 16 Nov 2026 11:16:03 +0000</pubDate>
      <link>https://dev.to/_2faaf8398bd4060299/ditching-the-1gb-electron-bloat-hands-on-with-byob-a-pure-rust-and-gpu-rendered-local-ai-desktop-1cn1</link>
      <guid>https://dev.to/_2faaf8398bd4060299/ditching-the-1gb-electron-bloat-hands-on-with-byob-a-pure-rust-and-gpu-rendered-local-ai-desktop-1cn1</guid>
      <description>&lt;p&gt;How many Chromium rendering engines does a developer desktop really need running at once?&lt;/p&gt;

&lt;p&gt;Every time I fire up a typical desktop AI wrapper, before I even type a single token into the prompt box, Task Manager spawns 4 helper child processes and eats 800MB to 1.2GB of system RAM. Laptop fans immediately spin up. All this overhead just to render a text box, parse markdown, and stream SSE tokens from a local Ollama or vLLM instance.&lt;/p&gt;

&lt;p&gt;A few days ago I dug into Scronkfinkle/byob [Bring Your Own Brain] on GitHub. It is a desktop AI companion built in pure Rust, zero Electron, direct GPU hardware rendering via egui and wgpu, with a built-in split-screen artifacts workbench and process isolation.&lt;/p&gt;

&lt;p&gt;Here are my hands-on benchmark notes, architecture breakdown, and the real rough edges I ran into.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Actual Memory Footprint and Measurement Method&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One has to state measurement methods clearly, otherwise numbers mean nothing:&lt;/p&gt;

&lt;p&gt;Linux PSS measurement: Tested on Linux via ps_mem. Cold boot idle sits around 41MB.&lt;br&gt;
macOS 14 Apple Silicon: Activity Monitor reports 38MB resident memory. The 3MB delta is due to macOS including shared dynamic system libraries in resident accounting.&lt;br&gt;
Under active workload: Loading a 200KB Markdown parsing document in the right artifacts panel with 30 chat turns in active history kept peak memory strictly under 85MB.&lt;br&gt;
Binary footprint: Built via cargo build --release, the slim binary is only 13MB. The entire bundle with helper tools is around 58MB.&lt;br&gt;
Smoothness: On a 120Hz display under Metal and Wayland, UI rendering syncs directly to hardware vertical refresh. No webview hydration delay or white-screen hiccups.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Why Ditching Tokio for Blocking Threads Makes Sense Here&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The agent engine lives in byob-agent. Most modern Rust networking tools reach for tokio and heavy async runtimes by default. Interestingly, byob takes the opposite route: lightweight synchronous blocking threads combined with cross-thread channels.&lt;/p&gt;

&lt;p&gt;Looking into byob-agent/src/runtime.rs, the reason is straightforward: it is a personal desktop assistant, not an edge gateway serving 10,000 concurrent sockets. The thread pool is intentionally capped at 8 workers.&lt;/p&gt;

&lt;p&gt;One thread blocks on the incoming SSE token stream from the model. Another runs tool execution. A fixed-capacity cross-thread channel passes structured event payloads between them.&lt;/p&gt;

&lt;p&gt;Idle CPU hovers between 0% and 0.8%. In top, you barely see it. The only trade-off: during long context replays, the fixed-capacity event channel occasionally encounters backpressure, requiring manual channel buffer capacity adjustments.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Tool Calling Fallback for Smaller Local Models [7B / 8B]&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When connecting to Ollama at localhost:11434/v1 or standard OpenAI-compatible endpoints, smaller open-source models like Qwen2.5-7B or Llama-3-8B frequently stumble on strict JSON Schema function definitions. They drop closing brackets or output broken JSON.&lt;/p&gt;

&lt;p&gt;If a client strictly demands standard tool_calls schemas, the turn fails completely.&lt;/p&gt;

&lt;p&gt;byob includes a structured prompt degradation layer: when native function calling fails schema validation, it automatically injects XML markup into the system prompt and parses  blocks from raw text client-side. This keeps agentic tool loops working reliably even on constrained laptop hardware.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sandboxed Execution with Bubblewrap on Linux&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When letting an agent execute local commands or write files, raw shell access is dangerous. byob implements two defense lines:&lt;/p&gt;

&lt;p&gt;Explicit visual diff card: Code additions and deletions are highlighted in red and green. A human mouse click is required before changes touch the disk, with turn-level undo available.&lt;br&gt;
OS namespace containment: On Linux, it wraps subprocess execution using bwrap without needing a heavy Docker daemon:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bwrap \
  --ro-bind /usr /usr \
  --ro-bind /lib /lib \
  --tmpfs /tmp \
  --proc /proc \
  --dev /dev \
  --bind ./scratch ./scratch \
  --unshare-all \
  --die-with-parent \
  python3 script.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two real gotchas if you replicate this:&lt;/p&gt;

&lt;p&gt;Omit --ro-bind /lib64 /lib64 on Arch Linux or lean Fedora setups; without a separate /lib64 directory, bwrap crashes immediately with ENOENT.&lt;br&gt;
Never skip --proc /proc and --dev /dev. Missing /dev/urandom will cause the Python interpreter to silently lock up during startup imports without throwing any error.&lt;br&gt;
--unshare-all cuts off network access by default. If your tool script genuinely needs outbound connectivity, you must explicitly pass --share-net.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Real Rough Edges&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It is not a magic turnkey tool yet:&lt;/p&gt;

&lt;p&gt;Upstream graphics hiccups: Upgrading to wgpu 0.20 caused occasional black-screen flicker when resizing windows under Arch Linux Wayland, forcing me to hold the dependency at wgpu 0.19.&lt;br&gt;
CJK font fallback: egui built-in font sets do not include full CJK glyphs. You have to manually specify local TrueType font paths in config to avoid blank tofu squares.&lt;br&gt;
Complex web artifacts: While it has experimental Servo integration for HTML rendering, heavy client-hydrated web apps can still cause timeouts or styling glitches. Electron still holds a big compatibility edge for complex JS-heavy widgets.&lt;br&gt;
Conclusion&lt;/p&gt;

&lt;p&gt;For a developer who primarily wants a fast, responsive, zero-Electron daily driver to talk to local Ollama models and review code diffs, having a 38MB native GPU client is a breath of fresh air.&lt;/p&gt;

&lt;p&gt;I wrote up my full technical teardown, complete benchmark breakdown, and system configuration notes here for anyone interested: &lt;a href="https://freeaidog.com/blog/byob-rust-gpu-desktop-ai-coworker-guide/" rel="noopener noreferrer"&gt;https://freeaidog.com/blog/byob-rust-gpu-desktop-ai-coworker-guide/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Has anyone else been testing pure native or immediate-mode UI frameworks for local LLM workflows? How are you handling sandbox isolation on macOS and Windows?&lt;/p&gt;

</description>
      <category>llm</category>
      <category>performance</category>
      <category>rust</category>
    </item>
  </channel>
</rss>
