preethamBelweave/macos-ax-agent-qwen3-4b
macOS AX-Agent (Qwen3-4B)
A small, state-of-the-art-for-its-size text-only computer-use agent fine-tuned for macOS automation. Given a natural-language task and the current screen as a linearized macOS Accessibility tree, it emits the next GUI action as a single JSON object — no vision needed.
This is the approach used by production macOS agents (macos-use, OpenClaw-style harnesses): the macOS Accessibility API already exposes a high-quality UI tree, so a small text model can ground reliably at 4B scale.
Model summary
Why "SOTA for its size"
The macOSWorld / MacArena benchmarks report open-source small agents below 5% success on macOS tasks while proprietary CUAs reach ~30%. This model targets the missing middle: a ~2.5 GB local model that grounds AX-tree→action reliably. On the held-out next-action eval split (283 steps, no trajectory overlap with training):
Held-out next-action eval: 40 steps (first 40 of the 283-step valid split, split by trajectory). Checkpoints benchmarked in parallel during training; best checkpoint selected by validation. Full 100-step comparison numbers added after final eval.
Quick start (mlx-lm)
pip install mlx-lm
python -c "
from mlx_lm import load, generate
m, t = load('preethamBelweave/macos-ax-agent-qwen3-4b/mlx-4bit')
msgs = [
{'role':'system','content': SYSTEM_PROMPT}, # see model card / prep script
{'role':'user','content': 'TASK: ...\nCURRENT SCREEN (accessibility tree):\n...'},
]
print(generate(m, t, prompt=t.apply_chat_template(msgs, add_generation_prompt=True), max_tokens=64))
"The output is one JSON action, e.g. {"action":"click","x":0.62,"y":0.41}. Coordinates are normalized to the screen (0..1); multiply by screen width/height to get pixels, then feed the action to your agent harness (pyautogui / AppleScript / AX press).
Training data & reproducibility
- Data conversion script:
scripts/prep_data.py(in the dataset repo) - LoRA adapter + adapter config:
./lora/ - Trained with
mlx_lm lora(see adapter config for exact hyperparameters)
Limitations
- Trained on cross-platform computer-use trajectories (OSWorld), not real macOS captures; AX-tree format is identical on macOS, but app-specific quirks may differ.
- One action at a time; long-horizon planning is left to the agent harness.
- English only.
