Run a Local AI Coding Agent on Your Mac (Ollama, LM Studio)
Set up Ollama, LM Studio or MLX on your Mac, pick an agent that accepts local models, and learn the real limits on tool calling, context and memory.
GuideUpdated 10 min read
On this page
A local coding agent on a Mac needs three parts: a model server, a model that supports tool calling, and an agent that lets you choose its model. Start the server first. Ollama listens on localhost:11434, LM Studio on :1234, and MLX's mlx_lm.server on :8080. Then download a model and point the agent at that address. OpenCode, Goose, Aider and Crush take a model you choose, and so does the native agent in our app Sledbot (sled chat).
A local model keeps inference on your Mac and costs nothing per token. Two things limit it: your Mac's memory, and how well the model you pick handles multi-step tool use.
What you need to run a local coding agent
Ideally, a Mac with Apple silicon. MLX is built for Apple silicon, and LM Studio has no Intel Mac build. Ollama also installs on Intel Macs, but one source says it runs models on the CPU only on those Macs.
Enough memory. On Apple silicon the model loads into unified memory. macOS, your editor, your browser and the agent all share that memory. Third-party sources cite about 4 GB of RAM for a 3B-parameter model and about 8 GB for a 7B model. LM Studio recommends 16 GB or more and says 8 GB Macs are limited to smaller models. To check your Mac, choose Apple menu ▸ About This Mac and look at Memory and Chip (Intel Macs show Processor).
macOS 14 Sonoma or later if you plan to use LM Studio or Sledbot. Both require it.
A model server. This program loads the model and answers requests through an HTTP API on localhost. The agent talks to it the same way it would talk to a cloud provider.
| Model server | Default address | Macs | Cost (as of November 2026) | Good to know |
|---|---|---|---|---|
| Ollama | localhost:11434 | Apple silicon and Intel (CPU only on Intel, per one source) | Free for local use, MIT licence | Simple CLI; optional paid cloud plans |
| LM Studio | localhost:1234 | Apple silicon only, macOS 14+ | Free for home and work use | Desktop app for finding and downloading models; llama.cpp and MLX engines; OpenAI-compatible API |
MLX (mlx_lm.server) | localhost:8080 | Apple silicon only | Free, open source | Apple's machine learning framework, run from Python |
Set up Ollama, LM Studio or MLX
Pick one. If you have never run a local model before, Ollama or LM Studio will get you there faster.
Ollama
Download the app from ollama.com, or install it with Homebrew:
bash brew install ollamaThis installs the
ollamacommand. To undo it, runbrew uninstall ollama.If you installed with Homebrew and nothing answers on port 11434, start the server in a Terminal window and leave the window open:
bash ollama serveThis runs the Ollama server in the foreground. Press Control-C (
⌃C) to stop it.Download a model. Pick one whose description says it supports tool calling:
bash ollama pull <model>This saves the model on your Mac. To delete it later and get the disk space back, run
ollama rm <model>.Check that the server answers:
bash curl http://localhost:11434The reply should be "Ollama is running".
LM Studio
- Download LM Studio from lmstudio.ai and move it to your Applications folder.
- Search for a model in the app and download it. Choose a size that fits your memory.
- Load the model and turn on LM Studio's local server. By default it listens on port 1234 and serves an OpenAI-compatible API.
LM Studio also comes with a CLI and a headless daemon, so the server can keep running when the main window is closed.
MLX
In a Python environment, install the MLX language model package:
bash pip install mlx-lmThis installs
mlx_lmand itsmlx_lm.servercommand. To undo it, runpip uninstall mlx-lm.Start the server with an MLX-format model from Hugging Face:
bash mlx_lm.server --model <model-id>The model downloads the first time you use it, and the server listens on port 8080. Press
⌃Cto stop it.
llama.cpp's server and LocalAI also use port 8080 by default. Run only one of them on 8080 at a time, or move one of them to another port.
Agents that accept a local model
Many coding agents only use their vendor's models. These ones let you choose:
| Agent | Model choice | Notes (as of November 2026) |
|---|---|---|
Sledbot native agent (sled chat) | Any API-key or local model: Ollama, LM Studio, MLX, llama.cpp, vLLM, Jan, LocalAI, custom endpoints | Part of MacSuite ($349 one-time). Every tool call goes through approval rules; has Plan mode |
| OpenCode | Any model | Made by SST; has build and plan agents |
| Goose | Any LLM, including local Ollama models (per a third-party tutorial) | Free, open source. CLI and desktop app, MCP extensions. Block gave it to the Linux Foundation's Agentic AI Foundation |
| Aider | Any model you configure | Free, open source. Git-native: edits files and auto-commits in your repo. Needs Python tooling. Last confirmed release is v0.86.0 (2025-08-09), so its maintenance status is unclear |
| Crush | Many providers | Terminal UI from Charm. LSP tools, MCP and skills; still on 0.x versions |
Sledbot runs Claude Code, Codex, Gemini CLI, Copilot CLI and the other vendor CLIs through their own logins. It doesn't tag them as accepting any model, so New task shows no model chip for them. If you want a local model inside Sledbot, those agents won't give you one.
If one agent in one terminal is all you need, any tool in this table will do, and Goose and Aider are free. Sledbot is worth adding when you want to run several agents at once, each in its own git worktree, with approvals, a review screen, and agents that keep running after you quit the app. For more options, see the best free and open-source coding agents. If you're deciding between those two, read OpenCode vs Claude Code.
Connect a local model to Sledbot's native agent
Start your model server first. Then:
- Open Settings with
⌘,(Command-Comma) and choose Providers. - In the Local group, select Ollama, LM Studio or MLX. Sledbot looks for the server and shows "Detected on …" or "Nothing is running on …". If you started the server after opening the pane, click Check again.
- Turn on Enabled. Model pickers hide disabled providers.
- Under Models, click Refresh to load the models your server has.
- Click Test. You should see "Connected (N models)". Then click Save.
- Press
⌘T(Command-T) to open New task. - Set the agent chip to Sledbot. Then open the model chip (Search models) and pick your local model.
- Describe the task and press
⌘↩(Command-Return) to start.


In a git repository, Work in a new worktree is on by default. The agent works in a separate checkout on its own branch, so your files stay as they are until you review and merge its changes.
If your server uses another port or another machine, open the provider's Advanced section and change Base URL. The Local group also lists llama.cpp server (:8080), vLLM (:8000), Jan (:1337) and LocalAI (:8080). For any other server, click Add custom endpoint…, set Compatible with to OpenAI, and fill in Name and Base URL. Turn on Runs on my machine (no internet needed) and click Add.
From a terminal. Every Sledbot terminal already has sled on its PATH. To use it in other terminals, go to Settings ▸ General ▸ Command line ▸ sled command and click Install…. Then run:
sled chat --model provider/modelThis opens the native agent's full-screen chat with the model you name. If you leave out --model, it tries $SLED_CHAT_MODEL, then the last model you used, then the first tool-capable model of an enabled provider. To change models inside the chat, type /model.
As a teammate. In Team, open a teammate's Settings, set Runs as to Native agent (API key or local model), and choose the Model. That teammate's tasks and routines then run on your local model.
Every native agent tool call goes through Sledbot's approval rules, and edits outside the working folder always ask first. Its shell commands run where you can see them, in a terminal named "agent: …". All the provider settings are covered in AI providers, accounts and fallback.
Plan mode, turn limits and context size
Plan mode. The native agent has two modes. Build has every tool. Plan is read-only: the agent can read, list and search files, look at git status and git diff, fetch web pages and keep a todo list, but it can't edit files or run commands. Start it with sled chat --plan, or press Tab in the chat to switch modes. This is a low-risk way to see whether a model understands your code before you let it change anything.
Turn limit. A run stops after 60 turns with "Reached the turn limit (60). Send a message to continue." A model that keeps retrying failed tool calls uses up turns faster.
Context window. The agent compacts the conversation when it reaches 75% of the model's context window. You can also compact it yourself with /compact. Each call asks for up to 16,384 output tokens, and read_file returns up to 2,000 lines per call. On a real codebase, a small context window fills fast, so the agent compacts often and can lose earlier details. Your server may load the model with a shorter context than the model's maximum, so check that setting. Keep tasks narrow, for example "fix the failing test in auth/" rather than "clean up the project".
Undo. In a git repository, /undo puts your files back the way they were before the last turn.
Run unattended tasks on local models
There is no per-token bill, which makes a local model a good fit for long jobs you don't watch.
Night shift. In Sledbot, open Jobs ▸ Night shift to give an agent a checklist for the night. An item counts as done when its own verify commands pass. Night shift runs only on a local model (Ollama, LM Studio or MLX) or on an API key with a confirmed spend limit. It never runs on a Claude subscription. Web tools and MCP servers must be off. The scheduler runs inside the app, so keep Sledbot open and the Mac plugged in. The Mac won't idle-sleep during the window. In the morning, a digest shows the review queue and any questions the agents parked for you. Setup is in Delegated jobs and Night shift.
Routines. A native-runtime teammate on a local model can run routines on a schedule ("weekdays at 9") or when a GitHub event happens. A routine that runs on this Mac needs the Mac awake. Each routine's If a run is missed setting chooses between Skip it and Run once when back. To stop the Mac from sleeping, see keeping your Mac awake while coding agents work.
Fallback. A native-runtime teammate has a Fallback list. If a model hits a usage limit or returns HTTP 429, the agent moves on to the next model in the list. A local model can be the last entry, so work continues when a hosted API runs out.
Limits: tool calling and Apple's on-device model
Tool calling matters most. A coding agent works by calling tools: it reads a file, edits it, then runs the tests. A model that wasn't trained for tool use can't drive those tools, and models differ a lot in how reliably they follow tool formats. Before you trust a model with a night shift, try it on a small task in Plan mode.
Speed depends on your hardware. Your chip and memory set how fast the model generates text. Other apps competing for memory slow it down too.
Apple's on-device model can't run the agent. Apple on-device appears in the Providers pane, but the native agent doesn't support it ("Apple on-device models are not supported by the native agent yet"). Sledbot uses Apple's model for one thing only: drafting commit messages on macOS 26 Tahoe with Apple Intelligence turned on.
If it doesn't work
- "Nothing is running on …" or "Not running at
<url>". The server isn't running, or it uses another port. Start it and click Check again, or correct Base URL under Advanced. - The model list is empty, or New task says "No models yet." Either no model is downloaded or the provider is off. Download a model in your server, turn on Enabled, and click Refresh under Models.
- New task has no model chip. The selected agent doesn't take a model. Switch the agent to Sledbot, OpenCode, Goose, Aider or Crush.
sled chatsays "No model configured." Name the model with--model provider/model, or setSLED_CHAT_MODEL. Also make sure the provider is enabled.- The wrong server answers on port 8080. MLX, llama.cpp server and LocalAI all default to 8080. Stop the one you aren't using, or move it to another port and update Base URL.
- "Plan mode is read-only: X is not available…". Press Tab in
sled chatto switch to Build mode. - Night shift won't accept the route. It only accepts local models or API keys with a confirmed spend limit. Pick your Ollama, LM Studio or MLX model as the route.
For other errors, see Troubleshooting Sledbot.
FAQ
Does my code leave my Mac when I use a local model? Inference stays on your Mac, or on whatever machine your Base URL points to. Sledbot has no telemetry. It does download the models.dev model catalogue once a week (turn that off with SLED_NO_NETWORK=1), and it checks its licence and looks for updates. The native agent's web_fetch tool only reaches the web when the agent calls it, and your approval rules apply.
Is a local coding agent free? Ollama (for local use), LM Studio, MLX, Goose and Aider cost nothing, so what you pay for is the hardware and electricity. Sledbot is part of MacSuite, a $349 one-time purchase as of November 2026. Each app has a 7-day free trial.
Can Claude Code or Codex use my local model in Sledbot? Not through Sledbot. It launches them with their own logins and shows no model chip for them. Use Sledbot's native agent or another agent that accepts any model.