unsloth/studio/backend/routes
Daniel Han dbb0292561 Studio diffusion (Phase 2C): NVFP4 text-encoder quant (+ generalise fp8 knob)
Generalise the text-encoder precision knob from a fp8 bool to text_encoder_quant
(fp8 | nvfp4). nvfp4 quantises the companion text encoder to 4-bit via torchao
NVFP4 weight-only (two-level microscaling) on Blackwell's FP4 tensor cores; fp8
stays the broader-hardware path (cc>=8.9). Both are gated, best-effort, and run
before placement; status reports the mode actually engaged. This is the lean
realisation of GGUF-native text-encoder quant: 4-bit on the encoder without the
3045-line port.

Verified on Z-Image (B200, balanced/group where the encoder stays resident), vs the
bf16 encoder: nvfp4 cut generation peak VRAM 48% (10840 -> 5593 MB, the lowest TE
option, below whole-model offload) at near-fp8 quality (16.4 vs 17.1 dB PSNR), and
both quants ran faster than bf16. A memory-vs-quality tradeoff (off by default);
size it per model with the Phase 5 quality harness. diffusion_bench gains
--text-encoder-quant.

129 CPU tests pass.
2026-06-25 14:42:54 +00:00
..
data_recipe Studio: improve OpenAI- and Anthropic-compatible API spec compliance (#6010) 2026-06-09 17:13:25 +02:00
.gitkeep root studio folder 2026-02-02 09:13:49 +00:00
__init__.py Studio: clean-room compact RAG (knowledge bases, hybrid search, fast indexing) (#5910) 2026-06-09 21:17:04 -07:00
auth.py CLI: stop unsloth connect from leaking Studio credentials to unverified servers (#6479) 2026-06-21 21:28:38 -07:00
chat_history.py feat: implement thread forking functionality with associated database… (#5810) 2026-06-15 14:57:39 +01:00
datasets.py Studio: training survives a non-writable HF datasets cache (#6148) 2026-06-10 08:22:47 -07:00
export.py Studio: persistent per-user trust_remote_code approval cache (#6551) 2026-06-22 05:12:49 -07:00
inference.py Studio diffusion (Phase 2C): NVFP4 text-encoder quant (+ generalise fp8 knob) 2026-06-25 14:42:54 +00:00
llama.py Studio: fix llama.cpp update toast tag and reload hint (#6493) 2026-06-21 05:40:49 -07:00
mcp_servers.py fix validation error for stdio mcp (#6341) 2026-06-15 19:26:41 +01:00
models.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-25 03:21:55 +00:00
preview.py Studio: shareable per-checkpoint preview links (#6486) 2026-06-24 06:31:53 -07:00
prompts.py Studio: clean-room compact RAG (knowledge bases, hybrid search, fast indexing) (#5910) 2026-06-09 21:17:04 -07:00
providers.py Studio: Add custom provider option to Connections (#6112) 2026-06-12 13:09:35 +02:00
rag.py Studio: project sources backed by RAG (#6205) 2026-06-12 15:42:51 +02:00
settings.py studio: persist personalization (profile, avatar, theme) server-side (#6516) 2026-06-22 04:09:48 -07:00
training.py Add Hugging Face dataset streaming mode to Studio (#4946) 2026-06-22 17:48:18 +03:00
training_history.py Studio: shareable per-checkpoint preview links (#6486) 2026-06-24 06:31:53 -07:00
training_vram.py Studio: free chat model VRAM at training start only when the GPU is tight (#6243) 2026-06-18 09:04:01 -07:00