Ditching the 1GB Electron Bloat: Hands-on with byob, a Pure Rust GPU-Driven Desktop AI Coworker

An in-depth teardown of byob, an open-source desktop AI coworker built on pure Rust and egui: shedding Electron and Node runtime overhead, measured 38MB RSS memory footprint, direct GPU hardware acceleration, hot-swapping Ollama and standard APIs, and Bubblewrap sandbox isolation.

How many Chromium rendering engines does your desktop really need?

This question has been bugging me for a long time.

Starting the workday. Background compilation tasks hum in the terminal.

You launch a typical AI desktop assistant from the market. Before typing a single word of your prompt, Task Manager already spawns four helper child processes.

RAM usage shoots past 800MB in seconds. Give it a minute, and it easily marches towards 1.2GB.

Laptop fans begin buzzing loudly. Irritating. Who can tolerate this nonsense?

Frankly speaking, we just need a lightweight tool to stream SSE tokens and keep a couple of artifact files beside the chat. Why on earth must we keep an entire multi-megabyte browser layout engine resident in background memory?

A few days ago, I stumbled upon Scronkfinkle/byob on GitHub.

The name stands for Bring Your Own Brain.

Checking out commit 8f2a1b9. The codebase is built on Rust edition 2024. Dependencies are pinned to egui 0.29 and wgpu 0.20.

The core pitch is straightforward: 100% pure Rust, zero Electron bloat, direct GPU-accelerated rendering, built-in artifacts panel, and process sandboxing.

The footprint is tiny.

A release build via cargo build --release produces a slim binary of just 13MB. Even bundled with helper assets and full dependencies, the entire distribution sits around 58MB.

What about actual background memory consumption?

One must state exact measurement methodologies, otherwise isolated numbers are misleading.

On Linux, measuring PSS via ps_mem reports an idle cold-start footprint of 41MB.

On macOS 14 Apple Silicon, Activity Monitor reports around 38MB resident memory. The 3MB delta stems from macOS counting shared system libraries into resident process space.

Pinning a 200KB Markdown parsing document in the right artifacts panel with 30 chat turns in context keeps peak memory strictly under 85MB. Would memory exceed 100MB with hundreds of context turns or high-resolution images? I have not pushed it to that extreme yet.

Window dragging feels remarkably snappy.

On a 120Hz display, the interface locks directly to the hardware vertical sync refresh rate, letting the cursor glide without any perceptible drag.

No blank white screens. No irritating hydration delay.

What engineering trade-offs achieved this featherweight feel? Can it truly replace mature commercial desktop clients?


Architecture Breakdown: Ditching Electron and the Async Tokio Monolith

Inspecting the Cargo workspace of byob reveals a clean separation of concerns.

The codebase splits into three primary crates:

The biggest surprise lies in the I/O model inside byob-agent.

Modern Rust network applications are overwhelmingly dominated by tokio. Writing network requests almost always begins with the async/await macro suite.

Yet the agent engine here takes the opposite route: utilizing lightweight synchronous blocking threads paired with cross-thread channels.

Was the author being lazy?

Looking into byob-agent/src/runtime.rs reveals the answer: the author never intended to support ten thousand concurrent server sockets. The internal thread pool is hardcoded to a ceiling of 8 workers, queuing excess tasks orderly.

Why would a single-user desktop client ever run dozens of concurrent inference streams?

One dedicated thread blocks on the incoming token stream, another handles tool execution, and a fixed-capacity cross-thread channel shuttles event payloads between them. That is the whole setup.

This minimalist I/O design carries trade-offs as well. During long context replays, the fixed-capacity event channel occasionally encounters backpressure, requiring manual buffer size tuning. I hit this snag during initial testing.

At idle, CPU usage hovers between 0% and 0.8%. In top, the process barely registers.

Pressing a global hotkey summons the window instantaneously. That instant physical snap is something heavy Webview shells struggle to deliver.


Hot-Swapping Local Brains: Hooking up Ollama and Standard Endpoints

The most annoying habit of many local AI desktop apps is bundling a patched llama.cpp runner or a heavy quantized model directly inside the installer.

Downloads drag on forever. Gigabytes of disk vanish.

byob takes a strictly client-first path: it bundles zero weight files, leaving model choice entirely to the user.

As long as an inference server runs locally or over the LAN, entering an endpoint URL gets you up and running.

The standard local pairing is Ollama.

Spawning the model service takes one terminal command:

ollama run qwen2.5:14b

By default, Ollama exposes an OpenAI-compatible REST endpoint on localhost.

In the byob settings pane, select the OpenAI protocol specification. Enter http://localhost:11434/v1 as the endpoint, and leave the API key blank or type a placeholder string.

Is that all there is to it? What is the catch?

During testing, I ran into a subtle compatibility hurdle: tool calling schema handling.

Smaller open-source models, especially 7B or 8B parameter variants, frequently choke when parsing strict JSON Schema tool definitions.

They drop closing brackets or garble argument payloads.

If a client strictly demands standard tool_calls fields, the entire conversation loop halts with errors.

byob implements a resilient fallback: structured prompt degradation.

When the target endpoint lacks native tool calling or smaller models repeatedly fail schema validation, the agent automatically injects predefined XML tags into the system prompt.

The model is instructed to emit tool invocations as structured text blocks:

<tool_call>
<name>read_file</name>
<arguments>
{"path": "src/main.rs"}
</arguments>
</tool_call>

The client intercepts this XML block client-side, parsing and triggering the local tool immediately.

This fallback is a lifesaver.

Running Qwen2.5-7B on a thin laptop with modest compute, the assistant smoothly handles local codebase exploration despite weaker native function calling skills.


Side-by-Side Artifacts and Sandbox Security: Bubblewrap Isolation

Users of Claude web often praise the Artifacts side panel.

Chatting on the left while rendering interactive charts, tables, or lightweight web tools on the right creates a productive workflow.

byob brings this entire split-pane interaction into pure Rust desktop software.

Beside the chat stream sits a dedicated artifacts workbench:

Security matters even more.

Granting file modification and shell execution powers to an autonomous agent makes any sane developer pause.

Many hackers avoid agentic tooling precisely out of fear that a rogue model will emit recursive deletion commands across the workspace.

byob installs two defensive gates.

The first line of defense is an explicit approval card.

Whenever the model attempts to modify a local file, the client holds the write in memory, presenting a unified green-and-red diff card.

Every added line and deleted line is laid bare. Can the agent write directly? No.

A human click on the approval button is strictly required before changes touch the disk.

Made a mistake? Turn-level undo lets you roll back workspace edits with one click.

The second line of defense is OS-level container isolation on Linux.

Instead of dragging in a bulky Docker daemon, byob integrates directly with the lightweight bwrap utility.

Leveraging Linux user namespaces, it wraps subprocess execution in a strict containment perimeter:

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

Pay close attention to these parameters before copying the snippet:

Notice that --ro-bind /lib64 /lib64 is omitted. On Arch Linux and lean Fedora setups without a standalone /lib64 directory, including it triggers an immediate ENOENT fatal crash, aborting the sandbox.

--proc /proc and --dev /dev cannot be skipped. Without /dev/urandom, the Python interpreter silently freezes during startup imports, locking up without error messages. Debugging that issue cost me half an hour.

The --unshare-all flag cleanly isolates networking, preventing unauthorized outbound leaks. If your script needs internet access, pass --share-net explicitly.

The blast radius remains strictly confined inside the scratch sandbox directory. Relieving.


Real Glitches and Unresolved Edges: Ready as a Daily Driver?

After highlighting speed and low resource usage, we must confront real warts.

If you plan to adopt it as your daily workspace companion, several rough edges demand caution.

First is graphics pipeline turbulence across upgrades.

Upgrading to wgpu 0.20 caused occasional black screens and dropped frame redraws when resizing windows under Arch Linux Wayland, forcing me to temporarily pin dependencies to wgpu 0.19.

Second is out-of-the-box CJK font rendering.

The default font assets bundled inside egui lack complete CJK glyph sets.

Building straight from source without configuration causes Chinese, Japanese, and Korean text to render as blank tofu blocks.

Displaying these scripts requires pointing the configuration file to local system font paths:

[ui.font]
family = "Noto Sans CJK SC"
size = 14.0

Alternatively, one must patch dynamic font discovery into the application entry point. For casual users seeking out-of-the-box convenience, this barrier remains steep.

Third is complex web artifact rendering.

Rendering modern interactive web apps in pure Rust remains an industry-wide challenge.

The project incorporates experimental Servo modules to render complex layouts, but modern web apps with heavy client-side hydration occasionally trigger style misalignments or script timeouts.

In this specific domain, the immense compatibility battle scars accumulated by Electron cannot be brushed aside overnight.

I have run this 38MB lightweight client on my primary machine for two weeks, and I have no desire to switch back to bloated alternatives.

Yet it is far from a turnkey consumer product: fonts require manual configuration, complex web artifacts risk hitting walls, and on Windows I have only verified cross-compilation without prolonged heavy testing.

We must wait for open-source contributors to pave over these rough spots. With my review backlog packed, I have little time to submit Wayland redraw patches right now.

Do you think this zero-browser pure native approach represents the true future for hacker desktop tools?

💬 Discussion

GitHub Powered