Instructions to use drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit") config = load_config("drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Qwen-Drive-1.0-4B VLM · MLX 8-bit
The vision-language model inside Qwen/Qwen-Drive-1.0-4B, converted to MLX and quantized to 8 bits for Apple-silicon Macs. It answers questions about driving images, which is the VQA mode of Qwen-Drive-1.0.
Also available: bf16 (8.5 GB), which reproduces the original weights exactly, and 4-bit (2.8 GB, feature extraction only).
Only the VLM. Qwen-Drive-1.0 has three parts: the Qwen3.5-4B VLM, a Planning Expert (trajectories) and a BEV perception head (3D boxes, occupancy, map). This repository contains the VLM only. The other two run on a Mac either through PyTorch's MPS backend (
apple-siliconbranch) or in MLX, which reads this model for its features and is about twice as fast (mlx-portbranch).Not for driving decisions. Research and demonstration only. Answers can be wrong.
Use
pip install "mlx-vlm==0.6.0"
mlx_vlm.generate --model drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit \
--image front.jpg --prompt "What should the ego vehicle do next?" \
--max-tokens 400 --temperature 0
The CLI prints an empty thinking block (</think>) before the answer.
import re
from mlx_vlm import apply_chat_template, generate, load
from mlx_vlm.utils import load_config
path = "drivetechodyssey/Qwen-Drive-1.0-4B-VLM-mlx-8bit"
model, processor = load(path)
config = load_config(path)
prompt = apply_chat_template(processor, config, "What should the ego vehicle do next?",
num_images=1, enable_thinking=False)
result = generate(model, processor, prompt, image=["front.jpg"], max_tokens=400, temperature=0.0)
# the answer starts with an empty <think></think> block
print(re.sub(r"^\s*<think>.*?</think>\s*", "", result.text, flags=re.S))
How it was made
- Extract the VLM. Every VLM tensor in the original
model.safetensorsstarts withvlm.; the prefix is removed (723 tensors;lm_headis tied to the embeddings).config.jsonis the originalvlm_config, withvision_config.model_typeset toqwen3_5because mlx-vlm 0.6.0 does not acceptqwen3_5_vision. Tokenizer, processor and chat-template files are copied unchanged. - Convert.
mlx_vlm.convert --dtype bfloat16 -q --q-bits 8 --q-group-size 64(affine). - Restore float32 norms. The original keeps each linear-attention layer's
A_logandnorm.weightin float32 (48 tensors). The converter keptA_logbut cast the 24norm.weighttensors to bf16, which made long greedy answers drift from the original after roughly 700 characters. Those 24 tensors are copied back from the original checkpoint.
Checks
Measured on an M5 Max (64 GB) with mlx 0.31.2 and mlx-vlm 0.6.0, greedy decoding, nothing else using the GPU. 16 images from the original repository's demo data (the current front, front-left and front-right frames of the four planning scenes, plus four front frames from the perception demo) × 3 questions: a long English scene description (400 tokens), a one-sentence hazard, and two or three sentences in Korean.
| original weights in mlx-vlm | bf16 | 8-bit (this repo) | |
|---|---|---|---|
| Answers identical to bf16 (of 48) | 48 | 48 | 20 |
| Mean character similarity to bf16 | 1.00 | 1.00 | 0.76 |
| Answers with another script mixed in | 1 | 1 | 1 (the same one) |
| Repetition loops | 0 | 0 | 0 |
| Generation speed, median of two passes | 53 tok/s | 55 / 53 tok/s | 96 tok/s |
| Prompt processing, median | 2,815 tok/s | 2,511 tok/s | 1,960 tok/s |
| Peak memory | 10.8 GB | 10.8 GB | 7.8 GB |
Where the 8-bit one-sentence hazards differ from bf16, they were checked against the images: the differences are rewordings, with no invented objects or wrong positions.
A 4-bit version (2.8 GB, 147 tok/s) is published for feature extraction only, not for answering questions: none of its 48 answers matched bf16 (mean similarity 0.44), and on three of the sixteen images it reported a pedestrian crossing that is not there.
Behaviour of the model itself, in bf16 as well: a Korean answer occasionally contains a Chinese
word (1 of 16 here, 신호灯的).
Perception and planning also read this model
The perception head and the Planning Expert do not read the model's words. They read the pre-merge vision patches, the image-token hidden states and the full-attention K/V cache. Scored against this repository's demo ground truth, the choice of precision makes no difference there, which is not true of the answers above:
| Feature source | bf16 | 8-bit | 4-bit |
|---|---|---|---|
| Detection recall / precision at 2 m | 0.683 / 0.638 | 0.683 / 0.639 | 0.683 / 0.637 |
| Occupancy mIoU / map mIoU | 0.361 / 0.688 | 0.362 / 0.688 | 0.363 / 0.688 |
| Planning ADE, direct / with reasoning | 0.377 / 0.387 m | 0.376 / 0.380 m | 0.373 / 0.388 m |
Prompt processing runs at the same speed at every precision (1.9 to 3.0 k tok/s), so a smaller
conversion saves memory there rather than time. The MLX implementation of both heads is in the
mlx-port branch.
License and citation
Apache License 2.0, the same as the original (see LICENSE). The weights are the Qwen team's
(Alibaba Group); this repository only changes their format as described above.
@misc{zhou2026qwendrive10initialstepvisionlanguage,
title={Qwen-Drive-1.0: An Initial Step towards a Vision-Language Foundation Model for Autonomous Driving},
author={Xin Zhou and Zongchuang Zhao and Zhibo Yang and Mingsheng Li and Humen Zhong and Shuai Bai and Du Chu and Ruizhe Chen and Zhaohai Li and Jun Tang and Qiuyue Wang and Mingkun Yang and Jiazhao Zhang and Dayiheng Liu and Dingkang Liang and Xiang Bai},
year={2026},
eprint={2609.00111},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2609.00111},
}
- Downloads last month
- 118
8-bit