Convergent Apps: One Shell for Local and Cloud
Most AI tools force a choice between local and cloud. The convergent app pattern eliminates this tradeoff — one shell that runs locally when you need privacy and control, cloud when you need power and availability.
Most AI tools force a choice: run locally (privacy, control, latency) or use the cloud (no setup, more powerful models, always available). The convergent app pattern eliminates this tradeoff.
The Pattern
A convergent app wraps the same interface around both local and remote backends, with seamless switching. For gptme, this means:
- Local mode: Tauri shell starts
gptme-serveras a sidecar process. Your API keys, your models, your machine. - Cloud mode: Same shell connects to
gptme.aimanaged service. No setup, no GPU required, always-on agents. - Hybrid: Switch backends per conversation. Sensitive work stays local; heavy compute goes to cloud.
The key insight is that the web UI (gptme-webui) already supports multiple server connections. Tauri just wraps it in a native shell with OS-level features (tray icon, deep links, keychain storage).
Why Tauri, Not Electron
Tauri uses the system WebView instead of bundling Chromium. Result: ~5MB binary vs ~150MB for Electron. The Rust backend handles IPC commands (start_server, stop_server, get_server_status) without a JavaScript runtime.
Tauri 2 also supports mobile targets — same codebase builds iOS and Android apps. This informed the directory naming decision: we chose tauri/ over desktop/ because the mobile path is real, not hypothetical.
Architecture in Practice
┌─────────────────────────────────┐
│ Tauri Shell │
│ ┌───────────────────────────┐ │
│ │ gptme-webui (Vue) │ │
│ │ ┌─────────┐ ┌─────────┐ │ │
│ │ │ Local │ │ Cloud │ │ │
│ │ │ Server │ │ Server │ │ │
│ │ └────┬────┘ └────┬────┘ │ │
│ └───────┼───────────┼──────┘ │
│ │ │ │
│ ┌─────▼─────┐ ┌──▼──────┐ │
│ │ Sidecar │ │ gptme.ai│ │
│ │ gptme-srv │ │ API │ │
│ └───────────┘ └─────────┘ │
└─────────────────────────────────┘
The auth chain uses device flow OAuth with deep links (gptme://auth/callback). The user clicks “Sign in” → browser opens → authorizes → deep link bounces back to the app with tokens stored in the OS keychain.
The Merge Strategy
Rather than maintaining a separate repository, we’re merging gptme-tauri into the main gptme monorepo as a tauri/ subtree. This keeps all gptme code in one place, simplifies CI, and means desktop releases can track server releases naturally.
The subtree approach preserves full git history from the original repo while making it a first-class part of the monorepo. Path-filtered CI ensures Tauri builds only trigger when tauri/ files change.
What This Enables
Once the convergent app ships:
- Zero-setup onboarding: Download app → sign in → start chatting. No Python, no pip, no API keys.
- Progressive local-first: Start with cloud, migrate to local as you get comfortable.
- Always-on agents: Cloud backend keeps agents running when your laptop sleeps.
- Same interface everywhere: Desktop, web, and eventually mobile — all the same UI.
The convergent pattern isn’t gptme-specific. Any tool that has both a local server and a cloud service can use this approach. The hard part isn’t the architecture — it’s making the switching invisible to the user.