AI Local Inference Tutorial: Ollama, Llama.cpp, Lmstudio

TL;DRLocal inference (Ollama, llama.cpp, LM Studio) runs open models on your own machine.

You don't always need the cloud. llama.cpp runs quantized models efficiently on CPUs/consumer GPUs; Ollama wraps it with a simple "pull and run" CLI/API; LM Studio gives a GUI. Benefits: privacy (data never leaves), no per-token cost, offline use. Limits: you're capped by your hardware and the smaller/quantized models that fit. Great for development, privacy, and tinkering.

Key points

Common mistakes

Try it: List two reasons to run a model locally instead of via API.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>ollama run llama3   # pull + run locally
private · offline · no per-token cost
capped by your hardware</pre></body></html>
Open the interactive lesson →
Open Weights vs Closed · The Divide Fine-Tuning Hosted · OpenAI · Anthropic Platforms