Qwen3.8-27B GGUF crashes on Apple M5 Max — LM Studio settings that work

Hardware

  • Apple MacBook Pro 16"
  • Chip: Apple M5 Max
  • Memory: 48 GB Unified Memory
  • Storage: 2 TB SSD
  • OS: macOS (Apple Silicon)
    Software
  • LM Studio 0.4.29
  • Model: Qwen3.8-27B (GGUF Q4_K_M)
    Problem
Qwen3.8-27B (GGUF Q4_K_M) answers the first message, then crashes on the second with an error:

Error messages observed:
- Engine protocol predict stream returned an error: {"code":500,"message":"Compute error.","type":"server_error"}
- Engine protocol predict stream returned an error: {"code":500,"message":"got exception: Unexpected empty grammar stack after accepting piece: @ (31)","type":"server_error"}
- Prediction request aborted but the prediction loop handler of the plugin lmstudio/default-prediction-loop-handler did not abort in time.
- Cannot send on a terminated channel.

Fix — LM Studio settings that worked
On Apple M5 Max + 48 GB RAM, the following combination resolves the crash:

  1. Hardware → GPUs: 1 GPU detected with Metal — Apple M5 Max (VRAM Capacity: 37.44 GB • Metal • deviceId: 0). Toggle OFF (do not use GPU for inference).
  2. Max Concurrent Predictions: set to 1 (default is 4).
  3. Unified KV Cache: OFF.
  4. Offload KV Cache to GPU Memory: OFF.
  5. Flash Attention: OFF.
  6. Model format: use GGUF Q4_K_M quantized versions only (e.g., Qwen3.8-27B Q4_K_M or Gemma 4 31B QAT Q4_K_M). Do not use MLX or unquantized models.

Result
After applying all these settings, multi-turn chat works without errors. Gemma 4 31B QAT (GGUF Q4_K_M) also runs stably on the same hardware.
This should help other users with M-series Macs and 48 GB Unified Memory avoid the same crash.

https://github.com/lmstudio-ai/lmstudio-bug-tracker/issues/2659