Local LLMs on Mac: MLX, Ollama, and LM Studio

Vladimir Lomtev•
Local LLMs on Mac: MLX, Ollama, and LM Studio

The easiest way to run a local LLM on a Mac with Apple silicon is through Ollama or LM Studio, and developers also have mlx-lm. Ollama is a good choice for a quick start and API access: starting from version 0.40.0 (September 25, 2026), supported models on Apple silicon run on MLX by default. LM Studio is a graphical app with llama.cpp and MLX engines plus a local server. mlx-lm is Apple’s Python package for generation, its own server, and fine-tuning. Which model you can run is determined by unified memory capacity: on 16 GB, models up to 8–9 billion parameters run comfortably; on 32 GB, 27B-class models in 4-bit quantization; on 128 GB, gpt-oss-120b.

Prepared by Vladimir Lomtsev AI Studio November 17, 2026. Program versions and requirements are taken from the official documentation and release notes as of that date. We did not conduct our own Mac testing, so all speed figures below belong to the cited sources. Memory calculations show order-of-magnitude estimates.

Contents

What you need: which Mac and how much memory

All three tools require a Mac with Apple silicon (M1 and later):

  • Ollama requires macOS Sonoma (14) or newer. On Intel Macs, it runs only on the CPU.
  • LM Studio requires macOS 14.0 or newer and recommends at least 16 GB of memory; Intel Macs are not supported.
  • mlx-lm speeds up large models by pinning them in memory only on macOS 15 and newer.

Macs do not have separate VRAM: the CPU and GPU share unified memory. So the main question when choosing is how much memory will remain for the model after the system and open apps. A model’s size in 4-bit quantization is roughly half the number of parameters in gigabytes plus overhead. On top of that comes the KV cache, which grows with context length. The calculation is explained in detail in the article “How much VRAM do LLMs need”.

Mac memory What you can realistically run Where the figure comes from
16 GB 4–9 billion parameter models in 4-bit quantization (about 3–6 GB of weights) Calculation: parameters × ~0.5–0.6 bytes
32 GB Qwen3.8-27B in 4-bit quantization, about 17.6 GB Recommended models table Framework, UD-Q4_K_XL quant
64 GB MoE models around 120 billion parameters in 3-bit quantization (Qwen3.5-122B-A10B Q3_K_S — 52.5 GB) The same Framework table; memory headroom on Mac is minimal
128 GB gpt-oss-120b (file about 64 GB), Qwen3.5-122B-A10B in 4-bit quantization (peak 72–76 GB) Measurements on MacBook Pro M5 Max, Hardware Corner
256–512 GB Qwen3.8 Flash-Next in 4-bit quantization (process peak 155 GB), GLM-5.3-Flash Mac Studio M5 Ultra 256 GB review, MacStories

If you are just choosing a computer, start with the model that solves your task, not the other way around. We covered how to match a model to a hardware class in the guide “Which model should you choose for local inference”. A comparison of Mac Studio with DGX Spark and an AMD Strix Halo mini PC is in a separate article in our local hardware series.

MLX, GGUF, and Metal: what’s the difference

On Mac, language models run through two main stacks.

MLX is Apple’s machine learning framework for Apple silicon. Models for it are stored in safetensors format with MLX quantization; thousands of ready-made conversions live in the mlx-community organization on Hugging Face. On top of MLX run mlx-lm, the MLX engine in LM Studio, and, since 2026, the main inference path in Ollama.

llama.cpp with the Metal backend uses the GGUF format. This is the most common format for open models: almost any model from Hugging Face can be found in GGUF at different quantization levels. We described how GGUF files are quantized and selected in the article about quantization in practice.

Why MLX is better on newer chips. On M5, M5 Pro, and M5 Max chips, each GPU core includes Neural Accelerators. According to Ollama, the MLX engine uses them to reduce time to first token and speed up generation. In Apple’s Mac Studio press release , Apple says prompt processing in LM Studio on M5 Max is up to 3.9 times faster than on M4 Max. These are Apple’s figures, not an independent benchmark.

Practical takeaway: if a model is available in MLX format and your tool supports it, start with MLX. Save GGUF and llama.cpp for models and quantizations that are not available in MLX, or when you need the same stack on a Mac and a Linux server.

Ollama on Mac: quick start and API

Ollama is the shortest path from installation to a working API. Installation comes as the ollama.dmg image from the project website, the app is moved to Applications, and on first launch it adds the ollama command to PATH.

What changed in 2026:

  • March 30 saw the release of preview 0.19 with an MLX engine for Apple silicon. At the time, it required a Mac with more than 32 GB of memory (Ollama blog.
  • May 13, in version 0.30.0, the llama.cpp engine was updated: it complements MLX and adds support for GGUF models from Hugging Face and custom fine-tuned models.
  • September 25, in version 0.40.0, models with architectures supported by MLX started to run on MLX by default. These include qwen3.8, gemma4, qwen3.6, qwen3.5, and the embedding model embeddinggemma-2.
  • November 9, in version 0.40.16, Qwen3.8 Flash Next started using about 27 GiB less memory on Apple silicon.
  • November 10 in the preview version 0.40.17-rc1 , parallel generation on MLX became available. You should not rely on it for production use before the stable release.

Basic commands:

ollama pull qwen3.8
ollama run qwen3.8
ollama ps
curl http://localhost:11434/api/chat -d '{"model": "qwen3.8", "messages": [{"role": "user", "content": "In short: what is a KV cache?"}], "stream": false}'

By default, the server listens on 127.0.0.1:11434, and the model stays in memory for 5 minutes after the last request (Ollama FAQ). To allow access from your local network, set the environment variable using launchctl and restart the app:

launchctl setenv OLLAMA_HOST "0.0.0.0:11434"

Ollama does not have built-in authentication. You should not expose the port to the network without a reverse proxy with access controls. Logs are stored in ~/.ollama/logs.

What to watch for when updating. Starting with version 0.40.14 (November 3), OpenAI-compatible endpoints no longer default temperature and top_p to 1.0 if the client does not send them: values are taken from the model package, as in /api/chat. If responses through the OpenAI API changed after updating, set the sampling parameters explicitly in the request. Step-by-step Ollama installation and setup are in our Ollama guide.

LM Studio: user interface and engine selection

LM Studio is a good fit for anyone who wants to choose models, quantization, and load settings without the command line. The app has two main engines: llama.cpp for GGUF and MLX for models in MLX format. The model download page shows which format it is being downloaded in.

Current status from the changelog:

  • latest version is 0.4.28, released October 31, 2026;
  • in 0.4.25 (September 19), the Splash engine for Apple silicon M3 and newer on macOS 26.4 and newer was added on Mac; in 0.4.27, maximum memory limits and a Neural Engine Prefill setting were added for Splash models;
  • in 0.4.22 (August 28), helper models for speculative decoding were added: DFlash, DSpark, and MTP. We covered how this technique works in the article on speculative decoding.

Alongside LM Studio, the company also releases Bionic, an agent app with local models and optional cloud inference. The free plan, according to the pricing page, includes running local models on llama.cpp and MLX. If data cannot be sent outside, make sure a local model is selected in chat, not a cloud model.

LM Studio can work as a server. You can enable it in the Developer tab or with the lms command, which is installed with the app (lms documentation):

lms ls
lms server start
lms ps
curl http://localhost:1234/v1/models

In the documentation examples, the server runs on port 1234 with OpenAI-compatible endpoints /v1/chat/completions, /v1/responses , and /v1/embeddings (OpenAI compatibility). The port can be changed in the server settings, where token-based authentication and local network access are also enabled (server settings). For multiple users, the documentation describes the Max Concurrent Predictions parameter with continuous batching; in the feature description it is listed for the llama.cpp engine, so check support in your version for MLX models.

mlx-lm: for developers and fine-tuning

mlx-lm is Apple's Python package for text generation and model fine-tuning on MLX. It is useful when you embed a model into your own code, run a new model from mlx-community before it appears in Ollama, or fine-tune a LoRA adapter directly on a Mac.

Versions as of November 17, 2026, according to PyPI: mlx 0.32.4 (October 14), mlx-lm 0.32.2 (October 16) mlx-vlm for image models — 0.8.0 (November 16). mlx-lm requires Python 3.11 or newer.

python3 -m venv ~/mlx-env
source ~/mlx-env/bin/activate
pip install mlx-lm
mlx_lm.generate --model mlx-community/Llama-3.2-3B-Instruct-4bit --prompt "Explain what RAG is in three sentences"
mlx_lm.chat --model mlx-community/Llama-3.2-3B-Instruct-4bit

The built-in server mirrors the OpenAI Chat API and listens by default on localhost:8080:

mlx_lm.server --model mlx-community/Llama-3.2-3B-Instruct-4bit
curl localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{"messages": [{"role": "user", "content": "Connection test"}], "max_tokens": 64}'

The authors state directly in the server documentationthat it is not recommended for production: it includes only basic security checks. To save memory on long contexts, there is a flag --kv-bitsbut with a quantized KV cache the server processes requests one at a time. By default, the response is limited to 512 tokens (max_tokens).

If the model almost completely fills memory and mlx-lm shows a warning about slow generation, the README recommends increasing the system wired memory limit:

sudo sysctl iogpu.wired_limit_mb=100000

The value is set in megabytes. It must be larger than the model size but smaller than the Mac’s memory capacity: the example above is calculated for a model of about 90 GB on a Mac with 128 GB.

llama.cpp and llama-server on Mac

llama.cpp supports Metal out of the box and works with any GGUF files. It is the right choice when you need the same setup as on a Linux server with NVIDIA, or when you need a quantization format that is not available in MLX. The llama-server from llama.cpp 1.0 provides an OpenAI-compatible API, slots for parallel requests, and KV cache tuning; setup is covered in detail in the article “llama-server from llama.cpp 1.0”. A comparison of llama.cpp with vLLM, SGLang, and Ollama by use case is in the article on inference engines.

Ollama, LM Studio, or mlx-lm: a comparison

Criterion Ollama LM Studio mlx-lm
Interface Command line, API, simple app Graphical app and CLI lms Python and command line
Engines on Mac MLX by default for supported architectures, llama.cpp for everything else llama.cpp (GGUF), MLX, Splash MLX
Default API port 11434 1234 in the documentation examples, configurable in settings 8080
API authentication No, a proxy is needed There is a token in the server settings Basic checks, not for production
Multiple requests at once Parallel generation on MLX is still in rc version Max Concurrent Predictions for llama.cpp Batch generation via Python API
Fine-tuning No No LoRA and full fine-tuning
Best for Application and agent developers People who choose models manually ML engineers and researchers

Speed: what to expect from a Mac

Generation speed on Mac is limited first and foremost by memory bandwidth: the M5 Max offers up to 614 GB/s, while the M5 Ultra reaches 1.2 TB/s (Apple). Prompt-reading speed (prefill) depends on GPU compute power, and it increased noticeably on M5 chips.

Published benchmarks:

  • Ollama 0.19 vs. 0.18, Qwen3.5-35B-A3B (Ollama blog, March 29, 2026, hardware not specified in the post): prefill 1,810 tokens/s vs. 1,154, generation 112 tokens/s vs. 58. Different quants were compared: NVFP4 on MLX and Q4_K_M on llama.cpp.
  • MacBook Pro M5 Max, 128 GB, mlx_lm, gpt-oss-120b (user benchmarks from r/LocalLLaMA, published by Hardware Corner on March 11, 2026): at 4K context — prefill 1,325 and generation 87.9 tokens/s; at 32K — 2,537 and 64.5 tokens/s.
  • Mac Studio M5 Ultra, 256 GB, oMLX, Qwen3.8 Flash-Next in 4 bits (MacStories, September 2026): a 16K prompt was read at 2,887 tokens/s versus 1,143 on M3 Ultra, generation — 52 tokens/s versus 37.

These figures show two things. Speed drops as context grows, so test the model on prompts of your own length. And when multiple users work at once, Mac gets a small boost: in the MacStories test, three parallel requests produced a total of 81.5 tokens/sec versus 66.2 for a single request. That is enough for a chat with one to three people. For a department with agents sending dozens of requests in parallel, server-side engines like vLLM on NVIDIA GPUs are a better fit.

Using a Mac as a Team Server

A Mac Studio is often set up as a small department server: it is quiet and takes up very little space. For this setup to run reliably:

  1. Create a separate user account and disable sleep in the power settings, otherwise the API will disappear overnight.
  2. Expose the network only through a reverse proxy with authentication, or enable a token in LM Studio. Do not open Ollama and mlx_lm.server to the network without protection.
  3. Pin the versions of Ollama or LM Studio and the models. Updating the engine can change sampling parameters and responses, as happened with Ollama 0.40.14.
  4. Measure the load in advance: how many users, how long the prompts are, and what response time is acceptable. The methodology is in the article on load testing a local LLM.
  5. If the server has to run without internet access, download the models in advance and disable cloud features. Learn more in the article about LLMs in an air-gapped environment.

Common Problems

The model is running very slowly. It is most likely not fitting into available memory and the system is swapping. Use a smaller quantization or a smaller model, and close heavy programs. For mlx-lm, check the memory warning and the iogpu.wired_limit_mb limit.

The first response takes a long time. The model is loading from disk, and the long prompt is being processed in full. In Ollama, the model is unloaded after 5 minutes of idle time; increase keep_alive. A detailed breakdown is in the article about Ollama's slow first response.

There is not enough context. A long context increases the KV cache. Reduce the context window in the load settings, or use KV cache quantization if the tool supports it.

Responses through the OpenAI API changed after the update. Set temperature and top_p explicitly in the request: with Ollama 0.40.14, the default values are taken from the model.

Frequently Asked Questions

What should a beginner choose: Ollama or LM Studio? If you need an API for your own app or agent, choose Ollama. If you want to browse models and settings in a graphical interface, choose LM Studio. Both are free for running local models.

Is a 16 GB MacBook Air enough? For models up to 8–9 billion parameters in 4-bit quantization, yes: drafts, translation, classification, short documents. For 27B-class models, you need at least 32 GB.

Is MLX always faster than llama.cpp? Not always. On M5 chips, MLX uses the neural accelerators in the GPU cores, and in an Ollama test, generation almost doubled. But the result depends on the model and the quantization, so compare both options on your own task.

Can you fine-tune a model on a Mac? Yes, mlx-lm supports LoRA and full fine-tuning, including for quantized models. For larger models and larger datasets, it is more convenient to rent a GPU.

Can you combine several Macs? Apple says Mac Studio can be clustered over Thunderbolt 5 with RDMA: according to the company, four Mac Studios deliver up to three times faster inference than one. mlx-lm supports distributed inference through mx.distributed.

How Vladimir Lomtev's AI Studio Helps You Launch an LLM on a Mac

Vladimir Lomtev's AI Studio deploys and fine-tunes LLMs on a company's own hardware. For a local model on a Mac, that means:

  • selecting a model and quantization level that match your Mac's memory and your task;
  • configuring Ollama, LM Studio, or mlx-lm as a server with authentication and connecting it to your apps;
  • testing response quality and speed on your documents and real-world workload;
  • if needed, fine-tuning the model on company data and training employees to work with it.

The first step is to choose one process that needs a local model, describe the Macs you have and their memory, gather typical requests, and define the acceptance criteria for the response. Discuss the project

Bottom Line: Start with Ollama or LM Studio, Move to mlx-lm When Needed

For most Mac use cases, Ollama or LM Studio is enough: both use MLX and provide a local API. mlx-lm is needed when you embed the model in your own code, run it before it appears in ready-made apps, or fine-tune it. Choose the model based on available memory with room for context, test speed on your own prompts, and expose the API to the network only with authentication.

Request an audit

Share your contact details and we will follow up.

← All articles

Comments (0)

Loading comments…

Leave a comment
No registration required

Book a strategy call
for agentic operations

Tell us which workflow you want to improve. We will map feasibility, risks, and the fastest MVP path.

By submitting, you agree to our privacy policy

Contacts

Global Operations

Serving U.S. clients remotely
with private cloud and on-prem options

Strategy calls by request

We respond after reviewing your workflow context.

info@agentsunrise.pro

For partnership inquiries

Have a proposal?

Write to us in messengers

© 2026 AgentSunrise