Block VIII · AI on your own machine · Lesson 42
Ollama, LM Studio, llama.cpp or vLLM: which engine to use
You'll know which program to choose for running models locally: Ollama and LM Studio to get started, llama.cpp to squeeze the most out of your machine, vLLM and SGLang to serve several people and KTransformers for giant MoE models.
- 11 min
- 9 animated slides
- 4-question quiz
- Narrated in 6 languages
What you'll see in this lesson
- What a local engine does
The engine loads the model into memory, generates the text and serves it to your programs; the model is the same, how it runs changes.
- Ollama: one command and you're running
It's the fastest way to start on Windows, Mac or Linux: pick a model from its catalog and run it.
- LM Studio: all in windows, and MLX on Mac
An app to search, download and test Hugging Face models with your mouse, free for business use too.
- llama.cpp: the engine for those who want control
Many tools are built on its code; using it directly you decide every setting, and you usually get new models first.
- Same code, different server: the OpenAI API
All these engines mimic the OpenAI API: change the base URL and your scripts, n8n or apps work with the local model.
- vLLM and SGLang: when the model is for the whole team
They're built to handle many requests at once on NVIDIA or AMD cards, with much higher total throughput than Ollama.
- Giant MoEs on one GPU: experts to RAM
Keep attention and the cache on the GPU, since they're used for every token, and send the experts, the heaviest part, to RAM.
- Which one to choose for your case
Start simple and switch engines only when you hit a specific limit.
- Summary
The model is the same; the engine decides how easy, how fast and how many people it can serve.
Tools and concepts
- Ollama
- LM Studio
- llama.cpp
- vLLM
- SGLang
Sign in with your Google account to access this lesson and the whole course.