SmolLM2-135M-Strudel-ONNX

A fine-tune of HuggingFaceTB/SmolLM2-135M-Instruct that generates Strudel live-coding patterns from a natural-language description. Exported to ONNX (int8, ~130 MB) for in-browser inference via transformers.js (WASM) β€” no server, no GPU.

Intended use

Generate Strudel code from a description, entirely in the browser:

import { pipeline } from "@huggingface/transformers";

const generator = await pipeline(
  "text-generation",
  "rish-0-0/SmolLM2-135M-Strudel-ONNX",
  { dtype: "q8", device: "wasm" }
);

const out = await generator(
  [
    { role: "system", content: "You are a Strudel live-coding assistant. Output only raw Strudel code." },
    { role: "user", content: "Write Strudel code for: a chill lofi beat with vinyl crackle" },
  ],
  { max_new_tokens: 512, do_sample: true, temperature: 0.8 }
);
console.log(out[0].generated_text.at(-1).content);

Training details

  • Base: SmolLM2-135M-Instruct (ChatML template, EOS = <|im_end|>).
  • Method: full fine-tune (not LoRA) with trl.SFTTrainer, conversational prompt-completion format, completion-only loss.
  • Hyperparameters: 3 epochs, lr 3e-4 cosine, warmup 0.1, max_length 4096, batch 8 Γ— 2 grad-accum.
  • Data: 402 Strudel snippets. Each was written by a Claude (Sonnet-5) agent, self-validated headlessly (compiled + ran via @strudel/web), and judged by a second Claude call (score β‰₯ 8 to be accepted). A diversity guard rejected near-duplicate labels and capped per-genre counts.

Evaluation

Quality scored by GLM-5.2 (Z.AI) averaged over 5 fixed prompts (1–10), same seed. Cumulative-from-base training:

Samples Score
60 3.0
120 4.8
240 5.8
402 6.6 β€” peak (this checkpoint)
705 5.6 (regressed β†’ stopped)

At 402 samples all generations compile as valid Strudel; the judge's critiques are about musical nuance, not syntax. More data (705) regressed β€” likely overfitting at 3 epochs.

Files

  • onnx/model_quantized.onnx β€” int8 quantized (~130 MB), selected via dtype: "q8".
  • config.json, generation_config.json, tokenizer.json, tokenizer_config.json, chat_template.jinja.

License

AGPL-3.0 β€” the downstream app uses @strudel/repl (AGPL-3.0) as a combined work. Base model SmolLM2 is Apache-2.0.

Source

Training pipeline + browser frontend: github.com/rish-0-0/agent-strudel

Downloads last month
37
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for rish-0-0/SmolLM2-135M-Strudel-ONNX

Quantized
(115)
this model