Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Merge nightly into feature/transformers-v5-support

Roland Tannousf16a7f2d17f5
diff --cc studio/backend/main.py
index a765fc9030e,5ccd6cec123..b29fdb3908c
--- a/studio/backend/main.py
+++ b/studio/backend/main.py
@@@ -25,12 -24,9 +24,15 @@@ from utils.cache_cleanup import clear_u
@asynccontextmanager
async def lifespan(app: FastAPI):
"""Startup: detect hardware, print setup token if needed. Shutdown: clean up compiled cache."""
+ # Clean up any stale compiled cache from previous runs
+ clear_unsloth_compiled_cache()
+
+ # Remove stale .venv_overlay from previous sessions — it will be
+ # rebuilt at runtime if a model needs transformers 5.x
+ overlay_dir = Path(__file__).resolve().parent.parent.parent / ".venv_overlay"
+ if overlay_dir.is_dir():
+ shutil.rmtree(overlay_dir, ignore_errors=True)
+
# Detect hardware first — sets DEVICE global used everywhere
detect_hardware()