I was keen on trying local models with Xcode agents after watching the WWDC 2026 session Run Local agentic AI on the Mac using MLX
https://developer.apple.com/videos/play/wwdc2026/232/
Ran into a few issues while following the three setup steps shown in the session, so I put together a small project with the workarounds I used:
https://github.com/jdhark-com/opencode_mlx_bridge/
I needed to use another model than the one demonstrated. The main issue I hit was that running:
mlx_lm.server --model mlx-community/gemma-4-e4b-it-4bit
failed with:
ValueError: Received 126 parameters not in model
The workaround in start_xcode_server.py is to load the model with strict=False which resolved the issue for me.
opencode.json prompt config really helped to get more verbose feedback from the model.
Hopefully this helps anyone else trying to get a local MLX model working as an Xcode agent.