Repository navigation
Description
Description
I'm encountering a critical issue when trying to load the DeepSeek-V4-Flash-UD-Q2_K_XL GGUF model (~100GB) in Unsloth Studio on my Windows 11 machine with 112GB RAM and an RTX 5070 Ti (16GB VRAM). The model fails to load with the default parameters that Studio currently passes to the underlying llama-server.
System details:
- OS: Windows 11
- GPU: NVIDIA RTX 5070 Ti (16GB VRAM)
- RAM: 112GB
- Model:
unsloth/DeepSeek-V4-Flash-UD-Q2_K_XL(3-bit, ~100GB)
The Problem
Unsloth Studio currently launches llama-server with the following default flags for this model:
-c 4096 --parallel 1 --flash-attn on --no-context-shift --fit on
This configuration fails to load the model entirely. The issue is the --fit on flag.
According to the Studio's own PR #6098, --fit on is designed to auto-tune llama.cpp environment variables specifically for datacenter/professional NVIDIA GPUs (like B200, H100). It sets flags like GGML_CUDA_FORCE_CUBLAS_COMPUTE_32F=1 and GGML_CUDA_P2P=1 to optimize for multi-GPU NVLink setups. As noted in the PR, these optimizations can carry a "real throughput cost" on consumer GeForce cards, which is why they are gated for datacenter GPUs.
On consumer hardware like the RTX 5070 Ti, the --fit on flag attempts to apply datacenter-specific optimizations that are not appropriate. The memory management and layer placement logic it triggers are incompatible with the memory constraints of a consumer GPU with 16GB VRAM when handling a ~100GB MoE model.
The Working Configuration
After extensive testing, I found that the model loads and runs successfully only when replacing --fit on with the following set of flags:
-ngl auto --cpu-moe --no-mmap
-ngl auto– Automatically offloads the maximum number of layers that fit into the 16GB VRAM.--cpu-moe– Forces all Mixture-of-Experts (MoE) layers to remain on CPU RAM. This is critical for MoE models like DeepSeek-V4-Flash, as the expert layers are too large to fit in consumer VRAM.--no-mmap– Disables memory mapping, which improves stability on Windows when loading very large GGUF files (~100GB) by avoiding virtual memory fragmentation and file lock issues.
With these flags, I achieved 9.3 tokens/second on this setup.
Feature Request: Granular Control Over llama-server Parameters
The ability to tune llama-server parameters is essential for advanced users, especially those running large MoE models on consumer hardware. While Unsloth Studio supports passing extra arguments via the CLI (unsloth studio run --model ... --cpu-moe --no-mmap -t 16), this workflow forces users to abandon the convenient web UI.
Request: Add a "Custom llama-server Arguments" field or section in the Studio web UI's model settings panel. This would allow users to specify additional flags (e.g., --cpu-moe, --no-mmap, -t, --context-shift, etc.) that are then passed to the llama-server subprocess.
Existing Infrastructure: The backend already supports this via the LoadRequest.llama_extra_args field and has a denylist to prevent users from overriding critical flags like --model, --host, or --port. PR #5271 established this pass-through mechanism, and PR #5815 extended it to honor --ctx-size overrides in Studio's context-fit logic. Extending this same infrastructure to the UI would be a natural and valuable enhancement.
Proposed Solution
- Add a text input or key-value interface in the model settings panel (next to context size, parallel requests, etc.).
- Allow users to enter additional
llama-serverflags (e.g.,--cpu-moe --no-mmap -t 16). - Apply the same denylist validation already used for CLI pass-through to ensure system stability.
- Pass these flags to the
llama-serversubprocess via the existingllama_extra_argsfield.
Benefits
- Power users can optimize performance for specific hardware without leaving the UI.
- MoE models become loadable on consumer hardware by enabling
--cpu-moedirectly from the UI. - Testing becomes easier: users can A/B test flags like
--flash-attn(which, counterintuitively, decreased performance from 9.3 to 7.5 t/s in my tests) to find the best configuration. - Documentation: Tooltips or a link to
llama-serverdocumentation would help users discover available flags.
Additional Context
- The model loads successfully with:
-ngl auto --cpu-moe --no-mmap -t 16 --context-shift - The model fails to load with:
--fit on(the current Studio default) - DeepSeek-V4-Flash is a Mixture-of-Experts model with 284B total parameters (13B active). MoE models require special handling on consumer GPUs with limited VRAM, which
--cpu-moeprovides.
Thank you for considering this feature request. I'm happy to provide additional logs or testing if needed.
Activity
MichK-tech commentedon Aug 3, 2026
please add this option
danielhanchen commentedon Aug 28, 2026
This should be fixed now - sorry on the delay - please update Unsloth Studio to the latest via
curl -fsSL https://unsloth.ai/install.sh | shfor Linux, Mac, WSL orirm https://unsloth.ai/install.ps1 | iexfor Windows - if it's not fixed yet, it'll be in the next Studio release - if it's still not working after that, please open another issue - appreciate it again!Set GPU Memory to Manual and use the GPU Layers and MoE Layers on CPU sliders, or pass
--cpu-moe --no-mmapin Extra Arguments, and the flags now reach llama-server rather than being overridden by--fit.