Open source · agent-friendly · portable content

Build your own learning platform with agents.

Latent is an opinionated open-source framework for courses, browser IDE lessons, flash cards, and programming practice. Use the LLM systems curriculum as a complete reference implementation, or start with portable lessons and cards you can host anywhere.

The reference implementation goes deep.

A paper can explain one mechanism clearly while leaving the surrounding system implicit. These lessons begin with recurrence, tokenization, attention, and causal masking, then continue into prefill and decoding, KV-cache accounting, continuous batching, SSE framing, cancellation, retries, and conversation state. Each example is small enough to inspect and run in a browser.

Browser-native LLM systemOne request · three movements

Text moves left to right. The lower rail shows state that is loaded, reused, or persisted rather than streamed with each token.

  1. 01Model

    Text becomes tokens, then model state.

  2. 02Runtime

    Prefill, cache, scheduling, and decode.

  3. 03Product

    Events become a responsive conversation.

Follow the generation request, step by step8 stages · 4 boundaries
  1. Browser input
  2. Inference runtime
  3. Streaming transport
  4. Application
  1. Browser inputPrompt + messagesUTF-8 text
  2. Browser inputTokenizertext → token IDs
  3. Inference runtimeScheduleradmit · batch · cancel
  4. Inference runtimePrefillprompt → K,V
  5. Inference runtimeDecode looplogits → next token
  6. Streaming transportSSE streamtyped token events
  7. ApplicationReact reducerevents → chat state
  8. ApplicationBrowser Chatrendered response
Model weightsused by prefill + decode
KV cacheK,V reused at every decode step
Project artifactslesson files · tests · BrowserChat.tsx
Browser persistenceIndexedDB drafts · checkpoints

The implementation accumulates.

Each lesson adds a tested file to the same project. The tests isolate the idea under study; the capstone connects browser versions of those pieces into a local chatbot. This is not a production-scale model or serving stack. It is a compact implementation for studying where the boundaries are and how data moves across them.

See how the five course files come together
browser-chat/models/character-rnn.pysystems/inference-runtime.pybackend/streaming-transport.pyproduct/chat-reducer.pycapstone/BrowserChat.tsx
Loading saved text