text-generation · Base Pretrained LlamaForCausalLM (360M · 4T tokens) · q8 · WASM · 366.64 MB · Apache-2.0
SmolLM2-360M (Base Continuation Model)
Hugging Face's SmolLM2-360M
(HuggingFaceTB/SmolLM2-360M,
exported to onnx-community/SmolLM2-360M-ONNX,
366.64 MB q8 ONNX) is the base pretrained continuation model
trained on 4T tokens of FineWeb-Edu, DCLM, The Stack, and math — distinct from SFT/DPO-tuned
SmolLM2-360M-Instruct and
SmolLM2-135M-Instruct. It excels at document, code, log, and
few-shot template completion 100% locally in CPU WebAssembly.
1 · On-device model (366.64 MB q8 WASM · 363.12 MB weights + 3.53 MB tokenizer & configs)
2 · Live Base Continuation Studio
Pick a base-LM preset (encyclopedic prose, Python stub, 2-shot JSON extraction, structured logs, or raw chat
trap), type your own prefix, or drop/upload a .txt, .md, .json, or
.csv file.
.txt, .md, .json, or .csv prefix file here,
paste via Ctrl/Cmd+V, or choose a local file:
Live Streaming Continuation
Waiting for runPrepare SmolLM2-360M above to stream base-model continuations in CPU WebAssembly.
3 · See Inside: Next-Token Logits, Perplexity & GPT2-BPE Subwords
One real forward pass (pipe.model(enc)) over your prefix yields raw logits across all
49,152 vocabulary entries. Inspect the exact softmax probability bars, Shannon entropy
(bits), perplexity (exp(H)), and byte-level GPT2-BPE subwords (Ġ space /
Ċ newline markers).
Top-12 Next-Token Candidates
—GPT2-BPE Prompt Subwords (49,152 vocab)
—Waiting for first on-device run.
4 · At a Glance, Base vs Instruct, Code & Use-Case Ladder
| Upstream model |
HuggingFaceTB/SmolLM2-360M
(4T pretraining tokens: FineWeb-Edu, DCLM, The Stack, Math; HellaSwag 54.5, ARC 53.0, PIQA 71.7)
|
|---|---|
| Browser ONNX repo |
onnx-community/SmolLM2-360M-ONNX
(onnx/model_quantized.onnx 363.12 MB + tokenizer.json 3.52 MB + configs = 366.64 MB q8)
|
| Pipeline task & runtime | text-generation · @huggingface/transformers@3.7.5 (shared pin in lib/webai.js) · CPU WASM |
| Architecture | LlamaForCausalLM (32 layers, hidden_size=960, intermediate_size=2560, 15 Q / 5 KV GQA heads, head_dim=64, max_position_embeddings=8192, vocab_size=49152) |
| Special tokens | bos=<|endoftext|> (0), eos=<|endoftext|> (0), GPT2Tokenizer byte-level BPE (no active SFT chat template) |
| License | Apache-2.0 (HuggingFaceTB) |
Show the code — Off-main-thread LlamaForCausalLM base continuation, TextStreamer & NaN telemetry
Show the code — Exact 49,152-vocab softmax, Shannon entropy (bits) & perplexity calculation
Explore the 5-Route SmolLM2-360M Base Use-Case Ladder
Compare Greedy vs Focused vs Creative sampling and ablate bare chat asks against 3-shot delimiter prefixes.
Practical · Batch Extraction & StubsRun FIFO few-shot JSON extraction, code stub completion, and ticket tagging over custom files with mid-batch Cancel.
Wild · Degenerate Loops & Failure LabTrigger repetition_penalty=1.0 loop collapse, extreme temperature entropy shifts, instruction leakage, and anchor rescue.
Multi-model · Base LM × DeBERTa VerifierChain SmolLM2-360M Base (366.64 MB) with DeBERTa-v3-XSmall NLI (95.9 MB) to verify domain adherence and catch loops.