Ollama and the desktop local-model runtimes
Ollama, LM Studio, KoboldCpp, Jan, LocalAI and the rest — what each one sets on your behalf, and what it does not tell you it set.
A desktop runtime is a set of defaults with a download manager attached. The inference is llama.cpp or something close to it; what you are actually choosing between is who decides your context length, how many layers go to the GPU, how long a model stays resident, and which of those decisions you are allowed to see. Most of the confusing behaviour people report — the model that answers instantly and then takes twelve seconds, the 128k model that forgets at 4,000 tokens, the machine that runs out of memory only under load — is a default doing exactly what it was configured to do, silently.
These pages take the defaults apart one at a time. Where a runtime publishes a number, it is quoted with its publisher; where it does not, the arithmetic is shown from inputs you can check, and the command that reads the real answer off your own machine is given instead of a figure somebody guessed. Nothing here was benchmarked, and nothing here needs to have been.
Ollama Modelfile Syntax, Line by Line
Every Modelfile instruction, what it writes into the built model, and a working file that sets parameters and a system prompt together.
9 min read
Building a Custom Model With ollama create
What ollama create does to a Modelfile, what each flag changes, and how to end up with a named local model you can run and share.
9 min read
Ollama's num_ctx Parameter and What It Actually Sets
num_ctx allocates a KV cache, not a promise about memory — here is the arithmetic, the default Ollama picks for you, and what moves when you change it.
9 min read
Ollama's keep_alive Setting and Model Unloading
The unload timer, every value keep_alive accepts, and how to reason about the memory you are renting against the load time you are avoiding.
8 min read
Ollama's REST API, End to End
The endpoints, the request and response fields that matter, and a script that talks to /api/generate and /api/chat with nothing but HTTP.
10 min read
Where Ollama Stores Models and How Much Disk They Use
The manifests-and-blobs layout, what each path holds on each platform, and how to work out real disk use when tags share weights.
9 min read
Importing a GGUF File Into Ollama
Take a GGUF you downloaded yourself, wrap it in a three-line Modelfile, and run it under Ollama with a template that matches the model.
9 min read
Ollama's Embeddings API, End to End
Generate vectors from a local embedding model over plain HTTP, with the batching, truncation and normalisation details that decide whether the vectors are usable.
9 min read
Choosing How Many Layers Ollama Offloads to GPU
What num_gpu counts, what Ollama does when you leave it alone, and how to derive an offload count from free VRAM instead of guessing.
9 min read
Ollama's num_parallel Setting for Concurrent Requests
How OLLAMA_NUM_PARALLEL turns one loaded model into several request slots, and exactly what that multiplies in memory.
8 min read
Setting a System Prompt in an Ollama Modelfile
Bake a system message into a model with SYSTEM, verify it survived the build, and understand why it sometimes appears to be ignored.
8 min read
Choosing a Quantization When You Pull a Model in Ollama
What the tag suffixes mean, what each one costs on disk, and how to work out bits per weight from sizes the registry publishes.
9 min read
Running Ollama on Windows via WSL2
Installing Ollama inside a WSL2 distribution and proving the GPU actually reached it, which is the step that fails without saying so.
9 min read
Running Ollama in Docker
A container serving the Ollama API with the GPU actually attached, plus where the model blobs live so you do not download them twice.
9 min read
The TEMPLATE Field in an Ollama Modelfile
What TEMPLATE renders, which variables it can see, and the specific failure modes a template that does not match the base model produces.
9 min read
Ollama's Default Context Length, and Why It Is Not the Number You Read
Three documented defaults, the precedence between them, and the silent truncation that happens when the one that wins is smaller than your prompt.
10 min read
Running Multiple Models at Once in Ollama
The two limits that decide how many models stay resident, the memory each one costs, and what the scheduler does when the budget runs out.
9 min read
Ollama's Environment Variables, Explained
What each OLLAMA_ variable changes at runtime, grouped by the problem it solves, and why setting one in your shell usually does nothing.
10 min read
Running LM Studio's Local Server in OpenAI-Compatible Mode
Starting LM Studio's HTTP server and calling it with the same code you would point at a hosted API, including where the compatibility stops.
9 min read
Which Quant to Download in LM Studio's Model Picker
How to read the quant list against your own free memory, with the bits-per-weight derived from published file sizes rather than guessed.
9 min read
LM Studio's GPU Offload Slider Explained
What the slider sets underneath, how to work out the right layer count, and why a nearly-full offload is much slower than a full one.
9 min read
Presets and System Prompts in LM Studio
What a preset bundles, what it deliberately excludes, and the places a saved preset changes behaviour you thought your request controlled.
8 min read
Loading a Model Straight From Hugging Face in LM Studio
Pulling a model from Hugging Face without leaving the app, including why a repository you can see in a browser sometimes does not appear in the search.
8 min read
LM Studio's Headless and CLI Mode
Running the server on a machine with no desktop session, using the daemon and the lms CLI rather than the graphical app.
9 min read
What Happens When You Exceed LM Studio's Context Window
Why LM Studio sometimes truncates silently and sometimes returns a 400, which setting decides, and what to change so it stops.
9 min read
Loading Two Models at Once in LM Studio
How LM Studio holds several models in memory at once, and the arithmetic that decides whether yours will fit.
10 min read
KoboldCpp, Start to First Response
Download one binary, point it at a GGUF, and have KoboldCpp's browser UI answering on localhost in a few minutes.
9 min read
GPT4All, Start to First Response
Installing GPT4All, downloading a model and holding a fully offline conversation with no account, plus an honest note on the project's release cadence.
9 min read
Jan, Start to First Response
Installing Jan, pulling a model from its Hub, chatting locally, and turning on the OpenAI-compatible server on port 1337.
9 min read
LocalAI, Start to First Request
Getting a self-hosted, OpenAI-compatible endpoint answering a curl request, and understanding the model YAML that decides how it behaves.
10 min read
text-generation-webui, Start to First Response
Getting a model loaded and answering in oobabooga's web UI, now called TextGen, including the extension trap that catches most first attempts.
10 min read
llamafile Explained: A Model and Runtime in One Executable
How Cosmopolitan Libc lets one file execute unmodified on six operating systems and two instruction sets, with the weights inside it.
9 min read
Running a Model With llamafile, No Install Required
Download one executable, make it executable, and get a chat response — plus the three platform problems that stop it.
9 min read
KoboldCpp's Context Shifting Explained
Why moving the KV cache instead of reprocessing the prompt removes almost all of the pause between turns, and what silently turns it off.
9 min read
Connecting SillyTavern to a Local Backend
Getting SillyTavern's front end talking to a llama.cpp or KoboldCpp server on your own machine, and choosing the right API mode.
10 min read
Open WebUI as a Self-Hosted Chat Front End
Running Open WebUI in Docker, pointing it at your own model server, and setting up accounts before anyone else can reach it.
10 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- Embeddings & vector search
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Local inference errors, string by string
- Running local models day to day
- Testing code that calls an LLM
- Snapshot and property testing for model output
- Regression suites for prompts
- Eval gates in CI
- Flaky tests against a model
- Determinism and the cost of testing
- Contract and streaming tests
- Testing tool calls and retrieval
- Inference, serving & latency
- Rolling out a prompt change
- Testing AI systems in practice
- Forecasting a time series
- Machine learning on tabular data
- Geospatial data and models
- Understanding audio that is not speech
- Understanding video
- Core computer vision tasks
- Machine learning on graphs
- Point clouds and 3D
- Evaluation, benchmarks & LLM-as-judge
- Sensor and IoT data
- Logs and event streams
- Models over biological sequences
- Machine learning on molecules
- Embedding and searching code
- Extracting invoices and purchase orders
- Receipts, statements and tax forms
- Insurance policies and contracts
- Deeds, court filings and patents
- Extracting from medical records
- Observability & LLMOps
- CVs, certificates and identity documents
- Shipping, customs and technical documents
- Meetings, email, chat and filled-in forms
- Building an extraction pipeline
- Business, property and inspection documents
- Contract clauses and insurance claims
- Regulated and compliance documents
- Consumer, travel and closing documents
- Mapping one chat API onto another
- SDK and framework migrations
- Hallucination & failure modes
- Re-embedding and model deprecation
- Cutting over between providers
- Parity gaps, shims and legacy endpoints
- Moving between model versions
- Migrating vector stores and caches
- Mapping capabilities and parameters
- Migrating pipelines and agents
- Contracts, runbooks and rollback
- Auditing a codebase before a cutover
- Compliance and fine-tune migration
- LLM cost engineering
- Routing, cost tracking and multi-tenancy
- What a migration does to your prompts
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Search, ranking & recommendation
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns
- Build it: end-to-end AI tutorials
- Python for AI: hands-on recipes
- TypeScript, React and the web
- Frameworks and SDKs
- Errors and troubleshooting
- AI facts, numbers and statistics
- The history of AI
- The maths behind AI
- Architectures beyond the transformer
- Reinforcement learning
- Diffusion and generative media
- Speech, audio and voice engineering
- Benchmarks, one at a time
- AI search visibility
- Infrastructure and operations
- Databases and storage for AI
- Knowledge graphs and structured knowledge
- Classical ML in production
- Regulation, jurisdiction by jurisdiction
- Prompt recipes and pattern library
- AI for people who do not write code
- Writing, media and creative work
- Edge and on-device AI
- Interpretability and model internals
- Field notes
- OpenAI model behaviour
- Claude model behaviour
- Gemini model behaviour
- Llama model behaviour
- Mistral model behaviour
- Qwen model behaviour
- DeepSeek model behaviour
- Cohere model behaviour
- Grok model behaviour
- Small model behaviour
- Hybrid model architectures
- Token cost by language and script
- Transliteration, romanization and script handling
- Locale-correct output
- Multilingual generation quality
- Multilingual pipelines
- The EU AI Act, article by article
- AI under the GDPR and EU data law
- US AI regulation, state and sector
- International AI governance and standards
- AI litigation and enforcement
- Running AI workloads on AWS
- Running AI workloads on Google Cloud
- Running AI workloads on Azure
- AI at the edge: Workers, Vercel and Netlify
- Serving models on Kubernetes
- Operating AI infrastructure
- Quantization formats and what they cost
- llama.cpp, flag by flag
- Local models on Apple Silicon
- Hardware for local inference
- Running speech and embedding models locally
- Model files, adapters and conversion
- VRAM arithmetic for local models