Title: [Bug] Windows: Access denied on llama-server.exe when Studio is run without admin after elevated install
Did you update?
pip install --upgrade unsloth unsloth_zoo — yes, running latest.
Colab or Kaggle or local / cloud
Local — Windows 11, NVIDIA RTX GPU
Which Unsloth version, TRL version, transformers version, PyTorch version?
Unsloth Studio v0.1.2-beta, Python 3.13
Bug
When unsloth studio setup is run from an elevated (Administrator) terminal, the built llama-server.exe inherits restrictive ACLs. If the user then launches Unsloth Studio without admin privileges (which is the normal case), model validation fails with [WinError 5] Access is denied.
Models load fine in LM Studio using the same GGUF files, confirming the models themselves are valid.
Reproduction
- Open PowerShell as Administrator
- Run
unsloth studio setup (installs and builds llama-server.exe under ~/.unsloth/llama.cpp/)
- Close the admin terminal
- Open a normal (non-elevated) terminal
- Run
unsloth studio
- Try to load any GGUF model (e.g.
unsloth/Qwen3.5-4B-GGUF)
- Model validation fails with Access is denied
Logs
{"timestamp": "2026-04-04T07:37:52.818254Z", "level": "error", "event": "Error validating model identifier 'unsloth/Qwen3.5-4B-GGUF': [WinError 5] Access is denied: 'C:\\\\Users\\\\[REDACTED]\\\\.unsloth\\\\llama.cpp\\\\build\\\\bin\\\\Release\\\\llama-server.exe'", "exc_info": true}
{"timestamp": "2026-04-04T07:37:52.818697Z", "level": "info", "event": "request_completed", "method": "POST", "path": "/api/inference/validate", "status_code": 400, "process_time_ms": 69.05}
Temporary workaround
Run Unsloth Studio as Administrator (right-click → Run as administrator). This works but shouldn't be required for normal use.
Suggested fix
The setup script should ensure llama-server.exe (and other built binaries) are accessible to the installing user's normal (non-elevated) account. Potential approaches:
- Post-build permission fix: After building llama-server.exe, run
icacls to grant BUILTIN\Users read+execute access, so it works regardless of elevation context
- Detect elevated install: Warn the user during setup that installing as admin may cause permission issues, and offer to fix ACLs automatically
- Startup detection: If Studio detects
[WinError 5] at runtime, check whether admin privilege mismatch is the cause and surface an actionable error message instead of a generic "Invalid model" 400
- Elevate on startup (not recommended): As a last resort, Studio could request admin privileges on launch via UAC. This would work but adds unnecessary friction and violates least-privilege principles — the real fix should ensure the binary is accessible without elevation.
I've already prototyped option 3 (runtime detection with ctypes.windll.shell32.IsUserAnAdmin() + retry-with-backoff for transient file locks). If this isn't addressed in a couple weeks, I'm happy to put together a PR covering both the install-time fix and the runtime fallback.
Related issues
Title: [Bug] Windows: Access denied on llama-server.exe when Studio is run without admin after elevated install
Did you update?
pip install --upgrade unsloth unsloth_zoo— yes, running latest.Colab or Kaggle or local / cloud
Local — Windows 11, NVIDIA RTX GPU
Which Unsloth version, TRL version, transformers version, PyTorch version?
Unsloth Studio v0.1.2-beta, Python 3.13
Bug
When
unsloth studio setupis run from an elevated (Administrator) terminal, the builtllama-server.exeinherits restrictive ACLs. If the user then launches Unsloth Studio without admin privileges (which is the normal case), model validation fails with[WinError 5] Access is denied.Models load fine in LM Studio using the same GGUF files, confirming the models themselves are valid.
Reproduction
unsloth studio setup(installs and builds llama-server.exe under~/.unsloth/llama.cpp/)unsloth studiounsloth/Qwen3.5-4B-GGUF)Logs
{"timestamp": "2026-04-04T07:37:52.818254Z", "level": "error", "event": "Error validating model identifier 'unsloth/Qwen3.5-4B-GGUF': [WinError 5] Access is denied: 'C:\\\\Users\\\\[REDACTED]\\\\.unsloth\\\\llama.cpp\\\\build\\\\bin\\\\Release\\\\llama-server.exe'", "exc_info": true} {"timestamp": "2026-04-04T07:37:52.818697Z", "level": "info", "event": "request_completed", "method": "POST", "path": "/api/inference/validate", "status_code": 400, "process_time_ms": 69.05}Temporary workaround
Run Unsloth Studio as Administrator (right-click → Run as administrator). This works but shouldn't be required for normal use.
Suggested fix
The setup script should ensure
llama-server.exe(and other built binaries) are accessible to the installing user's normal (non-elevated) account. Potential approaches:icaclsto grantBUILTIN\Usersread+execute access, so it works regardless of elevation context[WinError 5]at runtime, check whether admin privilege mismatch is the cause and surface an actionable error message instead of a generic "Invalid model" 400I've already prototyped option 3 (runtime detection with
ctypes.windll.shell32.IsUserAnAdmin()+ retry-with-backoff for transient file locks). If this isn't addressed in a couple weeks, I'm happy to put together a PR covering both the install-time fix and the runtime fallback.Related issues