🥋 LM Dojo

Component gallery

Every interactive lesson component with its Storybook-style demo states. All data is simulated — no model connected yet.

<Duel />

Before running

The starting state: brief, editor, live token count, and the locked model lane.

Ask for the capital — cheaply

Get the model to answer “Canberra.” using as few prompt tokens as you can. Politeness is expensive.

21 prompt tokens (est.)
The model’s attempt — run yours first

After the learner runs (win)

A passing, cheaper attempt: one-sentence verdict, gap number, both receipts, quiet delta.

Ask for the capital — cheaply

Get the model to answer “Canberra.” using as few prompt tokens as you can. Politeness is expensive.

10 prompt tokens (est.)
The model’s attempt — run yours first

The reveal (open)

The teaching peak: the annotated optimal attempt, spans focusable, notes in a live region.

Ask for the capital — cheaply

Get the model to answer “Canberra.” using as few prompt tokens as you can. Politeness is expensive.

14 prompt tokens (est.)
The model’s attempt — run yours first

Checker failed (kindly)

The attempt missed the requirement; the receipt explains what, not just a red mark.

Ask for the capital — cheaply

Get the model to answer “Canberra.” using as few prompt tokens as you can. Politeness is expensive.

8 prompt tokens (est.)
The model’s attempt — run yours first

Cold-start — excluded

A cold-start receipt is flagged excluded; it doesn’t enter the ledger or the verdict.

Ask for the capital — cheaply

Get the model to answer “Canberra.” using as few prompt tokens as you can. Politeness is expensive.

10 prompt tokens (est.)
The model’s attempt — run yours first

Capability missing → replay

The connected model lacks a required capability, so the attempt runs from a replay fixture.

Ask for the capital — cheaply

Get the model to answer “Canberra.” using as few prompt tokens as you can. Politeness is expensive.

0 prompt tokens (est.)

This lesson needs capabilities the connected model lacks — running your attempt from a replay fixture.

The model’s attempt — run yours first

No model connected

Without a client the learner can write but not run; the state says so honestly.

Ask for the capital — cheaply

Get the model to answer “Canberra.” using as few prompt tokens as you can. Politeness is expensive.

0 prompt tokens (est.)

No model connected — connect one to run your attempt.

The model’s attempt — run yours first

<Duel · authored fixture />

Authored fixture — m1-l2 (revealed)

The real m1-l2 token-economics duel task, seeded to a completed attempt with the reveal open — the annotations are the fixture’s own.

Translate it — for the fewest tokens

Get the model to translate “The train is late.” into French. It must contain “retard”. Then do it again spending fewer tokens than the model’s optimal prompt.

23 prompt tokens (est.)
The model’s attempt — run yours first

<ReceiptHistory />

Converging history

Six duels trending from model-wins to learner-wins, with a baseline shift where the model was upgraded.

Your convergence

Token gap to the model, duel by duel. Below the line, you’re cheaper than the model.

evenmodel changed
you wintiemodel wins6 ×

Empty state

Before any duel — the empty state sells what the chart will become.

Your convergence

Token gap to the model, duel by duel. Below the line, you’re cheaper than the model.

No duels yet

Run your first duel and this chart starts drawing itself — one point per attempt, tracing how your gap to the model closes as you learn the mechanism.

<Receipt />

Plain usage receipt

The lightweight form Playground and ParamCompare show — tokens in/out only, no model or latency to report.

Usage:31 input · 8 output tokens

Duel receipt — pass

A full duel receipt: pass badge, verdict, reason, model + version, generation latency, expandable.

passYour attempt:14 input · 20 output tokensYou win by 12 tokensDetails
Model: llama3.1:8b @ ollama/0.3.14
Generation: 420 msFirst token 180 ms · Queue 0 ms
Cost: local free
All required patterns present; 12 fewer output tokens than the model.

Duel receipt — fail (kindly)

The checker did not pass; the reason explains what was missing, never just a red mark.

failYour attempt:9 input · 5 output tokensDetails
Model: llama3.1:8b @ ollama/0.3.14
Generation: 210 msFirst token 150 ms · Queue 0 ms
Cost: local free
Missing required phrase “step by step” — the answer was correct but skipped the reasoning the task asked for.

Cold-start — excluded

A cold-start receipt is visibly flagged and excluded from the ledger and the verdict (ADR-027).

Excluded from the ledger — cold start (its latency is the machine warming up, not the model working).
Model attempt:14 input · 18 output tokensDetails
Model: llama3.1:8b @ ollama/0.3.14
Generation: 380 msFirst token 4200 ms · Queue 0 ms
Cost: local free

With projected commercial cost

Local inference is free; a commercial figure appears only as a labeled projection beside it, never blended in.

Model attempt:512 input · 256 output tokensDetails
Model: gpt-4o-mini @ openai/2024-07-18
Generation: 900 msFirst token 320 ms · Queue 0 ms
Cost: local free · projected 0.0004 USD

<Playground />

Empty chat

Fresh playground with parameter controls, simulated replies.

Seeded conversation

Starts mid-conversation with a system prompt and a turn limit of 3.

System prompt: Du bist ein geduldiger Tutor für Sprachmodelle.
You
Was ist ein Token?
Assistant
Ein Token ist die kleinste Texteinheit, die ein Sprachmodell verarbeitet — oft ein Wortteil, manchmal ein ganzes Wort oder ein Satzzeichen.

Without parameter controls

Minimal chat surface for early lessons.

Usage receipt & live counter

Prefilled prompt, live token estimate while typing, usage receipt after each reply, exercise goal.

30 prompt tokens (est.)
🎯 Challenge
  • Rewrite the prompt to ≤ 15 tokens

💡 The counter under the input is your judge.

<TokenizerViz />

Empty

Starts blank — skeleton while the tokenizer loads, live count as you type.

tokens · 0 charactersLoading tokenizer…

English sentence

Editable text, ids visible, leading spaces shown as ␣ — the default lesson configuration.

tokens · 52 charactersLoading tokenizer…

Long German compound

A single German compound word shatters into sub-word tokens; compared against its English translation with the count delta.

tokens · 44 charactersLoading tokenizer…
Compared with: property transaction approval authority

💡 Same meaning, wildly different token counts.

Emoji

Emoji are encoded as UTF-8 byte pieces — one glyph can cost several tokens, and partial bytes render as �.

tokens · 43 charactersLoading tokenizer…

💡 The family emoji is several code points joined by invisible zero-width joiners — count them.

JSON payload

Structured data is token-dense: every bracket, quote and key costs tokens.

tokens · 73 charactersLoading tokenizer…

With evaluated goals

Goals are checked live against the input and latch once met; all met shows the pass state.

tokens · 0 charactersLoading tokenizer…
🎯 Challenge
  • One word ≥ 5 tokens
  • ≥ 20 characters ≤ 2 tokens

Pre-computed tokens

Renders tokens supplied by the lesson author — no tokenizer is loaded at all.

The␣quick␣brown␣fox
4 tokens · 19 characters

<ContextMeter />

Plenty of room

A short conversation in a 128k window.

5,370 of 128,000 tokens used4%
System prompt (850)Conversation (4,200)Your message (320)122,630 free

Nearly full

An 8k window at 92% — the warning state.

7,612 of 8,192 tokens used93%
System prompt (1,100)Conversation (5,400)Your message (600)Reserved for reply (512)580 free

Context nearly full — oldest history will be truncated soon.

Overflow

More tokens than the window holds — the error state.

5,700 of 4,096 tokens used139%
System prompt (900)Pasted document (4,800)0 free

Context window exceeded!

<ParamCompare />

Temperature spread

Same prompt at temperature 0, 0.8 and 1.5.

Prompt

Describe rain in one sentence.

Deterministictemp 0

Rain is water falling from clouds in drops.

Balancedtemp 0.8

Rain drums softly on rooftops, turning streets into mirrors.

Wildtemp 1.5

Rain: the sky rehearsing its silver piano across a city of umbrellas.

Prompt cost comparison

Per-variant prompts compared by usage receipt instead of output.

Chatty
Prompt: Hello! I hope you are having a wonderful day. Could you possibly tell me the capital of Australia? Thanks so much!

The capital of Australia is Canberra.

Usage:31 input · 8 output tokens
Direct
Prompt: Capital of Australia?

Canberra.

Usage:5 input · 3 output tokens

💡 Same question, same answer — compare the input tokens.

Two-way comparison

Two variants side by side, with top-p shown.

Prompt

Name a plausible startup idea.

Conservativetemp 0.2 · p 0.9

A scheduling tool for small dental practices.

Creativetemp 1.2 · p 1

Subscription greenhouses that text you when your tomatoes are lonely.

<ToolCallDemo />

Single tool call

The classic weather example: question → call → result → answer.

Available tools
get_weather()convert_units()
  1. User

    What is the weather in Hamburg?

Scripted walkthrough — a live model will drive this once tools are wired up.

Chained tool calls

Two dependent calls: fetch weather, then convert units.

Available tools
get_weather()convert_units()
  1. User

    Weather in Berlin, in Fahrenheit please.

  2. Assistant calls get_weather({"city":"Berlin"})
  3. get_weather returns: {"tempC": 22}
  4. Assistant calls convert_units({"value":22,"to":"F"})
  5. convert_units returns: {"value": 71.6}
  6. Assistant

    Berlin is currently at 71.6 °F (22 °C).

Scripted walkthrough — a live model will drive this once tools are wired up.

<Terminal />

Read-only transcript

Shows a finished session, e.g. an API call with curl.

Calling the gateway — transcript
learner@lm-dojo:~$ curl -s http://localhost:8787/v1/capabilities
["completion","streaming"]
learner@lm-dojo:~$ curl -s http://localhost:8787/health
{"ok":true,"service":"lm-dojo-gateway"}

Interactive with canned commands

Learner can type; a small command table answers. Try "tokens --count 'hello world'".

lm-dojo
LM Dojo Shell — "help" zeigt verfügbare Befehle / "help" lists commands
learner@lm-dojo:~$ 

<Quiz />

Token basics quiz

Two questions with explanations on every choice.

Question 1 of 2

What does a language model actually process?

Single question

The smallest possible quiz — one question inline in a lesson.

Question 1 of 1

Higher temperature means…