mabbikeel/knexforge-smollm2-135m-onnx
Fine-tuned SmolLM2-135M-Instruct (135M parameters, LoRA r=16, alpha=32 merged) for K'NexForge Text-to-Build 3D generation in the browser via WebGPU and WASM (@huggingface/transformers v3).
Given a natural-language build description, this model outputs compact K'Nex topological shorthand (wc8_1.N -- br_1.end1, @ 90 3D twist angles, ~~ revolute motor/wheel axles) which K'NexForge's deterministic 3D forward-kinematics solver converts into interactive 3D builds and Rapier.js physics simulations.
Benchmark Results (60 Held-Out Test Prompts)
- Validation Perplexity:
1.014(valid_loss = 0.0137) - Unconstrained Physical Validity:
96.67%(58 / 60) - 3D Kinematic Grammar-Constrained Validity:
100.00%(60 / 60) - Semantic Prompt Match:
100.00%(60 / 60)
Available ONNX Precisions (onnx/)
dtype |
File | Size | Target Runtime |
|---|---|---|---|
q4f16 |
onnx/model_q4f16.onnx |
~128 MB | WebGPU (shader-f16 supported) |
q8 |
onnx/model_quantized.onnx |
~130 MB | Multi-threaded WASM CPU |
q4 |
onnx/model_q4.onnx |
~189 MB | WebGPU (universal FP32 IO) / WASM |
fp16 |
onnx/model_fp16.onnx |
~277 MB | Lossless half-precision WebGPU |
Browser Usage (@huggingface/transformers)
import { AutoModelForCausalLM, AutoTokenizer } from '@huggingface/transformers'
const modelId = 'mabbikeel/knexforge-smollm2-135m-onnx'
const tokenizer = await AutoTokenizer.from_pretrained(modelId)
const model = await AutoModelForCausalLM.from_pretrained(modelId, {
device: 'webgpu',
dtype: 'q4f16',
})