Run a GGUF quant locally when the model fits comfortably in your memory, the context you need is modest, and keeping every byte on your own hardware matters more than anything else. Use a hosted OpenAI-compatible API when you need a model that is too large to run well at home, very long context, or you do not want to maintain a runtime. Both expose the same chat completions interface, so you can try each on your own prompts and switch with a change of base URL.
The checklist below goes topic by topic. Each section ends with the question that usually decides it.
Privacy and data handling
Local inference has the simplest privacy story: prompts never leave the machine. With llama.cpp's llama-server the server README lists 127.0.0.1 as the default host, so nothing listens on the network unless you change --host. Ollama's API is also served on localhost:11434 by default.
A hosted API means trusting the operator's retention policy. Read the policy itself, not the landing page. Questions worth asking any provider:
- Are prompts and completions stored, and for how long?
- Are API calls treated differently from chats in a web app or bot?
- Is any of it used for training?
- Can stored data be deleted, and by whom?
For Chainless, prompts and answers sent to the /v1 API are not stored; chats in the bot, mini app and playground are stored encrypted and can be deleted. The exact wording is on the privacy page.
Decides it: if policy says data must never leave your hardware, local wins regardless of the rest.
Hardware and memory
A GGUF file's size is roughly what you need in RAM or VRAM for the weights, plus the KV cache for context, plus runtime overhead. The Hub GGUF docs give the bits per weight for each quant type, for example 4.5 for Q4_K and about 6.56 for Q6_K, so you can estimate weight size from the parameter count before downloading.
Memory then grows with context. The Ollama context length docs say plainly that a larger context length increases the memory required. If the model does not fit on the GPU, layers move to the CPU and generation slows down. In llama.cpp you control this with -ngl (layers on the GPU); in Ollama, ollama ps shows the split in its PROCESSOR column.
With a hosted API, the hardware question disappears. You need a network connection and an HTTP client.
Decides it: if the model you want only fits at a very low-bit quant, or only with heavy CPU offload, test whether the quality and speed are acceptable before committing to local.
Context length
A model's trained context and the context your runtime actually allocates are different numbers.
-
llama-servertakes-c/--ctx-size. The default is0, which means "use the value from the model file". - Ollama picks a default based on available VRAM, per its docs: 4k under 24 GiB, 32k from 24 to 48 GiB, 256k at 48 GiB or more. You raise it with
OLLAMA_CONTEXT_LENGTHwhen starting the server or with the slider in the app. Ollama's OpenAI compatibility docs note that the OpenAI API has no field for context size, so through that interface you set it in a Modelfile withPARAMETER num_ctx.
The silent failure is truncation. A prompt longer than the allocated context gets cut, and the model answers about the part it saw. Check the configured context before you blame the model.
Hosted models publish their context and output limits. On Chainless every current model has a 1M-token context window and up to 131072 output tokens, which covers whole repositories or long log files in one request.
Decides it: if your work needs hundreds of thousands of tokens per request, local hardware is rarely enough for a large model.
Speed, and how to measure it
Do not trust anyone's speed numbers, including your own from last month. Measure two things on your own prompts:
- Time to first token (TTFT): how long until text starts streaming. Dominated by prompt processing and, for hosted APIs, network and queueing.
- Generation rate: tokens per second once streaming starts.
For local GGUF files, llama.cpp ships llama-bench. Its README explains that it reports prompt processing (pp) and text generation (tg) as average tokens per second with a standard deviation, excluding tokenization and sampling.
llama-bench -m ./model-Q4_K_M.gguf -p 512 -n 128 -ngl 99 For anything that speaks the OpenAI chat completions API, local or hosted, a short streaming script gives comparable numbers:
import os, time from openai import OpenAI client = OpenAI(base_url=os.environ["BASE_URL"], api_key=os.environ.get("API_KEY", "none")) prompt = open("prompt.txt").read() for run in range(3): t0 = time.perf_counter() first = None chunks = 0 stream = client.chat.completions.create( model=os.environ["MODEL"], messages=[{"role": "user", "content": prompt}], max_tokens=400, stream=True, ) for chunk in stream: if chunk.choices and chunk.choices[0].delta.content: if first is None: first = time.perf_counter() chunks += 1 end = time.perf_counter() print(f"run {run}: ttft {first - t0:.2f}s, {chunks} chunks in {end - first:.2f}s") Point it at http://localhost:11434/v1 for Ollama, at your llama-server address plus /v1, or at https://chainless.one/v1 with MODEL=glm-5.3-fast-uncensored and API_KEY=$CHAINLESS_API_KEY. Chunks are not exactly tokens, so compare runs against each other rather than reading the count as a token rate. Run each setup several times and at different hours; hosted latency varies with load.
Decides it: whichever setup gives acceptable TTFT and generation rate on your real prompt lengths, measured, not estimated.
Maintenance
Local setups need ongoing work:
- updating llama.cpp or Ollama as model architectures and chat templates change;
- re-downloading new quants when an uploader fixes a template or a tokenizer bug;
- watching driver and CUDA or Metal versions;
- keeping the machine on and reachable if other tools depend on it.
A hosted API moves that to the operator. Your side is an API key, the base URL and error handling. On Chainless the endpoints are GET /v1/models and POST /v1/chat/completions, errors are OpenAI-shaped, and the status codes are listed in the API docs. Expect to handle 429 with a retry and backoff.
Decides it: whether you want to own the runtime.
The checklist
| Question | Points to local GGUF | Points to hosted API |
|---|---|---|
| Must data stay on your hardware? | yes | no, if the retention policy fits |
| Does the model fit in memory at a quant you accept? | yes | no |
| Context per request | tens of thousands of tokens | hundreds of thousands or more |
| Measured TTFT and rate acceptable? | on your hardware | on the endpoint |
| Who maintains the runtime? | you | the operator |
| Offline use needed? | yes | no |
A setup that often works is both: a small local quant for quick, private work and a hosted large model for long-context jobs, behind the same OpenAI client code.
