Skip to content

[Studio] Windows absolute paths for local GGUFs are split at the drive letter, causing all chat completions to 503 with 'could not switch to it' #8368

Description

@PGCRT

Bug description
After updating Unsloth Studio to 2026.8.12 on Windows, every local GGUF model that previously worked now fails at chat time with:

The model 'C:\Users\<user>\...\model.gguf' is downloaded, but this server could not switch to it.
Retry shortly, or load it in Unsloth Studio.

The model itself loads successfully (the llama-server process starts and the health endpoint returns ok), but the chat endpoint /v1/chat/completions returns HTTP 503 with the message above. The same model works fine if requested via an alias or folder-style id.

Root cause
studio/backend/core/inference/openai_auto_download.py::split_model_ref() splits on the last colon to support repo:QUANT style references. On Windows, an absolute path also contains a colon (C:\...), so the function splits after the drive letter:

split_model_ref(r"C:\models\qwen.gguf")
# -> ("C", "\\models\\qwen.gguf")

The drive-letter guard only checks for forward slashes in the suffix, so a backslash-based Windows path is mis-interpreted as a repo:QUANT reference. The backend then decides the loaded model does not match the request, attempts to auto-switch, fails, and returns 503 with the "could not switch" message from routes/inference.py line ~4928.

To reproduce

  1. Install Unsloth Studio 2026.8.12 on Windows via irm https://unsloth.ai/install.ps1 | iex.
  2. Place any valid GGUF model in a local folder (e.g. C:\Users\<user>\.lmstudio\models\...\model.gguf).
  3. Start Unsloth Studio, go to the Models panel, load the local GGUF.
  4. Open a chat and send a message.
  5. The UI shows the 503 error above; the server log shows POST /v1/chat/completions 503.

Expected behavior
A chat request that names the currently loaded model by its absolute Windows path should be recognized as the resident model and generate normally, as it did before the update.

Workaround
Requesting the model by an alias or folder-style id (e.g. FolderName/model.gguf) works around the parsing bug.

Suggested fix
In split_model_ref, treat suffixes that contain backslashes as part of a Windows path, not as a variant. The existing guard:

if "/" in suffix:

should also include backslashes:

if "/" in suffix or "\\" in suffix:

so that C:\models\model.gguf is returned as ("C:\\models\\model.gguf", None) instead of being split at the drive letter.

Environment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions