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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot]050240b27a0c
diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.pyindex 9561280bcca..3ed4589dc02 100644--- a/studio/backend/core/inference/llama_cpp.py+++ b/studio/backend/core/inference/llama_cpp.py@@ -405,9 +405,7 @@ class LlamaCppBackend:files = list_repo_files(hf_repo, token = hf_token)variant_lower = hf_variant.lower()boundary = re.compile(- r"(?<![a-zA-Z0-9])"- + re.escape(variant_lower)- + r"(?![a-zA-Z0-9])"+ r"(?<![a-zA-Z0-9])" + re.escape(variant_lower) + r"(?![a-zA-Z0-9])")gguf_files = sorted(f@@ -445,9 +443,7 @@ class LlamaCppBackend:from huggingface_hub import get_paths_info- path_infos = list(- get_paths_info(hf_repo, all_gguf_files, token = hf_token)- )+ path_infos = list(get_paths_info(hf_repo, all_gguf_files, token = hf_token))total_download_bytes = sum((p.size or 0) for p in path_infos)if total_download_bytes > 0:@@ -506,11 +502,7 @@ class LlamaCppBackend:logger.info(f"Downloading GGUF: {hf_repo}/{gguf_filename}"- + (- f" (+{len(gguf_extra_shards)} shards)"- if gguf_extra_shards- else ""- )+ + (f" (+{len(gguf_extra_shards)} shards)" if gguf_extra_shards else ""))try:if self._cancel_event.is_set():diff --git a/studio/backend/core/inference/orchestrator.py b/studio/backend/core/inference/orchestrator.pyindex 6c50f2b7534..99c43bbd887 100644--- a/studio/backend/core/inference/orchestrator.py+++ b/studio/backend/core/inference/orchestrator.py@@ -124,8 +124,7 @@ class InferenceOrchestrator:if resp.status_code == 200:models = resp.json()gguf_ids = [- m["id"] for m in models- if m.get("id", "").upper().endswith("-GGUF")+ m["id"] for m in models if m.get("id", "").upper().endswith("-GGUF")][:4]if gguf_ids:self._top_gguf_cache = gguf_idsdiff --git a/studio/backend/routes/models.py b/studio/backend/routes/models.pyindex 2b1fb09b794..42587317128 100644--- a/studio/backend/routes/models.py+++ b/studio/backend/routes/models.py@@ -14,11 +14,14 @@ import structlogfrom loggers import get_loggerimport re as _re+_VALID_REPO_ID = _re.compile(r"^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$")+def _is_valid_repo_id(repo_id: str) -> bool:return bool(_VALID_REPO_ID.fullmatch(repo_id))+# Add backend directory to pathbackend_path = Path(__file__).parent.parent.parentif str(backend_path) not in sys.path: