$ show PromptPasture/llama.ui
llama.ui is a browser-based chat interface for local and cloud LLM inference. It is not a data/research repository: it is a React 18 + TypeScript + Vite 7 single-page application packaged as a PWA with offline storage. The app connects to llama.cpp, LM Studio, Ollama, vLLM, and OpenAI-compatible cloud providers through a provider-factory abstraction, streams completions over SSE, and persists conversation history entirely client-side in IndexedDB via Dexie. Entry points are src/main.tsx and src/App.tsx, with routes for chat, settings, and welcome; state is managed through React Context stores (app, chat, inference, modal).
The LLM identified 4 files worth highlighting for reuse:
Parses Server-Sent Events from fetch ReadableStream responses into discrete delta events. It is framework-agnostic and isolated, making it reusable for any SSE-compatible HTTP streaming endpoint.
Registry that maps provider IDs to provider classes with caching and base configuration. Adding a new provider is a registration call rather than a growing switch/case, demonstrating a clean extensible multi-vendor API client pattern.
Limits callback execution to animation-frame cadence, preventing excessive React renders during high-frequency UI updates such as streaming token deltas. Generic enough to extract for any animation or real-time rendering workload.
Pure data-structure utilities for navigating a parent/children conversation tree, including current branch pointer and sibling message operations. This is a reusable pattern for any branched or versioned conversation model.