unsloth/studio/backend/routes
Daniel Han 362cacc448 Support LoRA adapters on torchao int8/fp8 quantized image pipelines
Adapters are baked at load time: they attach to the dense transformer,
then quantize_ converts only the frozen base linears (the lora_ side
path is excluded by name), then the loader compiles. Post-quant PEFT
injection is not possible on a manually quantized module, so the
prequant shortcut is skipped for a baked load and the memory plan is
sized for the dense build (force_dense on the quant candidate).

At generation time the baked topology is frozen: weight tweaks and
disabling (scale 0 reproduces the quantized base exactly) go through
set_adapters, while adding or removing adapters returns a clean 400
telling the client to reload with the new selection.

supports_lora now returns True for int8/fp8 diffusers loads (checked
before the gguf-kind early return, since the quant fast path keeps the
picker kind); nvfp4/mxfp8 and GGUF-via-diffusers stay blocked. The
load request model takes an optional loras list, threaded through
begin_load on both engines (native ignores it and keeps applying LoRA
at generation).

Verified end to end on GPU: Z-Image GGUF picker + int8 + trained
adapter loads through the API, bake marker logged, weight 1.0 vs 0
renders differ visibly, weight 0.5 accepted live, unknown adapter
rejected as 400. Affected suites: 296 passed.
2026-07-17 09:37:17 +00:00
..
data_recipe Fix per-block ID collisions and add block cleanup for unstructured uploads (#6944) 2026-07-08 20:03:03 -07:00
.gitkeep root studio folder 2026-02-02 09:13:49 +00:00
__init__.py Bind video_router in the routes re-export tuple for the import-hoist verifier 2026-07-04 17:57:16 +00:00
auth.py Studio: harden background consumer loops and streaming paths against silent UI freezes (#6653) 2026-06-26 03:31:33 -07:00
chat_history.py Sort chat recents by last activity (#6844) 2026-07-07 17:54:32 +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: multi-select export formats, portable FP8/INT8, GGUF LoRA, and source parity (#6767) 2026-07-03 08:25:10 -07:00
inference.py Support LoRA adapters on torchao int8/fp8 quantized image pipelines 2026-07-17 09:37:17 +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 Studio: tighten image-generation fix comments and docstrings 2026-07-13 13:32:28 +00:00
preview.py Studio: opt-in OpenAI /v1 model auto-switch and idle keep-warm (#6392) 2026-07-01 06:42:23 -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: customizable RAG embedding model with HF search, settings tab reorganization (#6800) 2026-07-02 05:26:33 -07:00
settings.py feat: detect installed coding agent CLIs in Studio settings (#6909) 2026-07-08 05:26:50 -07:00
training.py Studio: restore Reapply target on async image/video load errors; recheck training state before dataset commit; reclaim partial sd.cpp installs on retry 2026-07-13 15:27:46 +00:00
training_history.py Studio: require signed capability tokens for /p preview links (#6666) 2026-06-25 21:40:48 -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
video.py Studio: gate gallery serve/export on ownership; keep image progress active until persisted; reserve diffusion training before the dataset scan 2026-07-13 14:40:18 +00:00