Instructions to use Azimml/SmolLM2-135M-trellis-3bit-webgpu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Azimml/SmolLM2-135M-trellis-3bit-webgpu with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Azimml/SmolLM2-135M-trellis-3bit-webgpu", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 2,339 Bytes
a8987e0 fc03ed8 a8987e0 fc03ed8 a8987e0 fc03ed8 a8987e0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | ---
license: apache-2.0
base_model: HuggingFaceTB/SmolLM2-135M
tags:
- quantization
- trellis-coded-quantization
- qtip
- webgpu
- 3-bit
- on-device
library_name: transformers
---
# SmolLM2-135M — 3-bit trellis-quantized for WebGPU
A **3-bit trellis-coded quantization (TCQ)** of [SmolLM2-135M](https://huggingface.co/HuggingFaceTB/SmolLM2-135M),
packed to run its **full forward pass in a web browser on WebGPU** — no CUDA, no server.
This is part of **[Trellis WebGPU](https://github.com/Azimml/trellis-webgpu)** —
the first trellis-coded quantization decoder (the QTIP / EXL3 quality tier) to run
outside CUDA. See the repo for the quantizer, the WGSL kernels, and the full
verification harness.
## Quality (WikiText-2 perplexity, no fine-tuning)
| | fp16 | **TCQ 3-bit (this model)** | vs fp16 |
|---|---|---|---|
| SmolLM2-135M | 15.61 | **17.58** | 1.13× |
Trellis-coded quantization is the current quality frontier for low-bit LLM weights,
beating scalar quantization (GPTQ / AWQ / GGUF) at equal bitrate. The K=2 quantizer in
this project reproduces the QTIP paper's published rate–distortion (MSE 0.0739 vs 0.0733).
## This packed model
- **30 layers**, packed to **~3 bits/weight** (154 MB on disk).
- runs in a browser on **any WebGPU GPU**.
- Verified: the full model runs through the exact shipping WGSL shaders and generates
coherent, factually-correct text; kernels match NumPy to `<1e-6`; 135M logits are
top-5 exact vs PyTorch.
## Format
This is **not** a standard `transformers` checkpoint. It is a packed 3-bit format
(`manifest.json` + sharded `.bin` weights + IP metadata) designed for the WebGPU runtime
in the [Trellis WebGPU](https://github.com/Azimml/trellis-webgpu) repo. To run it:
```bash
git clone https://github.com/Azimml/trellis-webgpu
# place these files under web/model_packed/ , then:
cd web && python3 -m http.server 8000 # open index.html in a WebGPU browser
# or verify headlessly on your GPU:
python scripts/run_packed_headless.py web/model_packed "The capital of France is" 40
```
## License & credit
Quantized derivative of [SmolLM2-135M](https://huggingface.co/HuggingFaceTB/SmolLM2-135M) (Apache-2.0),
distributed under the base model's license. Method: QTIP (Tseng et al., NeurIPS 2024)
and EXL3 (turboderp). Quantization + WebGPU port: independent reimplementation.
|