Satsuki Qwen3-0.6B
Fine-tuned Qwen/Qwen3-0.6B for browser-local generative UI in Satsuki.
This repository bundles the full checkpoint lineage needed both to run Satsuki directly in the browser on WebGPU and to reproduce or re-export the KL-distillation Quantization-Aware Training (QAT) pipeline:
- Root (
model.safetensors, ~1.2 GB) — Stage 1 SFT BF16 teacher trained fromQwen/Qwen3-0.6Bon AkaneTendo25/satsuki-dsl-v3. qat-bf16/(~1.2 GB) — Stage 2 KL-QAT BF16 weights (0.75 * KL(student || teacher_bf16) + 0.25 * CEwith exactblock_size=32asymmetricuint4STE) prior to ONNX packing, usable for custom re-exports (ONNX, GGUF, MLX, TensorRT).onnx/(~466 MiB) — Final WebGPU QAT INT4 export sharing a singlemodel_q4f16.onnx_dataweights binary across two lightweight ONNX graphs:model_q4f16.onnx— Standard-signatureadaptive-slicegraph compatible with@huggingface/transformersAutoModelForCausalLM.generate()andpackages/inference.model_hybrid_q4f16.onnx— Zero-copy hybridlm_headgraph (16,384base vocabulary + dynamic per-requestextra_vocab_ids) used automatically byshowcase/with clean fallback tomodel_q4f16.onnx.
Training & QAT Recipe
- Dataset: AkaneTendo25/satsuki-dsl-v3 (18,000 compiler-verified rows across structured creates, terse free-form prompts, ID-free edits, and unsupported/ambiguous refusals; 0% topology overlap with Holdout A).
- Stage 1 (SFT BF16 teacher): 1-epoch full fine-tuning (
lr=2e-5, cosine schedule,bf16) fromQwen/Qwen3-0.6B. - Stage 2 (KL-distillation STE QAT):
0.75 * KL(student || teacher_bf16) + 0.25 * CEover 12,000 stratified examples withblock_size=32asymmetricuint4fake quantization on 140 transformer linear layers andINT8on 56 sensitivemixed_layers+lm_head+embed_tokens. - WebGPU export:
onnxruntime-genai(-p int4 -e webgpu --extra_options use_webgpu_fp32=false is_symmetric=false matmul_mixed_precision=last_matmul:int8,mixed_layers:int8) withrope_theta=1000000, statickv_cache_dim=128, embedded Qwen3chat_template, and dual post-export ONNX graph patches (adaptive-sliceinmodel_q4f16.onnxand zero-copy hybridlm_headinmodel_hybrid_q4f16.onnx, zero extra weight bytes).
The model translates natural-language UI requests into satsuki-compact-plan/1:
- Initial UI creation across 11 primitives (
heading,text,input,select,toggle,slider,button,card,row,column,grid) - State-preserving, ID-free incremental edits (
set,unset,add,remove,move,replace) - Explicit
unsupported/ambiguousrefusals for out-of-catalog requests
Evaluation
| Suite | Result |
|---|---|
| Holdout A (800 cases, 0% topology overlap, BF16) | 96.25% exact match (100% compile valid) |
| Holdout B (22 natural OOD cases, BF16) | 86.36% exact match (10/10 ID-free edits) |
| Holdout C (16 terse free-form prompts, BF16) | 16/16 compile valid |
| Differential QAT INT4 ONNX vs BF16 (128 stress cases) | 127/128 compile valid (0 quantization regressions) |
Hybrid lm_head (model_hybrid_q4f16.onnx) vs full-vocab model_q4f16.onnx (306 cases: 128 stress + Holdout B/C/D + 100 Holdout A) | 0 validCompile / exactPass regressions |
Usage
Browser (Transformers.js / WebGPU)
from_pretrained loads onnx/model_q4f16.onnx by default for full generate() compatibility; showcase/ automatically selects onnx/model_hybrid_q4f16.onnx sharing onnx/model_q4f16.onnx_data and falls back cleanly if unavailable.
import { AutoModelForCausalLM, AutoTokenizer } from '@huggingface/transformers';
const modelId = 'AkaneTendo25/satsuki-qwen3-0.6b';
const tokenizer = await AutoTokenizer.from_pretrained(modelId);
const model = await AutoModelForCausalLM.from_pretrained(modelId, {
dtype: 'q4f16',
device: 'webgpu',
});
PyTorch / Transformers (BF16 Teacher or KL-QAT BF16)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "AkaneTendo25/satsuki-qwen3-0.6b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
# Stage 1 SFT BF16 teacher (root)
teacher = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
# Stage 2 KL-QAT BF16 checkpoint (subfolder)
qat_bf16 = AutoModelForCausalLM.from_pretrained(
model_id, subfolder="qat-bf16", torch_dtype=torch.bfloat16
)
License
Derived from Qwen/Qwen3-0.6B (Apache-2.0).
Satsuki will evolve. Stay tuned.