DEV Community

Ewansalan Dkhar
Ewansalan Dkhar

Posted on

A Sub-Millisecond In-Game HUD Powered by Local SLMs

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission πŸ’Έ

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

🧭 Wayfinder: Building a Zero-Lag, Local-First In-Game Companion HUD with Tauri v2, SQLite BM25, and Local SLMs

What I Built

Wayfinder is a sub-millisecond, local-first in-game companion HUD built for action RPGs and Soulslike titles (Sekiro: Shadows Die Twice, Elden Ring, Lies of P, Black Myth: Wukong).

With a single hotkey press (Alt + G), Wayfinder summons a frameless, transparent glassmorphic overlay directly above your game. Using a local SQLite FTS5 BM25 retrieval engine and local open-weight Small Language Models (SLMs) running on your own GPU via Ollama, it synthesizes an authoritative 3-bullet tactical cheat sheet in under a second:

  1. Telegraph & Counter: Critical perilous attacks and how to deflect/dodge them.
  2. Key Vulnerability: Effective elemental weaknesses, items, or prosthetic tools.
  3. Phase Shifts: Exact cues and positioning adjustments across battle phases.
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Wayfinder HUD                          β”‚
β”‚        (Tauri v2 + Vanilla TypeScript + Glassmorphism)      β”‚
β”‚  - Summon: Alt + G Hotkey     - Focus Hand-off: Escape      β”‚
β”‚  - Multi-Game Switcher        - Dynamic SLM Model Picker    β”‚
β”‚  - Drag-and-Drop Ingestion    - 0.08ms DOM Mutation Budget  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚ HTTP / JSON (127.0.0.1:8765)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Wayfinder Micro-Daemon                     β”‚
β”‚               (FastAPI + SQLite WAL Engine)                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   SQLite FTS5 + BM25      β”‚ β”‚     Distillation Engine  β”‚ β”‚
β”‚  β”‚  - Sub-ms exact retrieval β”‚ β”‚  - Local Ollama SLM API  β”‚ β”‚
β”‚  β”‚  - Zero B-tree lock (WAL) β”‚ β”‚  - Dynamic Hot-Swapping  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚ Local IPC (127.0.0.1:11434)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Ollama Runtime                           β”‚
β”‚                 (qwen2.5:1.5b-instruct)                     β”‚
β”‚  - Local GPU/NPU inference with 0 cloud latency             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

The Problem It Solves

When facing brutal boss encounters, gamers currently face three painful tradeoffs:

  • Alt-Tabbing to YouTube / Wikis: Breaks combat flow, causes window focus lag, and forces you to scrub through 20-minute video intros while tabbed out.
  • Second-Monitor Wikis: Diverts eye tracking away from fast enemy attack telegraphs.
  • Heavy Overlays (Overwolf / Electron): Introduce frame pacing stutter (frame time spikes >16.6ms), inject bloated Chromium runtimes, and hog gigabytes of memory.

Wayfinder is engineered for absolute performance: ~3.2ms summon time, 0.42ms SQLite search, 0.08ms DOM mutation pacing, and a tiny ~42MB idle RAM footprint.

The Side Hustle Angle: Who Would Pay For It?

Gamers hate bloatware, but they gladly pay for competitive convenience, speed, and privacy:

  • Target Audience: Soulslike & ARPG players, speedrunners, content creators, and handheld gamers (e.g., Steam Deck users who cannot easily alt-tab).
  • The Business / Monetization Model:
    • Free & Open-Source Core: Full local HUD, local Ollama integration, manual markdown/URL ingestion, and zero tracking.
    • Pro / Subscription Tier ($4.99/mo or $39/year):
    • Cloud-Synced Community Guide Packs: One-click downloads of verified, high-tier boss strategies across newly released AAA titles without manual ingestion.
    • Multi-Device Sync: Cloud sync of game progress and boss notes between your desktop gaming rig and Steam Deck/ROG Ally.
    • Automated Video Guide Pipeline: Cloud-accelerated transcript & timestamp indexing for long-form video walkthroughs.

Demo


Code

Github: Wayfinder

The repository is organized into a clean, decoupled architecture:

  • desktop/: Tauri v2 desktop shell with a lightweight Vanilla TypeScript frontend (zero bulky frameworks, hand-tuned glassmorphic CSS).
  • core/: Python micro-daemon powering the SQLite FTS5 database, chunking engine, and Ollama integration.
  • scripts/build_sidecar.py: Automated zero-terminal PyInstaller pipeline embedding the Python daemon as a native sidecar binary inside the Tauri bundle.

How I Built It

1. Open-Source AI Stack

  • Open-Weight SLMs (Small Language Models): Defaulted to qwen2.5:1.5b and llama3.2:3b. These compact models deliver remarkable reasoning density while consuming as little as 1.2 GB of VRAM, leaving your GPU free to render demanding games.
  • Local Inference via Ollama: All inference runs over local HTTP IPC (127.0.0.1:11434) with zero telemetry, zero token bills, and zero cloud round-trip latency.
  • Dynamic Model Hot-Swapping: Wayfinder queries GET /api/tags from Ollama on boot to automatically populate the HUD header with every model installed on the host. Players can hot-swap models mid-game without touching a terminal.

2. High-Performance Retrieval Engine

Instead of high-overhead vector databases that demand hundreds of megabytes of RAM and heavy embeddings calculation on every boot, Wayfinder uses SQLite FTS5 with BM25 ranking:

  • Sub-millisecond exact keyword and token matching (0.42ms average query time).
  • WAL (Write-Ahead Logging) mode to prevent database locks during game sessions.
  • Multi-source ingestion that extracts and normalizes Markdown guides, Steam Community articles, and YouTube transcripts with automated chunking.

3. Tauri v2 Desktop & The PyInstaller Sidecar Pattern

To deliver a true consumer app that doesn't require users to know Python, Node, or terminal commands:

  • The Python micro-daemon is compiled into a self-contained binary via PyInstaller (wayfinder-daemon.spec).
  • Tauri manages the sidecar lifecycle: launching the daemon on app startup, communicating over a local loopback port, and cleanly killing background processes on exit.
  • A strict 0.08ms DOM mutation budget using pure Vanilla TypeScript ensures that rendering the HUD never interferes with GPU frame pacing in 144Hz gaming setups.

Why Does Open Innovation Matter?

In competitive gaming, timing is measured in frames (16.6ms at 60 FPS). Closed AI APIs (like proprietary cloud LLMs) are fundamentally unsuited for real-time in-game tools:

  1. Network Latency & Jitter: Cloud APIs introduce variable round-trips (400ms to 2000ms+). If your internet hiccups during a boss fight, a cloud HUD fails completely.
  2. Per-Token Metering & Unpredictable Costs: A gamer querying boss strategies fifty times an evening would rack up API subscription costs or hit rate limits. Local open-weight models have zero recurring token costs.
  3. Privacy & Offline Sovereignty: Your gaming habits, machine status, and custom guide documents stay 100% on your machine.
  4. Hardware Flexibility: Open innovation means players on a Steam Deck can run a 0.5B model, while players with an RTX 4090 can spin up an 8B DeepSeek reasoning modelβ€”without waiting for a cloud provider's permission.

Open-source AI made it possible to build a genuinely fast, offline utility that prioritizes player experience over cloud lock-in.


Built with ❀️ for gamers and performance purists. Stars and feedback are welcome on GitHub!

Top comments (0)