OLLAMA_NUM_PARALLEL sets how many requests one loaded model serves at once. Default 1; each slot adds a full num_ctx of KV cache. How to set it, when to stop.
OLLAMA_NUM_PARALLEL is the number of requests a single loaded Ollama model processes at the same time. It defaults to 1 (since v0.10.0). Every extra slot reserves another full num_ctx of KV cache, so memory grows with num_ctx × num_parallel. Use 1 for one user or agent, 2–4 for a few concurrent clients if VRAM allows, and move to vLLM or SGLang when concurrency is the job.
- 1 (since v0.10.0)
- Per loaded model
- KV cache for num_ctx × num_parallel
- 512, then HTTP 503
Key takeaways
- The default is 1. Older guides that say "4, or 1 if memory is low" describe Ollama before v0.10.0 (July 2025).
- The setting is per loaded model, not per server. Two different models still run side by side, up to OLLAMA_MAX_LOADED_MODELS.
- Ollama starts the runner with num_ctx × num_parallel tokens of context, so each slot costs a full context's worth of KV cache.
- Some architectures are forced back to 1 regardless of the setting, including Qwen3.5, Qwen3-Next, Qwen3-VL, LFM2 and Nemotron-H, and the MLX engine runs requests sequentially.
- OLLAMA_MAX_QUEUE (default 512) only caps requests waiting for a model to load; when it overflows the API returns HTTP 503.
What does OLLAMA_NUM_PARALLEL do?
OLLAMA_NUM_PARALLEL sets how many requests each loaded model processes at the same time; requests beyond that wait in line. The FAQ defines it as “the maximum number of parallel requests each model will process at the same time” (Ollama docs). Under the hood, Ollama passes the value to its llama.cpp-based runner as a number of slots. Each slot holds one conversation’s KV cache, and the runner batches the active slots through the GPU together.
Two things follow from that design, and most confusion about ollama_num_parallel comes from missing one of them:
- It is per model, not per server. With
OLLAMA_NUM_PARALLEL=1, a request toqwen2.5-coder:7band a request tollama3.2still run at the same time, because they hit two different runners. Capping the whole server takesOLLAMA_MAX_LOADED_MODELS=1as well. - Parallel is not faster per request. Slots share the same GPU compute. You gain aggregate throughput (tokens per second summed across clients) and lose per-request speed.
Concurrency itself arrived in Ollama v0.2.0 in July 2024, announced as serving “multiple requests at the same time, using only a little bit of additional memory for each request” (release notes). The “little bit” depends heavily on context length, as shown below.
What is the ollama_num_parallel default, and how does Ollama choose it?
The default is 1, and Ollama no longer picks it automatically. The current source sets NumParallel = Uint("OLLAMA_NUM_PARALLEL", 1) (config.go, v0.40.13), and the v0.10.0 release notes (July 2025) say “Parallel request processing now defaults to 1” (release).
Before v0.10.0 the variable defaulted to 0, which meant “auto”: the scheduler used 4 slots when memory allowed and fell back to 1 otherwise. Many guides that still rank for this query describe that old behaviour, which is why you will read “the default is 4” in places.
Even when you raise the value, the scheduler overrides it to 1 in these cases (sched.go, v0.40.13):
| Case | What Ollama does |
|---|---|
| Embedding models (no completion capability) | Always 1 slot |
Architectures mllama, qwen3vl, qwen3vlmoe, qwen35, qwen35moe, qwen3next, lfm2, lfm2moe, nemotron_h, nemotron_h_moe, nemotron_h_omni | Forced to 1, logs “model architecture does not currently support parallel requests” |
| Models on the MLX engine (Apple Silicon preview) | Runner is started without a parallel flag; requests run one after another (#17280) |
The forced-1 list includes the Qwen3.5 family, so if your coding model is a Qwen3.5 build, OLLAMA_NUM_PARALLEL=4 does nothing for it today.
How much memory does each parallel slot cost?
Each slot costs one full num_ctx of KV cache. When it loads a model, Ollama computes the runner’s context as the effective num_ctx multiplied by num_parallel (effectiveLlamaServerContext in sched.go). The FAQ puts it the same way: memory needs scale with OLLAMA_NUM_PARALLEL × OLLAMA_CONTEXT_LENGTH (docs). Weights are loaded once; only the cache multiplies.
The KV cache per token for a standard transformer is 2 (keys and values) × layers × KV heads × head dimension × bytes per value. From the published configs, at the default f16 cache:
| Model | Layers / KV heads / head dim | KV per token | Per slot at 4k | Per slot at 8k | Per slot at 32k |
|---|---|---|---|---|---|
| Qwen2.5-Coder 7B | 28 / 4 / 128 | 56 KiB | 0.23 GB | 0.47 GB | 1.88 GB |
| Qwen2.5-Coder 32B | 64 / 8 / 128 | 256 KiB | 1.07 GB | 2.15 GB | 8.59 GB |
Layer and head counts come from the Qwen2.5-Coder-7B and 32B configs. The figures are arithmetic, not measurements, and leave out compute buffers.
The trap is Ollama’s automatic context length. If you don’t set num_ctx or OLLAMA_CONTEXT_LENGTH, Ollama picks 4k below 24 GiB of VRAM, 32k from 24 to 48 GiB, and 256k at 48 GiB and above (docs), capped at the model’s training context. On a 32 GB card, the 32B model above would get 32k per slot, so 4 slots ask for about 34 GB of cache, before weights. When the context is automatic, the scheduler steps it down after a failed load, so you may silently get a shorter context per slot instead of an error. Set the context explicitly when you raise parallelism. Ollama context length covers choosing the value, and OLLAMA_KV_CACHE_TYPE=q8_0 roughly halves the cache cost (see kv cache quantization).
How do you set OLLAMA_NUM_PARALLEL on macOS, Linux, Windows and Docker?
Set it in the environment of the Ollama server process, then restart the server. Setting it in the terminal where you run ollama run does nothing, because that is only the client. The steps below follow the FAQ.
macOS (app):
launchctl setenv OLLAMA_NUM_PARALLEL 4
launchctl setenv OLLAMA_CONTEXT_LENGTH 8192
# quit and reopen the Ollama appLinux (systemd service):
sudo systemctl edit ollama.service
# add under [Service]:
# Environment="OLLAMA_NUM_PARALLEL=4"
# Environment="OLLAMA_CONTEXT_LENGTH=8192"
sudo systemctl daemon-reload
sudo systemctl restart ollamaWindows: quit Ollama from the tray, open “Edit environment variables for your account”, add OLLAMA_NUM_PARALLEL with value 4, then start Ollama again. From a terminal, setx OLLAMA_NUM_PARALLEL 4 writes the same user variable.
Docker:
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 \
-e OLLAMA_NUM_PARALLEL=4 -e OLLAMA_CONTEXT_LENGTH=8192 \
--name ollama ollama/ollamaManual serve: OLLAMA_NUM_PARALLEL=4 ollama serve.
To confirm, read the server log. Ollama prints its resolved config, including OLLAMA_NUM_PARALLEL, at startup, and logs the runner’s parallel value when a model loads. If the startup line shows the old value, the variable never reached the server.
We build CandorNo GPU? Use a hosted model
Uncensored AI, right in your browser.
Candor runs open models with refusals removed, so it answers the questions other assistants deflect. New accounts get free credits, no card needed.
Try Candor freeWhy are requests still queued or rejected? (OLLAMA_MAX_QUEUE, MAX_LOADED_MODELS)
Requests queue whenever all slots of the target model are busy, and get a 503 only when the scheduler’s own backlog is full. Three settings interact:
OLLAMA_NUM_PARALLEL: busy slots. Request N+1 to the same model waits for a slot.OLLAMA_MAX_LOADED_MODELS: how many different models can be resident. The FAQ gives the default as 3 per GPU (or 3 for CPU inference); the code usesdefaultModelsPerGPU = 3. A new model must fit fully in VRAM to load next to others; otherwise requests wait while an idle model unloads (docs).OLLAMA_MAX_QUEUE: default 512. When the scheduler’s pending channel is full, Ollama returns HTTP 503 with “server busy, please try again. maximum pending requests exceeded” (sched.go).
The catch with ollama_max_queue: it does not cap requests to a model that is already loaded. Those go straight to the runner and wait on the slot semaphore, which has no depth limit. A user who set both values to 1 still saw unlimited queuing, and maintainer dhiltgen called it “a side effect of the way the scheduler is implemented”; a contributor reproduced it on main in June 2026 (#7758). If you need real backpressure, enforce it in a proxy in front of Ollama.
Models also unload after their keep-alive window, which turns the next request into a cold load; Ollama keep alive covers that timing.
When should you switch to vLLM or SGLang instead?
Switch when concurrency is the workload rather than an occasional overlap. Ollama reserves a fixed num_ctx block per slot whether or not a request uses it. vLLM and SGLang allocate KV cache in pages on demand and batch continuously, so the same VRAM holds more simultaneous requests. Reasonable triggers:
- You serve a team or a pipeline that routinely keeps more than a few requests in flight. See self hosted LLM server for team setups.
- You need predictable latency under load, or real queue limits and metrics.
- Your model’s architecture is on Ollama’s forced-1 list.
Ollama still wins for one developer, a laptop, CPU fallback and quick model switching. If you are choosing between the two engines, vLLM vs SGLang compares them.
What do developers report in practice?
Practitioner reports agree that parallel slots trade per-request speed for total throughput, and that higher values break more often than the docs suggest:
- Parallel can be slower end to end. A user running gpt-oss:20b on a 45+ GB NVIDIA setup with
OLLAMA_NUM_PARALLEL=2measured three requests at about 30 s sequentially and about 43 s in parallel, with GPU utilization at 40–55%. Another user on two RTX 3090s saw a 60-query batch finish in about the same 10 minutes at 1 or 2, and worse at 4 when a second copy loaded on the other GPU. A collaborator’s reading of the logs: individual requests slow down while aggregate tokens per second stays roughly flat (#12107, community reports). - High slot counts hit tensor limits. On 2× GH200, Ministral-3 14B with a 128k context crashed at parallel 8 but not 7, with an aggregate KV size of 1,048,576 tokens; others reported gemma4:26b working at 2 and crashing at 4. Suggested workarounds were one fewer slot or a slightly smaller context (#13887, community reports).
- “Not working” is often per-model scope. One user set
OLLAMA_NUM_PARALLEL=1in a container and still saw two agent sessions generating at once; the explanation offered in the thread was that each agent turn is a separate request and parallelism is per model (#19262, open). - Throughput gap versus vLLM. One Hacker News commenter reported vLLM delivering up to 3.2× the requests per second of Ollama on identical hardware, while calling Ollama good enough for a handful of concurrent users (HN). Another noted that on a 70B Q4_K_M you have to size the context window around the parallel count, not around one user (HN).
What should you set it to?
| Situation | Suggested value |
|---|---|
| One developer, one chat or one coding agent | 1 (default) |
| Agent that fans out sub-tasks, or 2–4 teammates sharing one GPU | 2–4, with an explicit 4k–8k num_ctx, after checking the memory table |
| Model on the forced-1 list or the MLX engine | Leave it; the value is ignored |
| Steady multi-user traffic, latency targets | Move the model to vLLM or SGLang |
Raise it one step at a time and watch ollama ps: if the model drops from 100% GPU to a CPU/GPU split, the extra slot cost you more than it gained.
FAQ
What is the OLLAMA_NUM_PARALLEL default?
1, since v0.10.0. Earlier versions auto-selected 4 or 1 based on available memory.
Is OLLAMA_NUM_PARALLEL=4 a good setting?
Only if four full contexts of KV cache fit in VRAM next to the weights and the architecture supports it. For a 7B coder at 8k it adds under 2 GB; for a 32B coder it adds about 8.6 GB.
Why is OLLAMA_NUM_PARALLEL not working?
The usual causes: the variable was set in your shell rather than the server’s environment, the server wasn’t restarted, the model’s architecture is forced to 1, the model runs on the MLX engine, or you are seeing two different models run side by side.
Can I set OLLAMA_NUM_PARALLEL per model?
No. It is a server-wide value applied to each loaded model; a per-model option is an open feature request (#4894). Run a second Ollama instance on another port if you need different values.
What does OLLAMA_MAX_QUEUE do?
It limits how many requests can wait in the scheduler (default 512) before Ollama answers HTTP 503. It does not limit requests waiting on an already-loaded model.
We build CandorSkip the setup
Want an uncensored model without hosting one?
Candor (candorai.dev) is an uncensored AI chat app that runs in your browser: it answers the questions mainstream assistants dodge, on health, money, law and work, without the lecture. New accounts get free credits, no card needed.
Facts from candorai.dev, checked Nov 10, 2026. Candor never changes how we rank or review models. Disclosure.
Sources (10)
- Ollama docs: FAQ, How does Ollama handle concurrent requests?
- Ollama docs: Context length (VRAM-based defaults)
- ollama/ollama v0.40.13 source: envconfig/config.go (defaults)
- ollama/ollama v0.40.13 source: server/sched.go (parallel slots, forced-1 architectures, queue)
- Ollama v0.10.0 release notes: parallel request processing now defaults to 1
- Ollama v0.2.0 release notes: concurrency support
- ollama/ollama issue #12107: Concurrent requests take longer than sequential (community report)
- ollama/ollama issue #7758: OLLAMA_MAX_QUEUE does not limit requests to the same model
- ollama/ollama issue #17280: Concurrent requests in the MLX engine (community report)
- Qwen2.5-Coder-32B-Instruct config.json (layers, KV heads)
Written by Refusal Rate editors from papers, model cards, official docs and pricing pages. Anything we ran ourselves is labeled as our own test, with the hardware and settings. Our method.