Run this model with HF Jobs
Run VisualInference/Lumine2-MLX-6bit 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/VisualInference/Lumine2-MLX-6bit. 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/VisualInference/Lumine2-MLX-6bit 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/VisualInference/Lumine2-MLX-6bit. 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 VisualInference/Lumine2-MLX-6bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use VisualInference/Lumine2-MLX-6bit 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("VisualInference/Lumine2-MLX-6bit") config = load_config("VisualInference/Lumine2-MLX-6bit") # 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 VisualInference/Lumine2-MLX-6bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "VisualInference/Lumine2-MLX-6bit"
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": "VisualInference/Lumine2-MLX-6bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use VisualInference/Lumine2-MLX-6bit 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 "VisualInference/Lumine2-MLX-6bit"
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 VisualInference/Lumine2-MLX-6bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use VisualInference/Lumine2-MLX-6bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "VisualInference/Lumine2-MLX-6bit"
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 "VisualInference/Lumine2-MLX-6bit" \ --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"
Lumine 2 for MLX, 6bit
Lumine 2 is LumineResearch's generalist game agent: a fine-tune of Qwen3.5-9B (9.7B parameters, Apache 2.0) that watches the screen and emits keyboard and mouse actions, thinking first when it needs to. This repository is a quantized build for Apple silicon in mlx-vlm format: 7.63 GiB of weights, for Macs with 16 GB of memory or more.
Every language-model linear layer, embeddings and output head at 6-bit (affine, group size 64). The vision encoder stays in bf16. Tokenizer, chat template, processor files and the five Lumine special tokens are the original files, byte for byte.
| Build | Weights | Bits per weight | Held-out loss vs original | Agent actions = original | Thoughts | Decode speed | Peak memory |
|---|---|---|---|---|---|---|---|
| original (bf16 safetensors), loaded as is | 17.98 GiB | 16 | reference (3.408 nats per token) | 6/6 | 1/6 | 23.9 tok/s | 20.59 GiB |
| 6bit (this repo) | 7.63 GiB | 6.5 | +0.047 ± 0.008 nats (+4.8% perplexity) | 6/6 | 1/6 | 55.5 tok/s | 9.84 GiB |
Long prompts with this build: 10.0 GiB peak at a 4k-token prompt and 10.5 GiB at 16k, prefill about 2,700 tokens/s, decode 57 and 55 tokens/s.
Other tiers: 5bit (coming), 8bit and bf16 from mlx-community.
All rows were measured on one MacBook Pro (M5 Max, 36 GB) with greedy decoding and mlx-vlm 0.8.2. Held-out loss is the mean per-token difference against the original on 32 × 1,024 tokens of WikiText-2 test, paired by sequence, ± one standard error. Agent actions: six steps (two upstream test frames, Cyberpunk 2077 prompts in Instant English, Instant Chinese and Adaptive Thinking modes), counted when the action equals the original's. Thoughts: how many of those steps began with a thought; the original thinks on one. Six steps separate working builds from broken ones; they are not a benchmark. Decode speed and peak memory are for a 256-token text answer. Sizes are in GiB, the unit Mac memory comes in.
Use
pip install -U "mlx-vlm>=0.8.2"
One Instant-mode step on a screenshot. The game and mode prompts are the upstream files (client/prompts); the frame is resized to 800×448 as the upstream client does.
python - <<'PY'
from urllib.request import urlopen
src = "https://raw.githubusercontent.com/LumineResearch/Lumine2/main/client/prompts/"
game = urlopen(src + "games/cyberpunk_2077_en.txt").read().decode().rstrip()
mode = urlopen(src + "modes/instant.en.txt").read().decode().strip()
open("system.txt", "w").write((game + "\n\n" + mode).replace("<instruction>", "Walk forward down the corridor by holding W."))
PY
mlx_vlm.generate --model VisualInference/Lumine2-MLX-6bit \
--image frame-800x448.png --system "$(cat system.txt)" --prompt "" \
--no-enable-thinking --temperature 0 --max-tokens 48
On the upstream corridor test frame this prints
<|action_start|>0 0 0<|action_sep|><|action_sep|><|action_sep|><|action_sep|><|action_sep|><|action_sep|> W<|action_end|>.
In Python:
from mlx_vlm import load, generate
model, processor = load("VisualInference/Lumine2-MLX-6bit")
messages = [{"role": "system", "content": open("system.txt").read()},
{"role": "user", "content": [{"type": "image"}]}]
prompt = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
out = generate(model, processor, prompt, image=["frame-800x448.png"], max_tokens=48,
temperature=0.0, skip_special_tokens=False)
print(out.text)
Settings that matter
- Keep special tokens. Actions are delimited by
<|action_start|>,<|action_sep|>and<|action_end|>, and thoughts by<|thought_start|>/<|thought_end|>. Generate withskip_special_tokens=Falseor the action cannot be parsed. - Mode. The first token decides it:
<|thought_start|>reasons first,<|action_start|>acts at once. Use the upstream mode prompts (instant,reasoning) rather than the Qwen thinking switch. - Language. Lumine2 usually thinks in Chinese even with English prompts. For English thoughts use Lumine2-EN.
- Not a chat model. It answers plain questions, but its replies carry stray
<|action_sep|>tokens. The original bf16 weights do the same; it is not a quantization artifact. - Live play needs the upstream client for screen capture, frame history (SASH) and input. This build is the model only.
Why there is no 4-bit build
The upstream corridor test is a single step where the original holds W to walk forward (log-probability margin +1.00 over doing nothing; this build +1.75). Twelve 4-bit recipes were tried: affine at group size 64 and 32, mixed 4/6-bit, AWQ, NVFP4, MXFP4, and 8-bit protection of the embeddings, linear attention, full attention or MLPs alone and in combination. Every one of them chose to do nothing (margin -1.0 to -6.8), even recipes whose held-out loss matched the original. Quantizing below 6 bits shifts this agent toward idle actions, so the smallest build here is 6-bit.
Speculative decoding
The original checkpoint bundles a one-layer MTP head. Extracted and used as a drafter with this build it accepted 39% of drafted tokens and made decoding slower (18.2 s against 14.3 s for 256 tokens on the M5 Max), so it is not included.
Not measured yet
Long-context memory with the agent's full 120-frame history: coming.
License
Apache License 2.0, as the original. LICENSE is included. Weights by the Lumine 2 contributors
(technical report).
- Downloads last month
- -
6-bit