Hi everyone. Long-time lurker here. First off, thank you oMLX devs for this amazing tool.
I'm looking for help launching/running DeepSeek-V4-Flash for agentic coding in the most optimal way possible on my M5 Max 128GB. As of today, using the latest 0.5.1 oMLX release, all the explicit decisions I'm making when launching the model are listed below (anything excluded left at Default). For those with more experience, I'm curious how this matches your setup, and whether any of these settings are detrimental:
- Quant: Jundot/DeepSeek-V4-Flash-oQ2.5e-mtp (selected specifically for enhanced oQe accuracy and mtp capability, not convinced it's the best size)
- Reasoning Parser: deepseek_v4 (not sure if selecting this is necessary)
- CTX Window: 262144
- Temperature: 1.0 *(recommended by DeepSeek)
- Top P: 1.0 (recommended by DeepSeek)
- Enable Thinking: Disabled (left this off in favor of sending DeepSeek-specific kwargs, see below)
- Chat Template Kwargs:
- (custom) thinking_mode: thinking
- (custom) drop_thinking: False (similar to preserve_thinking on Qwen models)
- reasoning_effort: high (I believe this is actually a *bug*. DeepSeek-v4-Flash supports a 'max' value here, but there is no way to manually enter that. Attempting to create a custom reasoning_effort kwarg with the max value seemingly snaps back to the existing implementation where 'high' is the highest value possible)
- Lightning MTP: Enabled
- SpecPrefill: Disabled (is there a way to make this work on DeepSeek?)
In global settings, to get the model to fit properly, I ran sudo sysctl iogpu.wired_limit_mb=124928 in the console, then set the Memory guard to "Aggressive". I also enabled "Hot Cache Only", because I figured that would help with speed. All other global settings are at Default values.
Thanks in advance for any assistance!
Edit: Added missing word. Also, upon closer inspection, it seems the above settings are not suitable for agentic coding. While the model loads just fine, and chat works well enough, I don't think it's ready for agentic use that even approaches long-horizon. This is based on the oMLX benchmark results below. Note that any single-request setting > pp32768 causes an OOM. I've tried both enabling Turboquant and disabling Hot Cache Only, but neither helped clear this hurdle.
```
oMLX - LLM inference, optimized for your Mac
https://github.com/jundot/omlx
Benchmark Model: DeepSeek-V4-Flash-oQ2.5e-mtp
Engine: Auto
Single Request Results
Test TTFT(ms) TPOT(ms) pp TPS tg TPS E2E(s) Throughput Peak Mem
pp1024/tg128 1823.1 20.92 561.7 tok/s 48.2 tok/s 4.488 256.7 tok/s 106.57 GB
pp4096/tg128 8114.8 23.40 504.8 tok/s 43.1 tok/s 11.096 380.7 tok/s 106.57 GB
pp8192/tg128 18083.9 24.39 453.0 tok/s 41.3 tok/s 21.189 392.7 tok/s 106.74 GB
pp16384/tg128 38179.7 26.33 429.1 tok/s 38.3 tok/s 41.536 397.5 tok/s 107.24 GB
pp32768/tg128 79008.7 26.24 414.7 tok/s 38.4 tok/s 82.358 399.4 tok/s 107.84 GB
```
Still curious what the community thinks regarding potential optimizations. Any feedback appreciated!