Instructions to use researchase/rs-blender-build-smollm2-360m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use researchase/rs-blender-build-smollm2-360m with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'researchase/rs-blender-build-smollm2-360m');
RS Blender Quick build (SmolLM2-360M)
The model behind Quick build in Make It in Blender, Reasoning School's Blender course, which runs real Blender in the browser. A student types something to build, such as "a wall 4 m long with a door" or "5 crates in a row", and this model, running in the student's browser, writes a short build description. The course page's compiler turns that into Blender Python, which the course's Violet add-on runs in the student's Blender as one undo step. What the student types never leaves their device; the browser only downloads this model, once.
It is a full fine-tune of SmolLM2-360M-Instruct. Its sibling for RS Workshop's CAD app is researchase/rs-quickbuild-smollm2-360m.
What it does
It reads the request and copies out the thing and the sizes that were said (metres unless another unit is given). It doesn't compute geometry, which the course's compiler does:
request: a pillar 3 m tall and 40 cm wide
answer: {"shape":"pillar","height":3,"diameter":"40 cm"}
request: a red crate, 5 of them in a row
answer: {"shape":"crate","color":"red","count":5}
request: how do i bevel
answer: {"shape":"unknown"} β the course offers Violet, its tutor
Things: cube, box, floor, ball, cylinder/pillar/wheel, cone/pyramid, ring, crate, barrel, table/desk, chair, stool,
stairs, wall (doorway, windows), fence, shelf, lamp, tree, ladder, robot, 3D text, door, arch, ramp, platform. Any of
them can have a colour or come as rows and grids. Anything else is unknown: questions, edits ("make it taller"),
other objects, and supported things with a feature it can't make ("a chair with a cushion").
Files
| file | use |
|---|---|
onnx/model_q4.onnx (275 MB) |
the browser model: MatMuls 4-bit (MatMulNBits, block 32), word table int8 with a scale per word, the rest fp32. transformers.js, dtype: "q4" |
model.safetensors (bf16) |
the fine-tuned weights, for transformers in Python |
quickbuild.json |
the system prompt it was trained with, and the training settings |
Use
transformers.js (browser):
import { AutoTokenizer, AutoModelForCausalLM } from "@huggingface/transformers";
const id = "researchase/rs-blender-build-smollm2-360m";
const tok = await AutoTokenizer.from_pretrained(id);
const model = await AutoModelForCausalLM.from_pretrained(id, { dtype: "q4", device: "webgpu" });
const system = "You turn a request for something to build in Blender into a build description in JSON. Write only the JSON.";
const prompt = `<|im_start|>system\n${system}<|im_end|>\n<|im_start|>user\na wooden table 2 m long<|im_end|>\n<|im_start|>assistant\n`;
const inputs = tok(prompt, { add_special_tokens: false });
const out = await model.generate({ ...inputs, max_new_tokens: 110, do_sample: false });
console.log(tok.batch_decode(out.slice(null, [inputs.input_ids.dims[1], null]), { skip_special_tokens: true })[0]);
Use the prompt exactly as above (ChatML, this system prompt, greedy decoding).
Training
About 52,000 synthetic request β description pairs from a generator. Each request is written many ways: units (none =
metres, m, cm, inches, feet, one size in another unit), sizes before or after the noun, compact sizes (2x1x0.5),
number and fraction words, colours, rows and grids, capitals and typos. It also writes "not a build" requests. Every
description was checked by compiling it, and pairs the compiler refused were dropped. The compiler's Python was tested
in Blender 5.1: every thing builds, as closed meshes, at the requested size, with origins at the base. Training: 2
epochs, AdamW, lr 1e-4 cosine, batch 64, on one RTX 3090.
Evaluation
Scored by what gets built: right means the compiler writes the same Blender Python from the answer as from the expected description.
| test set | requests | same build | right kind of thing |
|---|---|---|---|
| blind, written before this model was trained, run once | 30 | 90.0 % | 96.7 % |
| hand-written set (used to find gaps in v1) | 50 | 98.0 % | 100 % |
| synthetic validation | 400 | 98.8 % (exact JSON) |
Every answer was valid JSON. Known slips (from the blind set): in "4 m by 20 cm by 20 cm" the last size can lose its unit (a 20 m box, which the student sees in the preview before Build); "a marble 2 cm" was taken as not-a-build; a "hexagon pillar" comes out round. The 4-bit browser model's export used the same pipeline as the RS Workshop model, whose browser answers matched the full model.
Limits
It is made for the course's build descriptions and its compiler, in English, for students aged about 11 and up. It is not a general assistant. Its answers are descriptions to be checked and built by code, never code to run.
- Downloads last month
- 643
Model tree for researchase/rs-blender-build-smollm2-360m
Base model
HuggingFaceTB/SmolLM2-360M