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.

Studio: pin the remaining unpinned requirements (#8408)

Daniel Han26a91bb65dc9
diff --git a/pyproject.toml b/pyproject.toml
index 061ac29d01f..66a54ff3a87 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -91,27 +91,32 @@ exclude = [
# Studio's server stack, mirroring studio/backend/requirements/studio.txt.
# test_studio_extra_matches_requirements.py catches drift.
studio = [
- "typer",
- "fastapi",
- "uvicorn",
- "pydantic",
- "packaging",
+ "typer==0.27.1 ; python_version >= '3.10'",
+ "typer==0.23.2 ; python_version < '3.10'",
+ "fastapi==0.141.1 ; python_version >= '3.10'",
+ "fastapi==0.128.8 ; python_version < '3.10'",
+ "uvicorn==0.52.1 ; python_version >= '3.10'",
+ "uvicorn==0.39.0 ; python_version < '3.10'",
+ "pydantic==2.13.4",
+ "packaging==26.3",
"matplotlib==3.10.9",
- "pandas",
- "nest_asyncio",
+ "pandas==2.3.3",
+ "nest_asyncio==1.6.0",
"datasets==4.3.0",
- "pyjwt",
+ "pyjwt==2.13.0",
"huggingface-hub>=1.23.0,<2.0 ; python_version >= '3.10'",
"huggingface-hub==0.36.2 ; python_version < '3.10'",
"urllib3>=2.3.0",
"structlog>=24.1.0",
- "diceware",
- "ddgs",
+ "diceware==1.0.1",
+ "ddgs==9.14.4 ; python_version >= '3.10'",
+ "ddgs==9.8.0 ; python_version < '3.10'",
"cryptography>=42.0.0",
"boto3>=1.34.0",
"httpx>=0.27.0",
"fastmcp>=3.0.2",
- "gguf",
+ "gguf==0.19.0 ; python_version >= '3.10'",
+ "gguf==0.18.0 ; python_version < '3.10'",
"av>=12.0.0",
"sqlite-vec==0.1.9",
"pymupdf==1.27.2.3",
diff --git a/studio/backend/requirements/diffusers-pin.txt b/studio/backend/requirements/diffusers-pin.txt
index 301788a2e47..af43ce8a715 100644
--- a/studio/backend/requirements/diffusers-pin.txt
+++ b/studio/backend/requirements/diffusers-pin.txt
@@ -15,4 +15,4 @@
# outright would leave the resolver nothing at all on a 3.9 host. Those hosts get the
# newest release they can take and the H3 guard refuses the model with a clear message.
diffusers @ https://github.com/huggingface/diffusers/archive/f53d552036a0d1bd5570782a39cd40cfabf112bc.zip ; python_version >= "3.10"
-diffusers ; python_version < "3.10"
+diffusers==0.36.0 ; python_version < "3.10"
diff --git a/studio/backend/requirements/extras-no-deps.txt b/studio/backend/requirements/extras-no-deps.txt
index 7500700bc7a..02e01f814b8 100644
--- a/studio/backend/requirements/extras-no-deps.txt
+++ b/studio/backend/requirements/extras-no-deps.txt
@@ -1,9 +1,9 @@
# Audio extras (installed with --no-deps --no-cache-dir)
-descript-audio-codec
-descript-audiotools
-julius
+descript-audio-codec==1.0.0
+descript-audiotools==0.7.2
+julius==0.2.8
torchcodec==0.10.0
-snac
+snac==1.2.1
# peft 0.19.0 causes export subprocess shutdown issues in Unsloth;
# installing with --no-deps to avoid pulling in torch>=0.11.0
@@ -11,15 +11,23 @@ peft==0.18.1
# TRL and related packages
trl==0.23.1
-# executorch>=1.0.1 # 41.5 MB - no imports in unsloth/zoo/studio
-torch-c-dlpack-ext
+# executorch>=1.0.1 # 41.5 MB - no imports in unsloth/zoo/studio
+torch-c-dlpack-ext==0.1.5
sentence_transformers==5.2.0
transformers==5.5.0; python_version >= "3.10"
transformers==4.57.6; python_version < "3.10"
# No macOS x86_64 wheel at any version, so uv falls back to an sdist that shells out to
# cmake. Skipping it on Intel Macs keeps that install compiler-free.
-pytorch_tokenizers; sys_platform != "darwin" or platform_machine == "arm64"
+#
+# Capped rather than pinned, because which version is installable varies along two
+# axes PEP 508 markers cannot express. 1.4.1 has no musllinux wheel (1.1.0 is the
+# newest that does), and its arm64 wheel is macosx_14_0, so a macOS 13 host needs
+# 1.2.0 while macOS 14+ takes 1.4.1. An exact pin would force a musl host or an
+# older Mac onto the one release carrying an sdist and hand them the cmake build
+# this file is written to avoid. The cap keeps the resolver's fallback while
+# bounding it at the newest audited release.
+pytorch_tokenizers<=1.4.1; sys_platform != "darwin" or platform_machine == "arm64"
kernels==0.12.1
# kernels<3.11 imports tomli as its tomllib fallback; --no-deps skips its own
# marker dep, so list it here (no-op on the 3.12/3.13 default installs).
-tomli; python_version < "3.11"
+tomli==2.4.1; python_version < "3.11"
diff --git a/studio/backend/requirements/extras.txt b/studio/backend/requirements/extras.txt
index d62c529924b..865426d7455 100644
--- a/studio/backend/requirements/extras.txt
+++ b/studio/backend/requirements/extras.txt
@@ -1,37 +1,57 @@
# transitive dep of onnxruntime (via data-designer's pymupdf4llm)
-flatbuffers
+flatbuffers==25.12.19
# Also needed by sentence_transformers (installed with --no-deps in extras-no-deps.txt);
# librosa pulls it in too, but is skipped in no-torch mode.
scikit-learn==1.7.1
# Additional extras
-jiwer # WER/CER metrics for vision OCR save-merge benchmarks
-omegaconf
+jiwer==4.0.0 # WER/CER metrics for vision OCR save-merge benchmarks
+omegaconf==2.3.1
einx<0.4.3; sys_platform == "win32"
-einx; sys_platform != "win32"
-pyloudnorm
-openai-whisper
-av # PyAV: decode dictation audio (webm/opus/mp3/…) for the Whisper STT sidecar
-uroman # 4.0 MB - used for Outetts.
-MeCab # 19.9 MB - used for Outetts.
-inflect # number-to-words, required by OuteTTS
-loguru
-flatten_dict
-ffmpy
-randomname
-argbind
-tiktoken
-ftfy
-importlib-resources
-librosa
-markdown2
+# einx dropped 3.9 in 0.4.0, so the non-Windows pin splits at 3.10.
+einx==0.4.3; sys_platform != "win32" and python_version >= "3.10"
+einx==0.3.0; sys_platform != "win32" and python_version < "3.10"
+pyloudnorm==0.2.0
+openai-whisper==20250625
+# PyAV: decode dictation audio (webm/opus/mp3/…) for the Whisper STT sidecar.
+# Held at the 15.x line, not the newest release: single-env/constraints.txt caps
+# av<16 because 16+ builds its macOS arm64 wheels against macosx_14_0 and so has
+# no installable wheel on macOS 13. Pinning past the cap makes that leg
+# unsatisfiable. Lift both together.
+av==15.1.0
+uroman==1.3.1.1 # 4.0 MB - used for Outetts.
+# 19.9 MB - used for Outetts. No release ships a macOS cp314 wheel (0.996.12 added
+# cp314 for Linux and win_amd64 only), so a 3.14 macOS host has no binary candidate
+# and falls back to 0.996.5, the last release carrying an sdist. That is what the
+# resolver already picked there before this was pinned.
+MeCab==0.996.13; sys_platform != "darwin" or python_version < "3.14"
+MeCab==0.996.5; sys_platform == "darwin" and python_version >= "3.14"
+inflect==7.5.0 # number-to-words, required by OuteTTS
+loguru==0.7.3
+# 0.5.0 requires >=3.10.
+flatten_dict==0.5.0; python_version >= "3.10"
+flatten_dict==0.4.2; python_version < "3.10"
+ffmpy==1.0.0
+randomname==0.2.1
+argbind==0.3.9
+tiktoken==0.13.0
+ftfy==6.3.1
+# 7.x requires >=3.10.
+importlib-resources==7.1.0; python_version >= "3.10"
+importlib-resources==6.5.2; python_version < "3.10"
+librosa==0.11.0
+markdown2==2.5.5
matplotlib==3.10.9
-pystoi
-soundfile
-tensorboard
-torch-stoi
-timm
-einops
-tabulate
+pystoi==0.4.1
+# 0.14 requires >=3.10.
+soundfile==0.14.0; python_version >= "3.10"
+soundfile==0.13.1; python_version < "3.10"
+tensorboard==2.21.0
+torch-stoi==0.2.3
+timm==1.0.28
+einops==0.8.2
+# 0.10 requires >=3.10.
+tabulate==0.10.0; python_version >= "3.10"
+tabulate==0.9.0; python_version < "3.10"
openai>=2.7.2
websockets>=15.0.1
diff --git a/studio/backend/requirements/no-torch-runtime.txt b/studio/backend/requirements/no-torch-runtime.txt
index 4e4d015ced9..ba08e1e91ac 100644
--- a/studio/backend/requirements/no-torch-runtime.txt
+++ b/studio/backend/requirements/no-torch-runtime.txt
@@ -23,17 +23,24 @@ pygments>=2.0
# before this --no-deps file is applied, so pip resolves pydantic-core
# to the exact version pydantic's _ensure_pydantic_core_version check
# expects. Pinning both under --no-deps used to drift them apart.
-pyyaml
-nest-asyncio
+pyyaml==6.0.3
+nest-asyncio==1.6.0
# HF ecosystem (from [huggingfacenotorch] extras in pyproject.toml)
wheel>=0.42.0
-packaging
-numpy
-tqdm
-psutil
-tyro
-protobuf
+packaging==26.3
+# numpy moves its Python floor every second minor release (2.0 >=3.9, 2.1 >=3.10,
+# 2.3 >=3.11, 2.5 >=3.12), so the pin is per-interpreter.
+numpy==2.5.2; python_version >= "3.12"
+numpy==2.4.6; python_version >= "3.11" and python_version < "3.12"
+numpy==2.2.6; python_version >= "3.10" and python_version < "3.11"
+numpy==2.0.2; python_version < "3.10"
+tqdm==4.70.0
+psutil==7.2.2
+tyro==1.0.15
+# protobuf 7.x requires >=3.10.
+protobuf==7.35.1; python_version >= "3.10"
+protobuf==6.33.6; python_version < "3.10"
sentencepiece>=0.2.0
safetensors>=0.4.3
datasets>=3.4.1,!=4.0.*,!=4.1.0,<4.4.0
@@ -41,31 +48,46 @@ accelerate>=0.34.1
peft>=0.18.0,!=0.11.0
huggingface_hub>=1.23.0,<2.0; python_version >= "3.10"
huggingface_hub==0.36.2; python_version < "3.10"
-hf_transfer
+hf_transfer==0.1.9
# diffusers: see diffusers-pin.txt, installed by its own step (this file is
# installed --no-deps, and the pin has to apply on the torch path too).
# Transitive deps required because this file is installed with --no-deps.
# Without these, `from transformers import AutoConfig` fails at import time.
-regex
-typing_extensions
-filelock
-httpx
-httpcore
-certifi
-idna
-anyio>=3.0,<4.14.0 # 4.14 asyncio cancel-scope RuntimeError on Py3.13 streaming (#6483); 4.13 unaffected
-sniffio
-h11
+# Where the newest release dropped 3.9, the pin splits on the same 3.10 marker
+# the transformers pins below already use.
+regex==2026.7.19; python_version >= "3.10"
+regex==2026.1.15; python_version < "3.10"
+typing_extensions==4.16.0
+filelock==3.32.2; python_version >= "3.10"
+filelock==3.19.1; python_version < "3.10"
+httpx==0.28.1
+httpcore==1.0.9
+# certifi is the CA trust store, not an ordinary library: an exact pin freezes it,
+# so distrusted roots stay trusted and newly added ones never arrive. It is pinned
+# here for the same reason as everything else in this file, but treat a bump as a
+# security update rather than routine churn, and refresh it on its own schedule.
+# The same applies to idna, h11 and httpcore above and below: they sit on the TLS
+# and HTTP request path, so they belong on that schedule too, not on churn.
+certifi==2026.7.22
+idna==3.18
+anyio>=3.0,<4.14.0 # 4.14 asyncio cancel-scope RuntimeError on Py3.13 streaming (#6483); 4.13 unaffected
+sniffio==1.3.1
+h11==0.16.0
# Transformers 5.5 supports tokenizers 0.22.x through 0.23.0.
tokenizers<=0.23.0
transformers==5.5.0; python_version >= "3.10"
transformers==4.57.6; python_version < "3.10"
trl>=0.18.2,!=0.19.0,<=0.24.0
-sentence-transformers
-cut_cross_entropy
-pillow
+# Matches extras-no-deps.txt rather than the newest release: that file installs
+# --no-deps too and runs after this one, so whatever it names wins. Pinning a
+# higher version here would record a number no install ever ends up with. Bump
+# both together.
+sentence-transformers==5.2.0
+cut_cross_entropy==25.1.1
+pillow==12.3.0; python_version >= "3.10"
+pillow==11.3.0; python_version < "3.10"
# RAG store + document parsing, mirroring studio.txt. Pinned here because
# this file installs --no-deps; without them Unsloth runs with RAG disabled.
@@ -76,4 +98,7 @@ pymupdf==1.27.2.3
pymupdf4llm==0.3.4
python-docx==1.2.0
-lxml==6.0.2
+# 6.0.2 is affected by PYSEC-2026-87, fixed in 6.1.0. Pinning the file made the
+# advisory visible to the nightly pip-audit in security-audit.yml, where a bare
+# entry had always resolved to whatever was current and so never reported.
+lxml==6.1.1
diff --git a/studio/backend/requirements/studio.txt b/studio/backend/requirements/studio.txt
index e1e603e3486..be4cd5bbfc9 100644
--- a/studio/backend/requirements/studio.txt
+++ b/studio/backend/requirements/studio.txt
@@ -1,14 +1,22 @@
# Unsloth UI backend dependencies
-typer
-fastapi
-uvicorn
-pydantic
-packaging
+# typer / fastapi / uvicorn / ddgs / gguf all dropped Python 3.9 in their newest
+# release, so each pin splits on the same 3.10 marker used elsewhere in this file.
+typer==0.27.1; python_version >= "3.10"
+typer==0.23.2; python_version < "3.10"
+fastapi==0.141.1; python_version >= "3.10"
+fastapi==0.128.8; python_version < "3.10"
+uvicorn==0.52.1; python_version >= "3.10"
+uvicorn==0.39.0; python_version < "3.10"
+pydantic==2.13.4
+packaging==26.3
matplotlib==3.10.9
-pandas
-nest_asyncio
+# Held at 2.3.3 rather than the 3.0.x line: single-env/constraints.txt pins
+# pandas==2.3.3, and 2.3.3 is also the newest release that still installs on
+# 3.9. Bump both together.
+pandas==2.3.3
+nest_asyncio==1.6.0
datasets==4.3.0
-pyjwt
+pyjwt==2.13.0
# gradio>=4.0.0 # 148 MB - Unsloth uses React + FastAPI, not Gradio
huggingface-hub>=1.23.0,<2.0; python_version >= "3.10"
huggingface-hub==0.36.2; python_version < "3.10"
@@ -20,8 +28,9 @@ huggingface-hub==0.36.2; python_version < "3.10"
# way, so this is defence in depth, not the bound itself.
urllib3>=2.3.0
structlog>=24.1.0
-diceware
-ddgs
+diceware==1.0.1
+ddgs==9.14.4; python_version >= "3.10"
+ddgs==9.8.0; python_version < "3.10"
cryptography>=42.0.0
boto3>=1.34.0 # optional: S3 dataset loading
httpx>=0.27.0
@@ -29,7 +38,8 @@ fastmcp>=3.0.2
# Local image generation (Images page): diffusers' GGUFQuantizationConfig needs
# the gguf reader. diffusers itself is torch-bound and comes via the ML stack;
# gguf is torch-free so it lives here, where it's installed in every mode.
-gguf
+gguf==0.19.0; python_version >= "3.10"
+gguf==0.18.0; python_version < "3.10"
# Local video generation (Video page): MP4 encode (H.264 + AAC mux for LTX-2's
# synchronized audio) runs through PyAV, which bundles its own ffmpeg libs. The
# video load path fails fast with a clear error when this is missing, so keep it
diff --git a/studio/backend/tests/test_torchao_select.py b/studio/backend/tests/test_torchao_select.py
index fa7355fd941..9c96dafb71d 100644
--- a/studio/backend/tests/test_torchao_select.py
+++ b/studio/backend/tests/test_torchao_select.py
@@ -90,7 +90,9 @@ def test_matching_torchao_pin_does_not_need_force_reinstall(monkeypatch):
def test_windows_first_hop_uses_einx_wheel_without_shared_test_tree():
requirements = _EXTRAS_REQUIREMENTS.read_text(encoding = "utf-8")
assert 'einx<0.4.3; sys_platform == "win32"' in requirements
- assert 'einx; sys_platform != "win32"' in requirements
+ # einx dropped 3.9 in 0.4.0, so the non-Windows side is split by interpreter.
+ assert 'einx==0.4.3; sys_platform != "win32" and python_version >= "3.10"' in requirements
+ assert 'einx==0.3.0; sys_platform != "win32" and python_version < "3.10"' in requirements
@pytest.mark.parametrize(
diff --git a/tests/studio/install/test_studio_extra_matches_requirements.py b/tests/studio/install/test_studio_extra_matches_requirements.py
index e4c16e88907..5a9f8bd2108 100644
--- a/tests/studio/install/test_studio_extra_matches_requirements.py
+++ b/tests/studio/install/test_studio_extra_matches_requirements.py
@@ -87,6 +87,50 @@ def test_studio_extra_matches_requirements_file():
)
+def _specs(entries: list[str]) -> set[tuple[str, str, str]]:
+ """(name, specifier, marker) per entry, quote style and ordering normalised."""
+ from packaging.requirements import Requirement
+ from packaging.utils import canonicalize_name
+
+ out = set()
+ for entry in entries:
+ requirement = Requirement(entry)
+ specifier = ",".join(sorted(str(s) for s in requirement.specifier))
+ out.add(
+ (
+ canonicalize_name(requirement.name),
+ specifier,
+ str(requirement.marker) if requirement.marker else "",
+ )
+ )
+ return out
+
+
+def test_studio_extra_matches_requirement_versions():
+ """Names matching is not enough: the versions and markers have to match too.
+
+ Comparing normalised names alone let the extra keep bare requirements while
+ studio.txt carried exact pins, so `pip install "unsloth[studio]"` resolved a
+ different stack than the managed installer produced (pandas 3.x against the
+ installer's 2.3.3, which is a copy-on-write and str-dtype migration apart).
+ """
+ extras = _load_pyproject()["project"]["optional-dependencies"]
+ extra = _specs(extras["studio"])
+ required = _specs(_requirement_lines(STUDIO_TXT))
+
+ missing = sorted(required - extra)
+ surplus = sorted(extra - required)
+ assert not missing, (
+ f"studio.txt specifies {missing} but the `studio` extra does not. "
+ '`pip install "unsloth[studio]"` would resolve a different stack than '
+ "install.sh builds. Mirror the specifier and marker, not just the name."
+ )
+ assert not surplus, (
+ f"The `studio` extra specifies {surplus} but studio.txt does not. "
+ "Mirror studio.txt exactly, or update studio.txt if the installer needs it."
+ )
+
+
@pytest.mark.parametrize("package", CORE_RUNTIME_PACKAGES)
def test_cli_runtime_packages_are_core_dependencies(package):
core = [_normalise(entry) for entry in _load_pyproject()["project"]["dependencies"]]