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 by mlx_lm.server on 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)

Bar chart comparing host vs VM single-request speed. Time to first token: 172.21 ms on host vs 174.27 ms via AI Bridge (+1%). Throughput: 24.09 tokens/sec on host vs 23.88 tokens/sec via AI Bridge (-1%).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)

Bar chart comparing host vs VM under 8-client concurrent load. Total wall time: 7.04 seconds on host vs 7.38 seconds via AI Bridge. Average per-client time: 6.24 seconds on host vs 6.39 seconds via AI Bridge.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)

Bar chart comparing host vs VM on three OpenCode agentic tasks. Math computation: 8.40s host vs 8.82s VM. System info: 4.50s host vs 4.55s VM. File I/O: 5.58s host vs 5.70s VM.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

Terminal output: ai_perf_test.py running on the host, showing average TTFT 172.21 ms and average throughput 24.09 tokens/sec. Terminal output: ai_perf_test.py running inside the VM over AI Bridge, showing average TTFT 174.27 ms and average throughput 23.88 tokens/sec.

Concurrent load test

Terminal output: ai_load_test.py running on the host with 8 parallel clients, total wall time 7.04s, avg client time 6.24s. Terminal output: ai_load_test.py running inside the VM over AI Bridge with 8 parallel clients, total wall time 7.38s, avg client time 6.39s.

Agentic-loop latency test (OpenCode)

Terminal output: opencode_perf_test.py running on the host, showing mean times of 8.40s, 4.50s, and 5.58s for the three tasks. Terminal output: opencode_perf_test.py running inside the VM over AI Bridge, showing mean times of 8.82s, 4.55s, and 5.70s for the three tasks.