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.

fix: lowercase remote Hugging Face model IDs in ModelConfig and routes to prevent caching mismatches with Unsloth

Roland Tannous7862e702116f
diff --git a/.gitignore b/.gitignore
index d89fdb9693d..a9ebfcf1b78 100755
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,7 @@ environment.yaml
unsloth_compiled_cache/
# ML artifacts (large files)
+feature/
outputs/
exports/
/datasets/
@@ -71,3 +72,5 @@ studio/backend/tests/
log_rtx.txt
log.txt
setup_leo.sh
+server.pid
+*.log
diff --git a/studio/backend/routes/models.py b/studio/backend/routes/models.py
index a3713387033..0315d0c31e8 100644
--- a/studio/backend/routes/models.py
+++ b/studio/backend/routes/models.py
@@ -290,6 +290,10 @@ async def get_model_config(
This endpoint wraps the backend load_model_defaults function.
"""
try:
+ from utils.models.model_config import is_local_path
+ if not is_local_path(model_name):
+ model_name = model_name.lower()
+
logger.info(f"Getting model config for: {model_name}")
from utils.models.model_config import detect_audio_type
# Load model defaults from backend
diff --git a/studio/backend/utils/models/model_config.py b/studio/backend/utils/models/model_config.py
index 5d50654ce80..59b3bc2f6e5 100644
--- a/studio/backend/utils/models/model_config.py
+++ b/studio/backend/utils/models/model_config.py
@@ -374,7 +374,7 @@ MODEL_NAME_MAPPING = {
_REVERSE_MODEL_MAPPING = {}
for canonical_file, model_names in MODEL_NAME_MAPPING.items():
for model_name in model_names:
- _REVERSE_MODEL_MAPPING[model_name] = canonical_file
+ _REVERSE_MODEL_MAPPING[model_name.lower()] = canonical_file
def load_model_config(model_name: str, use_auth: bool = False, token: Optional[str] = None):
"""
@@ -1234,8 +1234,8 @@ def load_model_defaults(model_name: str) -> Dict[str, Any]:
defaults_dir = script_dir / "assets" / "configs" / "model_defaults"
# First, check if model is in the mapping
- if model_name in _REVERSE_MODEL_MAPPING:
- canonical_file = _REVERSE_MODEL_MAPPING[model_name]
+ if model_name.lower() in _REVERSE_MODEL_MAPPING:
+ canonical_file = _REVERSE_MODEL_MAPPING[model_name.lower()]
# Search in subfolders and root
for config_path in defaults_dir.rglob(canonical_file):
if config_path.is_file():
@@ -1400,6 +1400,12 @@ class ModelConfig:
identifier = f"unsloth/{identifier}"
path = identifier
+ # Enforce lowercase for remote Hugging Face identifiers to prevent cache duplication
+ # Hugging Face Hub APIs are case-insensitive remotely, but case-sensitive locally (repo_folder_name).
+ if not is_local:
+ identifier = identifier.lower()
+ path = path.lower()
+
# Auto-detect GGUF models (check before LoRA/vision detection)
if is_local:
gguf_file = detect_gguf_model(path)