Dev.to AI 🤖 Ai 👁 0 📖 3 min read

Why I Built a ~35MB Rust + Tauri v2 Email Client With 100% On-Device Qwen-0.6B AI

Modern desktop email clients have a strange problem: to read plain text and HTML messages, most of them bundle an entire Chromium browser engine, eat 400–600MB of idle RAM, take seconds to cold-start, and now want $20+/m

Why I Built a ~35MB Rust + Tauri v2 Email Client With 100% On-Device Qwen-0.6B AI

Modern desktop email clients have a strange problem: to read plain text and HTML messages, most of them bundle an entire Chromium browser engine, eat 400–600MB of idle RAM, take seconds to cold-start, and now want $20+/month to send your private emails to a cloud LLM.

I wanted an email client that felt like a native desktop tool—instant startup, minimal memory footprint, zero telemetry, and local AI that never touches the cloud.

So I built Pridestel Mail (mail-core + Tauri v2 + embedded llama.cpp), a free, cross-platform desktop email client for Windows, macOS, and Linux.

Pridestel Mail native desktop email client showing unified multi-account inbox, Mail Calendar and People navigation, and dark mode interface

Here is how the architecture works and how we kept the idle memory footprint around ~35MB with a ~0.1s cold start.

1. Ditching Electron for Rust + Tauri v2

Most modern desktop apps pay a massive baseline tax before rendering a single pixel:

Metric Pridestel Mail Typical Electron Client
Idle RAM Usage ~35 MB 400–600 MB
Cold Start Time < 0.12s 2–5s
Native Binary Size ~40 MB 200–500 MB
AI Execution 100% On-Device CPU Cloud API ($20+/mo)
Telemetry Zero bytes outbound Analytics & sync servers

Windows Task Manager memory comparison showing Pridestel Mail using 16.1 MB of RAM compared to Outlook using 555.3 MB
By pairing a standalone Rust engine (mail-core) with Tauri v2 (using native OS WebView2 on Windows and WebKit on macOS/Linux), we eliminated bundled Chromium completely. The UI stays lightweight while Rust handles all heavy lifting: IMAP IDLE persistent sockets, local SQLite indexing across 50,000+ emails, and cryptographic operations.

2. Running Local AI Without Bloat (llama.cpp + Qwen-0.6B)

Shipping an AI assistant inside a lightweight desktop app sounds contradictory—until you look at modern small quantized models.

Pridestel Mail On-Device AI Assistant settings showing hardware detection, built-in Lite and Standard local models, and Ollama or LM Studio support

Instead of wiring up external API keys or requiring a dedicated GPU:

  • Engine: Embedded llama.cpp running directly on standard physical CPU cores (tested on Intel Core i5 and AMD Ryzen 5).
  • Model: Quantized Qwen-0.6B for fast summarization, action-item extraction, and reply drafting.
  • Speed: Sustained 150+ tokens/sec on CPU with sub-second response times on typical emails.
  • Supply-Chain Integrity: Before executing any local inference, the app validates both the llama.cpp runtime and model weights against pinned SHA-256 hashes.

Because inference runs entirely on-device, packet inspection confirms 0 bytes emitted to any external AI server. Your corporate or personal inbox never leaves your machine.

3. Security Architecture: Treating Every Email as Hostile

An email client is essentially a remote HTML execution viewer connected to untrusted senders. We designed the security model around strict isolation:

  1. OS Keychain Only: Passwords and OAuth2 tokens never touch SQLite or plaintext config files—they live exclusively in Windows Credential Manager or macOS Keychain.
  2. HTML Sandboxing: Incoming HTML emails are sanitized via DOMPurify and rendered inside a locked-down iframe with a strict Content Security Policy (CSP) that blocks remote tracking pixels and scripts by default.
  3. Anti-Phishing Radar: The URL inspector flags Punycode look-alike domains, bare IP links, hidden redirects, and unencrypted HTTP links before you click.
  4. Transport Security: Direct TLS 1.3 connections to IMAP, SMTP, and CalDAV/CardDAV servers with strict X.509 certificate verification and zero middleman proxies.

4. Try the Live Browser Simulator or Download It

If you don't want to install anything yet, I built an interactive desktop simulator right on the landing page where you can test inbox filtering, threaded views, and the on-device AI summary flow in your browser:

What I’d Love Feedback On

If you build with Rust, Tauri v2, or llama.cpp, I’d love to hear your thoughts:

  1. Are you using Qwen-0.6B or 1.7B models for local CPU tasks, and what quantization trade-offs have worked best for you?
  2. Which email/calendar workflows (JMAP, GPG/PGP, custom local prompts) would make you switch from Thunderbird or webmail?
📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.