skip to content

Local LLM runtimes

1 roadmap55 questionsupdated

Ollama's daemon, LM Studio's desktop app and llama-server run open-weight models on one machine behind a localhost API. Interviewers ask when that beats a hosted API on privacy and cost.

on this pageshow

guide

overview

~1 min

Local model runtimes load an open-weight language model on a machine you control and serve it behind an HTTP endpoint on localhost. Interviewers bring them up when a role involves data that must not leave the building, an offline or air-gapped environment, steady inference volume where per-token pricing adds up, or simply a developer laptop running a coding assistant. The probe is judgement more than syntax: when local beats a hosted API and when it does not, what the runtime decided on your behalf, where the model's memory actually went, and which parts of a familiar client stop working once its base URL points at your own box. The subject has three sections, and they stack rather than compete. [llama.cpp](/topics/ai-llama-cpp) is the engine underneath: the GGUF file format, quantization, the compute backends and its own llama-server. [Ollama](/topics/ai-ollama) wraps local inference in a background daemon with a pull-and-tag model registry, Modelfiles that bake settings into a named model, and native plus compatibility HTTP APIs. [LM Studio](/topics/ai-lm-studio) wraps llama.cpp or Apple's MLX in a desktop app, with a headless daemon, the `lms` CLI and SDKs for scripted use. Each wrapper inherits the engine's constraints and then adds defaults of its own, which is where most surprises come from. Learn the file format and quantization first, because nearly every memory, speed and quality question in the wrappers traces back to them. Then take the wrapper your team uses, and finish with the server topics, where most senior questions sit: sharing one model, exposing it beyond localhost, and what a compatible API leaves out.

primer

A few ideas carry the whole hub; with them in place, most questions below read as applications rather than trivia. - **Memory decides almost everything.** A model runs fast only when its weights and its context cache fit in accelerator memory. Whatever does not fit spills to system RAM and the CPU, and throughput falls off steeply. Weights scale with parameter count times bits per weight; the context cache scales with context length times concurrent requests. Most "why is it slow" and "why won't it load" questions come down to that sum. - **Quantization trades quality for fit.** Storing weights at 4 or 5 bits instead of 16 is what lets a mid-sized model run on a laptop. The loss is uneven across schemes and tensors, and it compounds when you round weights that were already rounded, so where a build came from matters as much as its label. - **The file carries the model's contract.** A GGUF bundles the weights with what a runtime needs to talk to them: architecture, tokenizer, chat template. When output rambles, prints role markers or ignores a system prompt, suspect the template before the model. - **Defaults are decisions someone made for you.** Context length, GPU layers, idle unload timers, how many models stay resident, how parallel requests divide memory: each runtime picks these, picks them differently, and has changed them between releases. A strong answer names the default, says what it optimizes for, and pins it when the behaviour matters. - **A compatible API is a subset.** OpenAI- and Anthropic-shaped routes let existing SDKs work after a base-URL change, but unsupported fields can be ignored quietly and omitted ones can receive different defaults. The native route exists for the controls the compatible one cannot express. - **Localhost is the security boundary.** Out of the box, these servers assume one trusted user on the same machine. Binding to a network interface without authentication turns a developer tool into an open inference endpoint, and a model name that routes to a hosted service defeats the privacy reason for running locally at all.

Open-weight model
A model whose trained weights are published for download, so it can run on your own hardware, usually under a licence that sets the terms of use.
GGUF
The single-file model format llama.cpp and the tools built on it load, holding the tensors plus metadata such as architecture, tokenizer and chat template.
Quantization
Storing weights at fewer bits than they were trained in, cutting memory and often raising speed at some cost in output quality.
K-quant
A family of llama.cpp quantization types, named like Q4_K_M, that quantize weights in blocks with their own scales; the suffix marks a size and quality variant.
GPU offload
Placing some or all of a model's layers in accelerator memory; layers that do not fit run on the CPU from system RAM, far more slowly.
KV cache
Per-token attention state kept during generation so earlier tokens are not recomputed; its size grows with context length and with the number of concurrent requests.
Context length
The number of tokens a loaded model can attend to at once. Runtimes often load a model below its trained maximum to save memory.
Chat template
The rules that render a list of role-tagged messages into the exact text format a model was trained on, special tokens included.
Parallel slot
One concurrent request a server can process. Slots share the loaded weights, but each needs its own portion of the context cache.
Keep-alive or idle TTL
How long a runtime keeps an unused model in memory before unloading it; the first request after an unload pays the full load time.
Compatibility endpoint
A route shaped like a hosted provider's API so existing SDKs work by changing the base URL; it usually implements only part of that API.
Modelfile
Ollama's recipe that starts from a base model and fixes parameters, a system prompt and a prompt template, then builds them into a new named model.

The three sections form a stack, and most debugging means finding which layer made the decision you are looking at. **The file is the bottom layer.** A GGUF build fixes the weights' precision and carries the tokenizer and chat template, so a poor quant or a missing template travels with the file into whichever runtime loads it. LM Studio's MLX builds are the one parallel track: a different format for a different engine, tied to Apple hardware. **The engine turns the file into tokens.** [llama.cpp](/topics/ai-llama-cpp) decides how layers split between GPU and CPU, how the context cache is allocated and which hardware backend does the math. The available backends are largely fixed when the engine is compiled, which is one reason the same file can run very differently under two builds. Its [bindings](/topics/ai-llama-cpp-bindings) let a program embed the engine in its own process instead of calling a server. **The wrappers manage lifecycle.** [Ollama](/topics/ai-ollama) and [LM Studio](/topics/ai-lm-studio) add what the engine leaves to you: finding, downloading and storing models, choosing load settings, keeping a model resident or unloading it when idle, and loading on demand when a request names a model that is not in memory. Their settings end up as engine parameters, so a wrapper question often reduces to which engine setting a given default produced. **The server is the contract with clients.** All three expose a native route plus routes shaped like the OpenAI and Anthropic APIs. Coding assistants, agent frameworks and retrieval pipelines usually target a compatible route so they can switch between local and hosted models; the native route is where runtime-specific controls live.

  1. GGUF Format and Quantization →

    The file format and quant levels underlie every memory, speed and quality trade-off the wrappers expose, so learn what a build label promises first.

  2. GPU Offload and Memory →

    Where memory goes in practice: GPU offload, context size, parallel requests and idle unloading, seen through the tool most people install first.

  3. HTTP Routes & Compat Gaps →

    How existing SDKs reach a local model, and which hosted-API features the compatibility routes leave out.

  4. llama-server and Endpoints →

    The engine's own server shows the knobs the wrappers hide: slots, context division, structured output and what to change before sharing it.

  5. Server Routes & Access →

    A second wrapper's answer to the same problems, including on-demand loading, eviction and authentication for network access.

  • Sizing a model by its weight file alone and forgetting the context cache, which grows with context length and with every parallel request.

  • Reading a partial CPU/GPU split as a minor slowdown; layers left in system RAM usually dominate generation speed.

  • Assuming a compatible endpoint honours every field the hosted API does; unsupported parameters can be ignored quietly and omitted ones can get different defaults.

  • Blaming the model for rambling output or leaked role markers before checking which chat template the runtime actually applied.

  • Pulling a floating tag such as latest on several machines and expecting identical builds instead of pinning a size and quant explicitly.

  • Shrinking an already-quantized download to a smaller quant instead of starting again from a 16-bit source, which compounds the rounding loss.

  • Binding a local server to a network interface with no authentication on the assumption that the office network is trusted.

  • Promising that prompts never leave the machine without checking whether any configured model name routes to a hosted service.

  • Comparing two setups whose implicit defaults differ (GPU layers, context length, flash attention) and blaming the runtime for the gap.

Most questions in this hub turn on one of a few recurring choices, and naming the one you are making is usually the core of a good answer. - **Local versus hosted.** Local keeps data on hardware you control, works offline and has no per-token bill. You pay in hardware, operations and model quality, since open-weight models that fit on one machine generally trail the largest hosted ones. Privacy constraints, steady predictable load and experimentation favour local; peak quality, bursty demand and zero maintenance favour hosted. - **Wrapper versus engine.** Ollama and LM Studio make reasonable choices for a single user quickly. llama.cpp directly gives you every knob and new features first, at the cost of setting them yourself. - **Server versus in-process.** A shared server lets many clients use one loaded model and keeps a crash from taking the caller down with it. Embedding the engine removes the network hop and exposes lower-level control, but ties the model's lifetime to one process. - **Fewer bits versus quality.** A smaller quant fits a larger model, a longer context or more parallel requests in the same memory; past some point the loss shows up as weaker reasoning and formatting slips. A larger model at a lower quant can beat a smaller one at a higher quant, and only a test on your own task settles which. - **Convenience versus reproducibility.** Automatic fitting, floating tags and on-demand loading are pleasant on a laptop and a source of drift on a shared server, where they are better pinned.

explore

report an issue with this guide →

questions

page 1 of 2

In llama.cpp 0.5.0, what do llama-server's -m/-hf, -ngl and -c flags control, and what happens when you leave them unset?

level: juniorimportance: must knowfreq 14%

answer

  1. where the weights come from
  2. Hub repo plus an optional quant tag
  3. layers kept in VRAM, rest on CPU
  4. zero means the model's own length
  5. an on-by-default memory fitter

basics

~20 s

-m loads a local GGUF, -hf downloads one from Hugging Face (Q4_K_M by default), -ngl caps layers in VRAM and -c sets context. Unset in llama.cpp 0.5.0, -ngl is auto, -c is the trained length, and --fit may shrink both.

solid answer

~40 s

`-m path/to/model.gguf` loads a file you already have; `-hf <user>/<model>[:quant]` downloads one from Hugging Face into llama.cpp's cache, choosing Q4_K_M when no tag is given (or the repo's first file if there is no Q4_K_M), with `-hff` naming an exact file and the token read from `HF_TOKEN`. `-ngl` is the maximum number of layers stored in VRAM: a number, `auto` or `all`. Whatever does not fit runs on the CPU, the usual reason a server is slow. `-c` is the context size, and its default `0` means the length the model was trained with. In llama.cpp 0.5.0 both defaults pass through `--fit`, which is on by default: it shrinks the context, then the layer count, until each device keeps a free margin, and leaves alone any value you set yourself.

code

bash · 8 lines
bash
# local file, both values pinned: --fit will not change them
llama-server -m ./models/your-model-Q4_K_M.gguf -ngl all -c 16384

# from the Hub: Q4_K_M unless the tag names another quant
llama-server -hf ggml-org/gemma-3-4b-it-GGUF:Q4_K_M --port 8080

# same repo later, no network: use the cached copy only
llama-server -hf ggml-org/gemma-3-4b-it-GGUF:Q4_K_M --offline

go deeper

for a junior

Recall the three flags and their defaults: -m or -hf for the weights, -ngl auto for layers in VRAM, -c 0 for the model's trained context.

for a middle

Explain how -hf picks a file, why layers left on the CPU slow generation, and why a large default context costs memory before any request arrives.

for a senior

Show you know --fit adjusts only what you left unset, and that pinning -ngl or -c changes what happens when memory runs short.

for a principal

Argue when to rely on automatic fitting and when to pin values so every machine in a fleet starts the same way.

## What the three flags decide `llama-server` is the HTTP server that ships with llama.cpp. Before it can answer a single request it has to settle three things, and each one has its own flag: - **Which weights to load**: `-m` (`--model`) for a local file, or `-hf` (`--hf-repo`) to fetch one from Hugging Face. - **Where the layers run**: `-ngl` (`--n-gpu-layers`), the maximum number of the model's layers held in VRAM. The rest stay in system RAM and are computed on the CPU. - **How long the conversation can be**: `-c` (`--ctx-size`), the number of tokens of context the server allocates a KV cache for. Every one of these has a default in llama.cpp 0.5.0, and the defaults are smarter than they were in older guides. That is exactly why an interviewer asks about them: a candidate who copies `-ngl 99 -c 2048` from an old blog post gets a server that behaves differently from one started with no flags at all. ## Getting the weights: -m against -hf | Flag | What it takes | What happens | |---|---|---| | `-m` | a path to a `.gguf` file | loads the file as is; nothing is downloaded | | `-hf` | `<user>/<model>[:quant]` | downloads from the Hub into the cache; the quant tag is case-insensitive and defaults to `Q4_K_M`, falling back to the repo's first file if there is no `Q4_K_M` | | `-hff` | a file name inside the repo | overrides the quant tag and picks that exact file | | `-hft` | an access token | defaults to the `HF_TOKEN` environment variable, for gated or private repos | `-hf` also fetches a multimodal projector when the repo has one (turn that off with `--no-mmproj`). Downloads go into llama.cpp's cache, whose location the `LLAMA_CACHE` environment variable controls; `-cl` (`--cache-list`) lists what is cached, and `--offline` forces the server to use the cache and never touch the network. What a label such as `Q4_K_M` means is the quantization material's subject; here it is simply a name the flag matches. ## -ngl: how much of the model lives on the GPU `-ngl` accepts an exact number, `auto` or `all`, and the default is **`auto`**. In practice `auto` starts from every layer on the GPU and lets `--fit` back off if memory runs short. A number is a ceiling: `-ngl 20` keeps at most 20 layers in VRAM and computes the rest on the CPU, which is far slower per token. Two consequences matter: 1. Typing any explicit value, `-ngl 99` and `-ngl all` included, counts as setting it yourself, so `--fit` will not lower it. If the model and its cache then do not fit, you find out at load time. 2. Leaving it unset is usually right on a single GPU, because the server already tries to put everything there. ## -c: the context window, and the default that surprises people `-c` defaults to **`0`, meaning the context the model was trained with**, read from the GGUF's metadata. That can be very large, and the KV cache that backs it costs memory in proportion to its length (why that is so is the KV-cache material's subject). The README's quick-start line uses `-c 2048`, but that is an example, not the default. The server also splits its context into **slots** for concurrent requests; `-np` defaults to auto, which in 0.5.0 means four slots sharing one unified KV buffer, so the context you choose is a pool, not one person's window. ## What --fit does with what you left unset `--fit` is **on by default** in llama.cpp 0.5.0. Before loading, it estimates the memory the model, cache and compute buffers need on each device and, if they do not fit with a margin free (`-fitt`, default 1024 MiB per device), it adjusts **only the arguments you did not set**: - first the context, if `-c` was left out, but never below the floor `-fitc` (default 4096); - then the GPU layer count, if `-ngl` was left at `auto`. So a bare `llama-server -m model.gguf` on a small GPU may start with a shorter context than the model supports, or with some layers on the CPU, and say so in its log. Pinning `-c` and `-ngl` yourself, or passing `--fit off`, takes the decision back. ## Checking what you actually got 1. Read the startup log: the line `initializing, n_slots = ..., n_ctx_slot = ...` shows the slot count and each slot's context. 2. Query `GET /slots` for each slot's `n_ctx`, or `GET /props` for the server's defaults and the model's chat template. 3. Watch tokens per second in a response's `timings` object; a sudden drop after a config change usually means layers moved to the CPU. 4. Run with `-v` to see the fitting messages, such as how far the context was reduced. The server listens on `127.0.0.1:8080` by default, and the built-in web UI is served at the same address, so the first test is simply opening that page.

  • How do you run llama-server on a machine without internet after using -hf?
    Downloads land in llama.cpp's cache, which the `LLAMA_CACHE` environment variable relocates, and `-cl` lists its contents. Restart with the same `-hf` argument plus `--offline`, which forces the cache and blocks network access, or copy the GGUF across and load it with `-m`. A multimodal repo's projector arrives with `-hf` automatically, so copy that file too and pass it with `-mm`.
  • Why can `-ngl 99` copied from an older guide behave differently in llama.cpp 0.5.0?
    `-ngl` already defaults to `auto`, which starts with every layer on the GPU and lets `--fit` back off when memory is short. Any explicit number, 99 included, counts as your choice, so `--fit` stops lowering the layer count: it may still shrink an unset context, but if the model will not fit you find out at load time. Leave `-ngl` unset unless you mean to pin it.

  • llama-server offloads nothing to the GPU unless you pass -ngl.
  • Leaving -c unset gives llama-server a 2048-token context.
  • -hf without a quant tag downloads the full-precision file.
  • -ngl sets how many gigabytes of VRAM llama-server may use.
  • --fit overrides the -c and -ngl values you typed yourself.

Assumes llama.cpp 0.5.0, where -ngl defaults to auto, -c 0 means the trained context and --fit is on by default.

open as a page

Wiring a coding-assistant extension to LM Studio's local server, what base URL, API key and model identifier does it need?

level: juniorimportance: must knowfreq 16%

basics

~10 s

An OpenAI-style client uses http://localhost:1234/v1 and an Anthropic-style client http://localhost:1234. Any placeholder key works while Require Authentication is off, and the model is an identifier that GET /v1/models lists.

open as a page

In Ollama, what does the PROCESSOR column of `ollama ps` tell you, and what does a 48%/52% CPU/GPU reading mean?

level: juniorimportance: must knowfreq 24%

basics

~20 s

ollama ps lists the models currently loaded, and PROCESSOR says where each one's memory sits: 100% GPU is fully in VRAM, while 48%/52% CPU/GPU means about half stayed in system RAM, so those layers run on the CPU and generation slows sharply.

open as a page

With Ollama, what is a Modelfile for, and how do you build and run a named model from one?

level: juniorimportance: must knowfreq 24%

basics

~20 s

A Modelfile bakes a base model plus fixed settings (PARAMETER values, a SYSTEM prompt, seeded MESSAGE turns, a TEMPLATE) into one named model. ollama create support-bot -f Modelfile builds it; any call by that name then uses it.

open as a page

In Ollama, what does `ollama pull llama3` fetch when you give no tag, and why pin a tag such as `llama3:70b` instead?

level: juniorimportance: must knowfreq 24%

basics

~10 s

A bare name expands to registry.ollama.ai/library/llama3:latest, and latest is only a tag its publisher can repoint. Pinning an explicit size-and-quant tag and comparing the ID column of ollama ls keeps machines on one build.

open as a page

With a local Ollama server, how do you repoint an OpenAI Python SDK app, and what must the client still supply?

level: juniorimportance: must knowfreq 24%

basics

~10 s

Set the client's base_url to http://localhost:11434/v1/, pass any placeholder api_key (the SDK requires one, Ollama ignores it), and name a model already pulled into Ollama, such as gpt-oss:20b.

open as a page

With llama.cpp, how do you turn a fine-tuned Hugging Face checkpoint into a Q4_K_M GGUF that a teammate can run in any local runtime?

level: middleimportance: must knowfreq 13%

basics

~10 s

Run convert_hf_to_gguf.py on the checkpoint directory with --outtype bf16 (or auto) to get a 16-bit GGUF, then run llama-quantize on that file with the type Q4_K_M. The converter cannot write k-quants itself.

open as a page

For a Python batch job, when does embedding llama.cpp in-process with llama-cpp-python beat calling a llama-server, and when does it lose?

level: seniorimportance: must knowfreq 12%

basics

~20 s

In-process wins when one job owns the model: no service, port or HTTP hop, plus direct access to tokens, logits, grammars and state. A llama-server wins when many processes or concurrent requests share the model, or a crash must not kill the job.

open as a page

A 30B model downloaded from LM Studio's Discover tab refuses to load on a 32 GB MacBook — what decides that, and what do you change?

level: seniorimportance: must knowfreq 16%

basics

~20 s

Before loading, LM Studio estimates the memory the model and its context need and checks it against your resource guardrails setting; a failing estimate is refused. Lower the context length, use flash attention on GGUF, or pick a smaller download option.

open as a page

How do you run LM Studio on a headless Linux GPU server so that a provisioning script installs it, loads a model and serves it after every reboot?

level: seniorimportance: must knowfreq 12%

basics

~20 s

Install llmster, LM Studio's GUI-less daemon, start it with lms daemon up, then script lms get --yes, lms load --yes with explicit flags and lms server start, wrapped in a systemd unit so the same sequence reruns at boot.

open as a page

What do llama-cpp-python and node-llama-cpp wrap, and what does a minimal chat call look like in each?

level: juniorimportance: should knowfreq 10%

basics

~10 s

Both embed libllama, the llama.cpp C library declared in include/llama.h, inside your own process. Python builds Llama(model_path=...) and calls create_chat_completion(messages=...); Node calls getLlama(), loadModel(), createContext() and LlamaChatSession.prompt().

open as a page

What does a llama.cpp GGUF file hold besides the weights, and why can a local runtime load it without the checkpoint's config files?

level: juniorimportance: should knowfreq 16%

basics

~20 s

A GGUF file is a header of typed key-value metadata, a table describing every tensor, then the tensor data. The metadata carries the architecture, hyperparameters, tokenizer, chat template and file type, so nothing else needs to travel with it.

open as a page

In LM Studio's Discover tab, how do you get one specific Hugging Face model build, and where does the download land?

level: juniorimportance: should knowfreq 14%

basics

~20 s

Search Discover by keyword, by a user/model string or by pasting the full Hugging Face URL, then pick one download option. The file lands in LM Studio's models directory under publisher and model folders; My Models lets you move that directory.

open as a page

With LM Studio's lms CLI, how do you download a model, tell disk from memory, and import a GGUF you already have?

level: juniorimportance: should knowfreq 8%

basics

~20 s

lms get downloads into LM Studio's models directory and lms ls lists what is on disk; lms load and lms ps load and list what is in memory; lms import adopts an existing file, moving it unless you pass --copy.

open as a page

When building llama.cpp for an NVIDIA, AMD, Intel or Vulkan-capable GPU, which CMake flags select the ggml backend, and how do you confirm it?

level: middleimportance: should knowfreq 6%

basics

~10 s

The backend is compiled in: -DGGML_CUDA=ON for NVIDIA, -DGGML_HIP=ON for AMD ROCm, -DGGML_SYCL=ON for Intel GPUs, -DGGML_VULKAN=ON for Vulkan; Metal is on by default on macOS. Confirm with --list-devices or llama-bench's backend column.

open as a page

In llama.cpp 0.5.0, how do you produce an importance matrix with llama-imatrix and use it when quantizing a GGUF with llama-quantize?

level: middleimportance: should knowfreq 8%

basics

~10 s

Run llama-imatrix -m model-bf16.gguf -f calibration.txt, which writes imatrix.gguf, then pass --imatrix imatrix.gguf to llama-quantize. IQ1, IQ2 and IQ3_XXS types refuse to run without one; other types only gain quality from it.

open as a page

Before sharing one llama-server with a team over the LAN, which flags and default routes do you change, and why?

level: middleimportance: should knowfreq 8%

basics

~10 s

Bind it with --host, since the default is 127.0.0.1, and add --api-key or --api-key-file, because without one there is no authentication. Then narrow --cors-origins, decide on /slots and /metrics, and never enable --tools.

open as a page

Through llama-server, why does one message get a clean reply on /v1/chat/completions but a rambling continuation on /completion?

level: middleimportance: should knowfreq 7%

basics

~20 s

/completion sends your prompt string to the model raw, so it just continues the text. /v1/chat/completions and /v1/messages first render the messages through the GGUF's chat template with Jinja, on by default in llama.cpp 0.5.0.

open as a page

A llama-server for four teammates runs with -np 4 -c 32768 — how much context does each request get, and why?

level: middleimportance: should knowfreq 9%

basics

~20 s

About 8192 tokens each. With an explicit -np, llama-server keeps a separate KV stream per slot and divides -c evenly, so four slots share 32768. Use -c 131072 for 32k each, or -kvu for one shared pool.

open as a page

With LM Studio's JIT loading on, when does a model the server loaded on demand get unloaded, and how do you change that?

level: middleimportance: should knowfreq 9%

basics

~20 s

A JIT-loaded model unloads after sitting idle for its TTL, 60 minutes by default. Change the app-wide default for JIT loads in the server settings, or send a ttl field, in seconds, with the request that loads it.

open as a page

On an Apple Silicon Mac, LM Studio offers a GGUF and an MLX build of one model — what differs, and which do you choose?

level: middleimportance: should knowfreq 9%

basics

~20 s

A GGUF build runs on LM Studio's llama.cpp engine on Mac, Windows and Linux; an MLX build runs on Apple's MLX engine, on Apple Silicon only. Pick MLX for a Mac-only setup, GGUF when other machines must match.

open as a page

In LM Studio, where do per-model default load settings live, what do they fix, and which loads inherit them?

level: middleimportance: should knowfreq 8%

basics

~20 s

Per-model defaults are set from the gear icon on a model in My Models: GPU offload, context length, flash attention and more. Every later load of that model in LM Studio, lms load included, starts from them.

open as a page

An app on LM Studio's server gets replies ignoring its system prompt — how does lms log stream show what the model received?

level: middleimportance: should knowfreq 5%

basics

~20 s

lms log stream prints, for each prediction made while it is attached, the model identifier and the exact formatted input string, then the output, so you can see whether the system text survived the request and the chat template.

open as a page

A deploy script runs lms load your-model on every release; why does lms ps list several copies a week later, and what fixes it?

level: middleimportance: should knowfreq 7%

basics

~20 s

Every lms load creates a new instance even when the model is already loaded, and lms-loaded models have no idle TTL, so copies pile up. Unload first, give the load a fixed --identifier so a repeat errors out, or add --ttl.

open as a page

With Ollama 0.35.0, what context length does a model get when nothing sets one, and how do you change it?

level: middleimportance: should knowfreq 17%

basics

~20 s

Ollama 0.35.0 picks the default from total VRAM at startup: 4k tokens under 24 GiB, 32k from 24 to 48 GiB, 256k at 48 GiB and up. OLLAMA_CONTEXT_LENGTH changes it server-wide and options.num_ctx per request.

open as a page

An app on Ollama stalls for seconds on the first request after a quiet spell — which setting causes it, and how do you keep models loaded?

level: middleimportance: should knowfreq 12%

basics

~20 s

Ollama unloads an idle model after keep_alive, 5 minutes by default, so the next request reloads it. Send keep_alive with a longer duration or -1 per request, or set OLLAMA_KEEP_ALIVE on the server; 0 or ollama stop unloads.

open as a page

When an Ollama Modelfile builds FROM a library model, which settings does `ollama create` inherit, replace or merge from the base?

level: middleimportance: should knowfreq 9%

basics

~20 s

ollama create keeps the base's weights and every layer you omit. A new TEMPLATE, SYSTEM or MESSAGE set replaces the base's; PARAMETER merges key by key, so one stop line replaces the whole stop list; LICENSE appends.

open as a page

An OpenAI-SDK app calls an Ollama 0.35 model baked with SYSTEM, temperature 0.2 and num_ctx 16384 via /v1/chat/completions — which settings apply?

level: middleimportance: should knowfreq 12%

basics

~20 s

Only num_ctx is safe: /v1 cannot send a context size, so the Modelfile's 16384 applies. SYSTEM applies only when the client sends no system message first, and /v1 fills an omitted temperature with 1.0, overriding the baked 0.2.

open as a page

After a week of `ollama pull` fills a laptop's disk, how is Ollama's OLLAMA_MODELS store laid out, and how do you reclaim or move it?

level: middleimportance: should knowfreq 12%

basics

~10 s

OLLAMA_MODELS holds manifests/ (one small JSON per name:tag) and blobs/ (sha256-named layers shared between manifests). Free space with ollama rm, which deletes only blobs no other manifest uses; move the store by setting OLLAMA_MODELS.

open as a page

How do you pull a community GGUF from Hugging Face straight into Ollama, which quant arrives by default, and how does a private repo authenticate?

level: middleimportance: should knowfreq 9%

basics

~10 s

Run ollama pull hf.co/{username}/{repository}. Ollama takes Q4_K_M when the repo has it, else a reasonable quant present; add :{quantization} to choose. Private repos need Ollama's id_ed25519.pub added as a Hugging Face SSH key.

open as a page

showing 1–30 of 55