The question
Running an AI coding agent in a VM is the obvious way to isolate it: its own filesystem, its own blast radius, nothing to clean up afterwards. On Apple silicon that hits a wall. Apple's Virtualization.framework doesn't give a Linux guest the Mac's GPU, so a model loaded inside the VM runs on the CPU. Velo Workspaces' answer is AI Bridge, a vsock channel that lets the VM reach a model server on the Mac's GPU, appearing inside the guest as an ordinary OpenAI-compatible endpoint.
If you're going to rely on that every day, the question is what the channel costs. I ran three benchmarks at three scales against MLX, Apple's array framework, running natively on the Metal GPU with mlx_lm.server:
- Single-request speed: time to first token and sustained throughput
- Concurrent load: eight parallel requests, wall-clock time
- A real agentic coding loop: a coding agent (OpenCode) writing and running code against the model, end to end
Setup
- Host: Mac mini, Apple M4, 10 cores, 16 GB RAM, macOS 26.6.2
- Guest: Ubuntu Server 26.04 LTS VM, 4 vCPU, 4 GB RAM, AI Sandbox profile
- Model:
mlx-community/Qwen2.5-Coder-7B-Instruct-4bit, served bymlx_lm.serveron the host - Protocol: before every run, all VMs were stopped and the model server restarted fresh, to rule out contention left over from the previous run.
Tools
Open source: veloworkspace-tools, with ai_perf_test.py, ai_load_test.py and opencode_perf_test.py.
Results
Single-request speed (average of 5 runs)
Click to enlarge
About 1% either way, which is within normal run-to-run noise. The VM boundary has no measurable cost here.
Concurrent load (8 parallel clients, average of 4 runs)
Click to enlarge
The VM trails the host by a few percent, consistently across all four runs: small, but real rather than noise.
Agentic loop (OpenCode, 5 iterations per task, mean)
Click to enlarge
The same pattern: the VM trails by about 1–5% on all three tasks, with tight variance (a standard deviation under 0.2 s on every task), so it's a repeatable, low-noise gap rather than one odd run.
Conclusion
For single requests, sending inference through a vsock proxy into a VM costs nothing measurable. Under concurrent load and in a real agent workflow there's a small, consistent gap in the low single digits rather than perfect parity, and it's worth stating that precisely rather than rounding it to zero.
In practice: if you run an AI coding agent in a disposable Linux VM to keep it off your Mac's files, and reach a model served by MLX on your Mac's GPU, you aren't giving up meaningful inference speed for the isolation. The vsock hop AI Bridge adds is close to free.
Raw output, methodology notes and the scripts are in the repository if you want to reproduce this with another model or Mac. These numbers are specific to this hardware, model and workload, and won't necessarily hold for a 70B model or an 8 GB Mac.
An earlier run of the same tests with Ollama instead of MLX came out differently under load. What sandboxing costs across both engines covers the discrepancy and my best theory for it. To set this up yourself, the MLX guide walks through it.
Appendix: raw test output
Terminal output from each test, host and VM side by side.
Single-request speed test
Concurrent load test
Agentic-loop latency test (OpenCode)