Bed Vibe AI Companion — Hybrid Local AI Desktop Runtime
Built and shipped a hybrid AI-companion app in Unity HDRP: a downloadable, installable desktop product run locally on the user's machine behind paid subscription access. Unity launches and supervises a fleet of local subprocesses — a Rust voice-activity gateway, a Whisper ASR server, a Rust local server, and a llama.cpp wrapper serving a custom GGUF model — with hardware-aware LLaMA build selection, CPU/GPU Whisper selection, TCP port health checks, and clean shutdown handling. At startup, the runtime profiles CPU capability, GPU availability, RAM, VRAM, model size, quantization, and context-window fit so it can select a reliable local Whisper and LLaMA/GGUF configuration for the machine. Authentication, MAC-address device licensing, and Stripe-webhook subscriptions run on backend services I operate. Speech-provider credentials remain server-side: the Unity client sends only the bounded synthesis request, while the backend performs the authenticated provider call and returns generated audio plus lip-sync timing data. The real-time conversation loop is microphone → Rust VAD → Whisper → local LLaMA/GGUF → AWS Polly TTS → FFmpeg conversion → OVRLipSync lip-synced avatar playback, bridged over local HTTP/TCP IPC with mute/unmute coordination so the character does not transcribe its own generated voice. Each LLM request is assembled from the character backstory, personality rules, selected model settings, the user profile, relevant prior conversation history, and the newly transcribed utterance. The character is autonomous and conversation-aware through a hand-built locomotion/idle state machine, spoken-cue behavior, talking-gated eye contact, Animation-Rigging head look-at, and a cinematic physical-camera rig. Users configure the AI's name, backstory, personality, temperature, and token limit per profile, inside a production shell with SHA-256/HTTPS login, file-integrity anti-tamper checks, server-synced gold economy, in-app store, and chat-history export.
Behavior, World & Product Layer
Beyond the speech pipeline, I built the companion as a persistent interactive character inside a real-time environment. A behavior state machine controls first-contact greeting, engagement, idle activity, movement, sitting, sleeping, spoken-cue reactions, and talking-gated attention. On first greeting or when the user calls her, the character turns toward the user, establishes eye contact, performs a wave animation, and presents a positive engagement response before entering the normal conversation loop. When the user is inactive, the character can transition through autonomous behaviors rather than remaining frozen: after idle time she may move through the room, sit on the couch, and later sleep according to the environment state.
The environment includes time-based presentation such as changing daylight outside the room, while the avatar uses camera-aware eye contact, animation-rigging head tracking, locomotion, idle animations, and cinematic camera behavior to create a continuous social presence. The product layer also includes a server-synced in-app gold economy, shop and unlock flow, room and furniture customization, character/personality configuration, selectable voice and language options, and user-facing personalization such as placing a user photo inside the virtual space. The goal was not only to make an LLM answer, but to combine AI conversation, avatar behavior, environment state, customization, and product systems into one interactive desktop experience.
What I built
Hybrid local-AI desktop product
Shipped subscription app
Unity HDRP runtime
Unity-orchestrated subprocesses
Hardware-aware LLaMA build selection
CPU/GPU Whisper server selection
Rust voice-activity gateway
Mic → Whisper → LLaMA → TTS loop
HTTP/TCP IPC bridge
Mute/unmute feedback control
TCP port health checks
Clean subprocess shutdown
OVRLipSync lip sync
FFmpeg audio conversion
Autonomous behavior state machine
Talking-gated eye contact
Cinematic camera rig
AI personality/backstory config
Stripe-webhook billing
MAC-ID device licensing
File-integrity anti-tamper
Gold economy + store
Chat-history export
Stack
Unity HDRP
C#
Rust
llama.cpp / GGUF
Whisper ASR
AWS Polly
FFmpeg
OVRLipSync
Animation Rigging
Stripe
HTTP/TCP IPC
SHA-256