Run this model with HF Jobs
Run KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP 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("KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP") config = load_config("KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP") # 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 KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP"
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": "KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP 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 "KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP"
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 KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP"
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 "KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP" \ --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"
KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP
This repository provides an optimized, quantized release of Qwen/Qwen4-35B-A3B tailored for Apple Silicon using MLX and oMLX.
This model features advanced oQ6e quantization guided by an importance matrix (imatrix) to minimize accuracy degradation while delivering top-tier inference throughput on Apple unified memory architectures. Multi-Token Prediction (MTP) modules are preserved to support accelerated generation via speculative decoding.
Highlights
The model builds upon the foundation of Qwen4-35B-A3B, combining vision-language processing with a high-efficiency Mixture-of-Experts (MoE) architecture.
It activates approximately 3 billion parameters per token out of 35 billion total parameters, maintaining high compute efficiency and low memory bandwidth pressure.
The oQ6e imatrix quantization scheme delivers near-unquantized (FP16/BF16) fidelity across reasoning, coding, and structured vision-language benchmarks, while saving significant VRAM over 8-bit alternatives.
The conversion retains native MTP (Multi-Token Prediction) support, allowing compatible runtimes to achieve significant speedups through speculative decoding.
Benchmark Results
1. Terminal Bench 4.1, FrontierCode-AA 2.0, AA-Briefcase v1.1 and AutomationBench-AA: Scores are cited from Artificial Analysis.
2. APEX-Agents v1.1: Scores are cited from the Mercor leaderboard.
3. Work360: Our built-in benchmark for evaluating models' capabilities across industrial and professional workflows.
4. ChartoGraphy: The scores of our models were obtained with min_pixels set to 4096ร32ร32.
Recommended Sampling Parameters
We recommend using the following sets of sampling parameters for generation:
- Thinking Mode:
temperature=1.0,top_p=0.95,top_k=20,min_p=0.0,presence_penalty=0.0,repetition_penalty=1.0- Non-thinking Mode:
temperature=0.7,top_p=0.80,top_k=20,min_p=0.0,presence_penalty=1.5,repetition_penalty=1.0
Hardware Requirements
Thanks to the 6-bit (oQ6e) quantized footprint, Apple Silicon devices offer near-lossless output with optimized memory usage:
- Minimum: 36 GB Unified Memory (suited for standard context lengths and moderate multimodal tasks).
- Recommended: 48 GB to 64 GB+ Unified Memory (recommended for long-context generation up to 128k tokens, multi-image processing, and high concurrent throughput).
Quickstart & Installation
Make sure your environment has the latest MLX vision and runtime libraries installed:
pip install -U mlx-vlm mlx omlx
Running in oMLX Desktop
You can run this model directly in the oMLX Desktop application for a graphical chat interface with native Apple Silicon acceleration and MTP speculative decoding:
- Add Model: Open oMLX Desktop, navigate to the Models tab, and click Add Model / Download from Hugging Face.
- Repository ID: Enter:
KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP - MTP & Settings: Under model configuration, ensure Multi-Token Prediction (MTP) or Speculative Decoding is enabled to take full advantage of accelerated token throughput.
- Chat & Vision: Open a new chat session, select this model, and start chatting or drag and drop images directly into the chat window.
Usage via CLI
You can quickly run inference from your terminal using mlx_vlm.generate:
python -m mlx_vlm.generate \
--model KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP \
--image "https://picsum.photos/id/237/600/400" \
--prompt "Describe this image in detail." \
--max-tokens 512
Python API Example
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_image
model_path = "KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP"
# Load model and processor
model, processor = load(model_path)
# Prepare multimodal input
image_url = "https://picsum.photos/id/237/600/400"
image = load_image(image_url)
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": "Describe what you see in this image."}
]
}
]
prompt = apply_chat_template(processor, model.config, messages)
output = generate(
model=model,
processor=processor,
prompt=prompt,
images=[image],
max_tokens=512,
verbose=True
)
print(output)
Quantization Details
- Toolkit: Converted and quantized using oMLX.
- Quantization Scheme: oQ6e (optimized 6-bit weight quantization).
- Importance Matrix (imatrix): Computed to safeguard critical routing weights, vision-projection components, and code/reasoning representations.
- MTP Integration: Multi-Token Prediction heads are fully preserved for speculative execution.
License
This model is distributed under the Apache 2.0 license, inheriting the terms of the base model Qwen/Qwen4-35B-A3B.
- Downloads last month
- -
6-bit
Model tree for KeyAI-LLM/Qwen4-35B-A3B-oQ6e-MLX-MTP
Base model
Qwen/Qwen4-35B-A3B