Skip to content

About

Educational app to interactively visualize how an LLM works

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

71 Commits

Folders and files

Repository files navigation

LLM Explorer

Interactive UI for exploring next-token probabilities from local GGUF models via llama-cpp-python. Visualize candidate tokens, their probabilities, and sampling controls.

Inspiration: https://www.youtube.com/watch?v=vrO8tZ0hHGk
Vibe-coded using OpenCode, Gemini 3 Pro, and MiniMax M2.1.

Screenshot

App Screenshot

Features

  • Next-token probability explorer with color-coded confidence
  • Starter texts dropdown + clear button
  • Auto-inference mode (weighted random selection with visual feedback)
  • Sampling controls: temperature, top-k, top-p, repetition penalty
  • Model manager for local GGUF files
  • Remote model browser and downloader (Hugging Face Hub)

Requirements

  • mise (installs Python 3.12, uv, Node.js, and pnpm from mise.toml)
  • Xcode command line tools (llama-cpp-python compiles llama.cpp with Metal during install)
  • macOS with Metal GPU offload supported
  • Disk space for GGUF models

Setup

mise install
mise run install

Run

mise run start

This command builds the frontend and starts the server. Open: http://127.0.0.1:8000

Develop

mise run dev

This command starts the API server with reload and the Vite dev server with hot reload. Open http://localhost:5317. Vite sends API requests to the server on port 8000.

Test and lint

mise run test
mise run lint

Default model downloads automatically on first run.

API

  • GET /health — Health check
  • POST /next-tokens — Get next token candidates
  • GET /models — List local models
  • GET /models/lookup?repo_id=... — Search Hugging Face
  • POST /models/download — Download model
  • POST /models/switch — Switch model

Structure

  • app/main.py — FastAPI app
  • app/llm.py — LLM engine
  • app/models_manager.py — Model handling
  • web/ — UI (React, TypeScript, Vite). FastAPI serves the build output from web/dist/.

MIT License.

About

Educational app to interactively visualize how an LLM works

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages