mlx-community Shrinks Alibaba's Qwen3.8-27B to Fit a 24 GB Mac
A 4-bit MLX conversion of Qwen3.8-27B squeezes a native multimodal dense model into roughly 16 GB, making it practical on Apple Silicon Macs.
Takeaways
- mlx-community released a 4-bit MLX port of Qwen3.8-27B, now past 800k downloads.
- Base model is a dense multimodal Qwen3.5-family model with hybrid attention, vision tower, and MTP head.
- 4-bit quant fits in ~16 GB of unified memory, usable on 24 to 32 GB Macs.
- Supports text, image, and video inputs, tool calling, and toggleable thinking mode.
- Apache 2.0 license, run via
mlx_vlm.generate, context up to 262K native. - vllm-mlx integration is broken for video; mlx-vlm direct path works for text and images.
The mlx-community organization has released a 4-bit conversion of Alibaba’s Qwen3.8-27B, a dense multimodal model that accepts text, images, and video. Its MLX repository showed more than 800,000 downloads when checked, although Hugging Face counts can include automated pulls and do not represent unique users.
The conversion gives Apple silicon developers a practical route to local multimodal inference. The checkpoint can fit in 24 GB of unified memory for short prompts, while 32 GB leaves more room for the operating system, visual inputs, generated tokens, and the context cache.
One checkpoint, three modalities
Qwen describes the upstream checkpoint as a 27-billion-parameter dense model, meaning every token uses the full network rather than routing through a subset of experts. Its architecture combines linear-attention blocks with periodic full-attention layers, balancing long-context efficiency with conventional token-to-token attention.
- Depth: 64 transformer layers.
- Attention: 24 query heads and four key-value heads on the full-attention path, using grouped-query attention to reduce cache memory.
- Context: 262,000 native tokens, with YaRN scaling advertised for contexts beyond one million tokens.
- Vocabulary: Approximately 248,000 tokens.
- Inputs: Text, images, and video through an attached vision encoder.
- Generation: A multi-token-prediction head is included, although any decoding speed-up depends on runtime support.
The advertised context limit describes the architecture, not a promise that the full window will fit on a laptop. Key-value caches, image tokens, video frames, and generated output consume additional unified memory, so practical context lengths depend on the machine and workload.
Quantization changes the memory math
MLX affine quantization stores groups of weights at lower precision alongside scaling metadata. The 4-bit group-64 conversion reduces the roughly 55.6 GB BF16 checkpoint to about 16 GB, with reported runtime use reaching approximately 16 to 19 GB before large contexts or visual inputs add memory pressure.
| Build | Approximate footprint | Practical hardware |
|---|---|---|
| 4-bit MLX | 16 to 19 GB | 24 GB Apple silicon for short contexts; 32 GB provides more runtime headroom |
| 6-bit MLX | 21 to 22 GB | 32 GB Apple silicon |
| 8-bit MLX | 27 to 30 GB | 48 GB Apple silicon or higher |
| BF16 | 55.6 GB checkpoint, plus runtime overhead | High-memory Max or Ultra systems, or multi-GPU servers |
Actual use varies with prompt length, cache implementation, image resolution, video sampling, and output length. macOS also shares unified memory with applications and system services, making checkpoint size alone an unreliable capacity estimate.
The weights retain the upstream Apache 2.0 license, which permits commercial use, modification, and redistribution under its notice and license requirements. Teams still need separate policies for input data, generated content, and any tools the model can invoke.
Run it with mlx-vlm
Inference uses mlx-vlm, the MLX package for vision-language models. After installing it in a virtual environment, the command-line interface can process a local image with the following command:
pip install -U mlx-vlm
python -m mlx_vlm.generate \
--model mlx-community/Qwen3.8-27B-4bit \
--max-tokens 100 \
--temperature 0.0 \
--prompt "Describe this image." \
--image path/to/img.jpg
Python applications use the same loader, processor, and chat-template utilities:
from mlx_vlm import generate, load
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_id = "mlx-community/Qwen3.8-27B-4bit"
model, processor = load(model_id)
config = load_config(model_id)
prompt = apply_chat_template(
processor,
config,
"Describe this image.",
num_images=1,
)
images = [
"http://images.cocodataset.org/val2017/000000039769.jpg"
]
response = generate(
model,
processor,
prompt,
images,
)
print(response)
The first load downloads the checkpoint into the Hugging Face cache, so the machine needs additional disk space beyond the active runtime allocation. Local file paths keep image data on the machine; the example URL requires a network request.
Workloads that fit the model
The upstream model card promotes Qwen3.8-27B for coding, visual understanding, reasoning, and office-document tasks. The MLX conversion preserves those capabilities while trading some numerical precision for a smaller footprint.
- Documents and screenshots: Extract text, explain interfaces, summarize pages, and answer questions about rendered content. OCR output should be verified when exact transcription matters.
- Images and video: Describe scenes, compare visual details, and answer questions about sampled video frames within available memory.
- Visual coding: Interpret error screenshots, architecture diagrams, dashboards, and UI mockups alongside text prompts.
- Tool requests: Produce Hermes-compatible structured calls for a host application to parse and execute.
- Reasoning controls: Use the chat template’s
think_onandthink_offcontrols to adjust reasoning output and token use.
Tool calling still requires application code around the model. The host must define available tools, validate arguments, restrict permissions, execute approved calls, and return results to the conversation. Operations with side effects should require explicit authorization.
Serving support still has gaps
A version-specific setup report found that direct text and image generation worked through mlx-vlm, while serving through vllm-mlx required patches. The reported failures came from model detection and compatibility with changed video APIs.
| Path | Reported status | Technical issue | Developer action |
|---|---|---|---|
| mlx-vlm text and images | Working | Uses the model’s supported multimodal path directly | Use for local generation and pin tested package versions |
| vllm-mlx OpenAI endpoint | Patch required | The detector set MLLM=False because the model name matched none of its hardcoded multimodal substrings |
Update detection to inspect model configuration or recognize the model identifier |
| vllm-mlx video | Patch required | The integration imported removed symbols from mlx_vlm.video_generate; process_vision_info was also unavailable in mlx-vlm 0.6.x |
Pin compatible dependencies or update the integration to current video APIs |
The model-name failure caused vllm-mlx to flatten multimodal request parts as though the checkpoint accepted text alone. Package updates may change this behavior, so deployments should record exact mlx-vlm and vllm-mlx versions and test text, image, video, streaming, and tool-call requests before release.
Choose the runtime before the format
| Build | Format | Approximate size | Primary target |
|---|---|---|---|
| MLX 4-bit | Affine 4-bit | 16 GB | Apple silicon through mlx-vlm |
| unsloth/Qwen3.8-27B-GGUF Q4_K_M | GGUF | 17 GB | llama.cpp, Ollama, and cross-platform deployments |
| huginnfork/Qwen3.8-27B-FP8 | FP8 W8A8 | 35.8 GB | GPUs with efficient FP8 support, including H100 and Blackwell systems |
| BF16 base | BF16 safetensors | 55.6 GB | High-memory workstations and multi-GPU servers |
The runtime should drive the format choice. MLX integrates closely with Apple silicon, GGUF serves a broader range of local hardware, FP8 targets supported data-center GPUs, and BF16 provides the unquantized reference at the highest memory cost.
Measure the 4-bit trade-off
The upstream FP8 evaluation reports perplexity of 6.9416 for BF16, 6.9539 for Qwen’s official FP8 build, and 6.9325 for the huginnfork FP8 recipe. Lower perplexity is better, although differences this small can reflect calibration choices or evaluation variance.
Those figures compare FP8 recipes and provide no direct measurement of the MLX 4-bit checkpoint. Production evaluation should cover the intended prompts, visual inputs, structured tool calls, long-context behavior, latency, peak memory, and output accuracy against BF16 or another accepted baseline.