THE PRACTICAL GUIDE / V1.0
Start with a question.
Keep going in code.
Try the demo, run the released weights on your CPU, or trace the whole transformer in Pebble. Here's how to get started—and what to expect.
Download the complete Markdown guide ↓01 / FIRST PREDICTION
Use the playground.
Begin with What is Pebble?,
What is attention?, Explain tensors. or
Explain functions..
- Enter a short question using 1–160 ASCII characters.
- Keep temperature at 0 for greedy generation with seed 2026.
- Select Generate answer. CPU inference may take a few seconds.
- Read the result, compare it with the recorded examples, and use Copy output if you want to keep it.
The web demo generates up to 96 character tokens and may stop earlier at EOS. Higher temperature, up to 1, adds randomness; it doesn't increase accuracy. Inference runs on the server using the released checkpoint, not on your device.
Open Reproducible sampling settings to choose a whole-number seed from 0 to 2147483647 and an output limit from 16 to 96 characters. Identical prompt, temperature, seed and output limit reproduce a sample. The cancel button cancels your browser request; the server may finish work already started. Your last three successful experiments stay in page memory only.
Compare “What is attention?” with “How does attention work?” The example explorer shows recorded generations; its “Try this question live” button fills the playground. Select Generate to run a fresh prediction.
02 / SET EXPECTATIONS
A small model.
A specific task.
PebbleLM learns short answers from a forty-topic synthetic curriculum. It isn't trained for general chat, reliable coding advice, new knowledge or conversation memory.
Topics and target answers overlap across splits. The results test phrasing, not broad intelligence. Fluent output can still describe the wrong topic.
- 101-token vocabulary: printable ASCII, newline, tab and four special tokens. The web demo rejects non-ASCII; the CLI maps unsupported characters to UNK.
- 299-position context: character tokens, not words. This does not imply long-context capability.
- No retrieval or tools: there is no search, chat history or instruction hierarchy.
03 / YOUR MACHINE, YOUR WEIGHTS
Run it on your CPU.
Install Node 24, Git and npm. You don't need a GPU, Python trainer, external model provider or API key.
git clone https://github.com/YashAnand69/pebble-llm.git
cd pebble-llm
npm ci
npm run verify:artifacts
npm run inspect
npm run generate -- --prompt "What is Pebble?" --temperature 0 --max-tokens 96 --seed 2026
inspect confirms two million parameters and the WASM
backend. verify:artifacts checks the released file
hashes. The checkpoint is approximately 8 MB; runtime memory also
includes tensor buffers, activations and the interpreter.
Explore sampling
npm run generate -- --prompt "What is attention?" --temperature 0.5 --top-k 10 --max-tokens 96
The CLI also supports --checkpoint and
--seed. Its --max-tokens range is
1–1000. It loads checkpoints/best.pebble-weights by
default. A longer output limit does not fix model quality.
Run the website locally
npm run build
npx vercel link
npx vercel dev
Choose your Vercel project when linking. Serving
public/ alone previews the page but does not run
inference. Vercel account access is needed for this workflow; no
application environment variables are required.
04 / A SMALL JSON INTERFACE
Call the demo API.
Send a POST request from your terminal or server-side code. No model API key is needed.
curl https://pebble-llm.vercel.app/api/generate \
-H 'Content-Type: application/json' \
--data '{"prompt":"What is Pebble?","temperature":0,"seed":2026,"maxNewTokens":96}'
| Field | Value |
|---|---|
prompt |
Required string; 1–160 ASCII characters |
temperature |
Optional number from 0 to 1; defaults to 0 |
seed |
Optional integer from 0 to 2147483647; defaults to 2026 |
maxNewTokens |
Optional integer from 16 to 96; defaults to 96 |
A successful response includes answer,
parameters (2000000), elapsedMs and the
actual seed, temperature and
maxNewTokens. Elapsed time measures the model run and
varies by question and server conditions.
Node 24 / server-side JavaScript
const response = await fetch(
'https://pebble-llm.vercel.app/api/generate', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'What is Pebble?', temperature: 0,
seed: 2026, maxNewTokens: 96
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result.answer);
Use the full URL from server-side code. Same-origin browser code
can use /api/generate; cross-origin browser requests
are not supported by the API's CORS policy.
Invalid input returns 400. Unsupported methods
return 405 with Allow: POST. Failed
inference returns a generic 500. Platform
timeouts may return non-JSON responses, so handle those in real
integrations.
The output is capped at 96 character tokens and responses aren't cached. For an independent application, run your own copy and choose appropriate traffic controls.
05 / READ, CHANGE, REPEAT
Retrain and evaluate.
Start with model.pebble, tokenizer.pebble and sampling.pebble. The architecture uses four decoder blocks, four heads, width 200, causal attention, pre-LayerNorm and tied embeddings.
Training overwrites local checkpoints and reports. Release hashes will no longer match afterward. Checkpoints contain weights and metadata, not optimizer moments for seamless resume.
npm test
npm run prepare:data
npm run train -- --steps 2000 --batch 2 --length 299 --seed 2026 --lr 0.001 --report-every 100
npm run refine -- --steps 1000 --batch 4 --seed 2027 --lr 0.0005 --report-every 100
npm run evaluate
npm run evaluate:canonical
Validation selects the checkpoint; keep reserved prompts out of training and selection. The published main run took 43.27 minutes and refinement took 12.16 minutes on an Apple M5 Pro. Your machine may differ.
Read the full training protocol ↗06 / WHEN SOMETHING LOOKS WRONG
Troubleshooting.
The model gives a wrong or garbled answer
Use a canonical “What is ...?” question and temperature 0. Unknown topics and unfamiliar phrasings can fail. This may be a model limitation rather than an API error.
My question is rejected
Use 1–160 ASCII characters in the web demo. Remove emoji and unsupported characters; don't send an empty question. API temperature must be a number between 0 and 1.
Inference times out or is unavailable
Retry once with a shorter question. API clients should check HTTP status and handle non-JSON errors from the hosting platform.
Local setup fails
Use Node 24 and run npm ci from the repository root. Verify the checkpoint is present and the released artifacts pass npm run verify:artifacts.
Artifact verification reports a mismatch
Restore official artifacts from Git before deploying, or publish a newly evaluated release with its own provenance. Don't disable the verification gate.
Code, original data and released weights are MIT licensed. TensorFlow.js/WASM dependencies retain their Apache-2.0 licenses.