Executable programs and extensions

Running several coding agents at once on a Mac with Locals

Once several agents run at once, what the Mac has to carry is different

Locals is a local inference1 server for Macs from Generated Computers. It is built not for a single chat message but for what agents send: tool calls2, prompts3 that grow every turn, and many requests running at once. It opens both an OpenAI-compatible and an Ollama-compatible endpoint, so tools such as OpenCode, Cline, Aider and Claude Code connect without changes. The project reports that on an M2 Pro with 16 GB, Qwen3.5-4B went from 87 to 271 tokens4 per second with eight requests at once. With a single request it is about the same as mlx-lm5, and the project was first published on 12 October 2026.

Requirements and key details
  • A local server for the Mac that computes requests from several agents as one batch.
  • It opens OpenAI- and Ollama-compatible endpoints so existing tools work unchanged.
  • On an M2 Pro with 16 GB, eight requests at once measured 271 tokens per second.
  • With a single request it is almost identical to mlx-lm.

Several agents make a different workload from a chat box

Locals is a server that runs an AI model inside your Mac and answers requests from other programs. One terminal command starts a model that fits the Mac's memory and connects the coding agent you open in that folder. It is not a chat window; the point of the program is that throughput6 holds up when several agents send requests to the same model.

An agent does not behave like a line typed into a chat box. It calls tools to read files and run commands, and each call has to come back in the right format before the next step can start. The longer the conversation, the longer the prompt, and coding assistants start several helper agents at the same time. Inference tools built for the Mac are usually not designed around this, so overlapping requests end up slower than handling them one at a time.

A laptop screen shows a chat window, a code editor and a file list side by side, and lines from all three gather into a stack of model blocks at the bottom of the screen.
Chat, code and file work converging on one local model is the baseline once several agents run.

Install it and get the server ready

You need Apple silicon from M1 onward and macOS 14 or newer. With 16 GB the default model fits well; with 8 GB you have to choose a smaller one. Run the install script, or install it from PyPI with uv.

Install
curl -LsSf https://raw.githubusercontent.com/Generated-Computers/Locals/main/install.sh | sh
Install with uv
uv tool install --python 3.12 locals

First run inside a project folder

In a new terminal window, point it at a project folder and run it.

Open a project
locals code ~/my-project

The first run downloads a model that suits the Mac's memory (about 3 GB), starts it in the background and opens OpenCode in that folder. When the download finishes, open a file in the editor and ask for a small edit to see whether the first answer arrives. Model files and conversation history never leave the Mac.

Connect the agents you already use

After one locals setup, OpenCode lists Locals in its model picker. Tools that accept an OpenAI-compatible provider, such as VS Code extensions, Zed and JetBrains, take the server address directly.

Apps that only speak Ollama connect through locals launch ollama. Apps with Ollama support, such as Open WebUI or Raycast, need no address at all.

Values to enter when picking an OpenAI-compatible provider
SettingValue to enter
Server addresshttp://127.0.0.1:8321/v1
API keyany text (for example local)
Model namelocals/qwen3.5-4b
Context lengththe number locals launch editor prints

Run locals launch editor and it prints the address and model name for whichever model is running.

The server keeps running after you close the terminal window. Check it with locals status and stop it with locals stop. To use the same agent with another server, undo the setting with locals disconnect opencode.

Beside a monitor stands an open grey cabinet stacked with coloured blocks; conduits from the cabinet run to a stack of paper on the right, and a few matching blocks lie on the floor.
Once the model is loaded, the server outlives the terminal window, so the next request is answered without starting it again.

How much faster it gets as requests overlap

This was measured with Qwen3.5-4B in 4-bit on a MacBook Pro with an M2 Pro (19-core GPU7) and 16 GB. With one request it is close to mlx-lm; as the number of simultaneous requests grows, the gap widens.

Scroll sideways to compare all columns.

Tokens per second by number of simultaneous requests (M2 Pro, 16 GB, Qwen3.5-4B 4-bit)
Concurrent requestsmlx-lmLocalsGain
161641.0x
2821161.4x
4871601.8x
8872713.1x
161573412.2x

Conditions: MacBook Pro with M2 Pro 19-core GPU and 16 GB, Qwen3.5-4B in 4-bit, MLX8 0.32, both tools compared in the same process. Counting through the server API9 from the client instead gives 244 tokens per second at eight requests, a 3.2x gain, so the conclusion holds.

The gain comes from not computing requests separately. Requests from several agents go to the GPU as one batch and are handled in a single pass, with kernels built for that batch size10. When the model writes a tool call, the format rules are enforced on the GPU, which cuts down on retries after a malformed reply.

There is a comparison with other servers on the same terms. With 1,000-token prompts and eight requests at once, time to the first token was 1.6 s for Locals, 2.1 s for llama.cpp and 41.8 s for Ollama, at 110, 71 and 34 tokens per second.

The cases where it is not faster

Send one request with nothing to reuse and there is almost no difference: 64 tokens per second against 61 for mlx-lm on the same M2 Pro. It is faster on a single request when the reply rewrites the prompt, such as a whole-file edit, or when the prompt cache hits.

Reading a prompt is bound by the GPU's arithmetic. Eight 8,000-token prompts at once produce only 57 tokens per second, because most of the time goes into reading.

Only the kernels tuned for 4-bit affine quantization11 in groups of 64 are covered. Other formats, such as mxfp4, run at mlx-lm's speed. On the M5, MLX's own kernels already use the neural accelerators, so the gain drops to 1.5x.

Choose a model that fits the memory

One model runs at a time. Switch with a name such as locals start --model lfm, and check which one is running with locals status.

Scroll sideways to compare all columns.

File size and tokens per second by model (M2 Pro, 16 GB, eight at once)
ModelStart it withFile sizemlx-lmLocals
Qwen3.5-4B (default)--model qwen2.8GB87271
LFM2.5-2.6B--model lfm1.5GB144404
MiniCPM5-2B--model minicpm1.3GB160478
Gemma 4 E4B--model gemma4.8GB80224

These are the eight-request numbers; the default depends on the Mac's memory. Below 12 GB the default becomes Qwen3.5-2B.

With 24 GB or more you can pick Flint (40B total, 2.5B active per token). The file is 17.8 GB, and on an M4 Pro with 24 GB it measured 115 tokens per second for one request and 264 with eight at once. A 24 GB Mac sometimes gives the GPU only 16 GB, and locals start explains how to raise that.

For long work, set LOCALS_KV_BITS=8 to keep keys and values in 8 bits. For Flint that raises the request length from about 35,800 to 67,584 tokens and slows writing by 4 to 13%.

A cable runs to a Mac mini, and an open box beside it is packed with coloured blocks. Conduits from the box lead to four trays holding a network diagram, a photo, a waveform and a document.
The size of the model that fits in memory sets how many requests and how much context you can carry at once.

A young project, so check a few things

The repository was published on 12 October 2026, and the latest version on PyPI as of 25 October is 0.2.1. Command names and default models are still changing quickly, so follow the options that locals --help prints for the version you installed.

The server accepts requests only from this Mac and does not open to the outside. When locals run puts several agents on one task, each gets its own copy of the project, and the original folder changes only after the tests pass.

It detects a model that keeps calling the same tool or repeating itself and stops it, and a memory guard keeps long prompts from ending in an out-of-memory error.

It is released under Apache 2.0, and the computation is described in arXiv 2610.09139.

Terminology notes

  1. Inference — The process of using a trained model to compute an output for an input. Here, local inference means running the model on the user’s device.

    Back to the text
  2. Tool call — A structured request from a model for an external function such as reading a file, searching, or running a command. The agent runtime and its permission settings decide whether the request is actually executed.

    Back to the text
  3. Prompt — The input text sent to a model. For generative models it describes the desired result and strongly shapes the output.

    Back to the text
  4. Token — A unit into which a model divides input or output for processing.

    Back to the text
  5. MLX-LM — A package for loading, running, and fine-tuning language models with MLX.

    Back to the text
  6. Throughput — The amount of work processed or generated over time. Comparisons need the unit, such as tokens per second or requests per second.

    Back to the text
  7. GPU — A processor designed to handle many calculations in parallel. It performs model computations during AI inference.

    Back to the text
  8. MLX — Apple’s machine-learning framework, which runs models using memory shared by the CPU and GPU on Apple Silicon.

    Back to the text
  9. API — A defined interface that lets other code call a program’s functions.

    Back to the text
  10. Batch size — The number of inputs or requests processed together in one batch.

    Back to the text
  11. Quantization — A way to represent model weights or values with fewer bits, reducing storage and memory use. The coarser representation can also affect accuracy.

    Back to the text

Frequently asked questions

What should you check first in this article?
Locals is a local inference server for Macs from Generated Computers. It is built not for a single chat message but for what agents send: tool calls, prompts that grow every turn, and many requests running at once. It opens both an OpenAI-compatible and an Ollama-compatible endpoint, so tools such as OpenCode, Cline, Aider and Claude Code connect without changes. The project reports that on an M2 Pro with 16 GB, Qwen3.5-4B went from 87 to 271 tokens per second with eight requests at once. With a single request it is about the same as mlx-lm, and the project was first published on 12 October 2026.
How much memory does it need?
You need Apple silicon from M1 onward and macOS 14 or newer. With 16 GB the default model fits well; with 8 GB you have to choose a smaller one. Run the install script, or install it from PyPI with uv.