跪拜 Guibai
← All articles
Artificial Intelligence

Ollama vs LM Studio on a 24GB M6 Mac: MLX, Memory, and Locked Model Files Decide It

By 谁在黄金彼岸 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

On Apple Silicon desktops, the runner choice determines model portability, memory footprint, and whether MLX acceleration is available. Ollama's resident service and blob storage clash with the tight memory budgets of 24GB machines, making LM Studio the practical pick for local GPU inference.

Summary

Ollama and LM Studio are not the same category of tool. Ollama wraps llama.cpp with its own model registry, CLI, and a resident API service; LM Studio is a GUI runner that ships both llama.cpp and Apple's MLX engine. On a 24GB M6 Mac, three differences decide the choice: Ollama stores models as black-box blob shards that no other tool reads, it lacks MLX, and its memory management stays opaque while LM Studio loads on demand and unloads on idle.

The downloaded 7.1GB Qwen model split into 789 shards cannot be read by other tools; LM Studio uses ordinary files in a readable directory. MLX gives 10-30% faster text generation, and LM Studio's JIT loading keeps a 24GB machine usable alongside a browser and IDE. The final configuration splits tasks: LM Studio for interactive and multimodal work, llama-server for long-resident tasks with KV cache quantization, cloud API for heavy models, and Ollama only for server or port-specific tooling.

Uninstalling Ollama was a two-line command that freed 7.1GB with no loss, since the blobs were already unusable elsewhere. Ollama remains the easiest onboarding tool for beginners and a natural fit for Linux servers, but on a memory-constrained Apple Silicon desktop, LM Studio's transparency and MLX acceleration win.

Takeaways
— Ollama stores models as one tensor per file; a 7.1GB Qwen3.5:9b split into 789 shards, unreadable by LM Studio, llama.cpp, or any other tool.
— LM Studio stores models as ordinary files under ~/.lmstudio/models, so they can be copied, backed up, and measured with du.
— LM Studio includes an MLX engine; on Apple Silicon MLX is 10-30% faster than llama.cpp for text generation, depending on model and quantization.
— Ollama runs a resident background service (100-200MB); LM Studio is an Electron app (200-400MB) with JIT loading and idle auto-unload.
— Ollama's API defaults to port 11434, LM Studio to 1234; many third-party plugins assume the 11434 port.
— On a 24GB Mac, a 9B model with 4-bit weights plus OS and apps leaves 4-6GB headroom; a 27B dense model spills to swap and runs at 5-8 tokens/s.
— The final setup uses LM Studio (MLX) for daily and multimodal tasks, llama-server for long-resident memory-tight workloads with KV cache quantization, cloud API for heavy tasks, and Ollama only for server-side or port-specific tooling.
— Uninstalling Ollama involves removing ~/.ollama/models, which frees 7.1GB with no loss because the blobs are unusable elsewhere.
Conclusions

Ollama's model lock-in is a real portability cost: downloaded weights are trapped in a blob format, making a local model a single-tool asset.

MLX is the decisive factor on modern Apple Silicon; the 10-30% speedup is broad enough to tip the choice, but the exact gap is model- and quant-dependent.

The memory budget shows 24GB is only comfortable for a 9B-class resident model with short context; bigger models require cloud offload, not tuning.

The practical division of labor by tool—GUI for interactive, llama.cpp for precise memory control, cloud for scale—is a useful way to manage local inference resources.

Concepts & terms
MLX
Apple's machine learning framework for Apple Silicon, exposing the neural accelerators on every GPU core. It runs models natively on M-series chips and is often faster than llama.cpp for text generation.
KV cache
Key-value cache that stores computed attention keys and values during transformer inference. It consumes memory proportional to context length; reducing it (via quantization or shorter context) lowers RAM usage at some quality cost.
GGUF
A file format for quantized LLMs, primarily used by llama.cpp and many local runners. It allows flexible quantization levels and is the standard format for CPU/GPU inference outside MLX.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗