[GH-ISSUE #15848] negligent documentation lack of explanation for how to configure default context length on Linux needs to be remediated #72159

Open
opened 2026-05-05 03:34:18 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @k98kurz on GitHub (Apr 27, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15848

What is the issue?

Documentation on context length shows only how to set it with an app that does not exist or with constant manual intervention which does not even work because the service runs automatically without registering as a service queryable with service --status-all.

I consider this a bug as it is clearly not a sane, intended behavior. There must be some way to accomplish this sanely if an app that sometimes exists is able to do it, so why not add real information to the documentation?

Update: the offending page is here. I dug around, experimented some more, and discovered that this page requires an update to include the information here but made explicit, e.g.

  1. Edit the systemd service by calling systemctl edit ollama.service. This will open an editor.
  2. Add the following:
[Service]
Environment="OLLAMA_CONTEXT_LENGTH=32000"

If the Environment entry exists, add the OLLAMA_CONTEXT_LENGTH variable with the desired context length.
3. Save and exit.
4. Reload systemd and restart Ollama:

systemctl daemon-reload
systemctl restart ollama

Relevant log output


OS

Linux

GPU

AMD

CPU

Intel

Ollama version

0.20.4

Originally created by @k98kurz on GitHub (Apr 27, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15848 ### What is the issue? Documentation on context length shows only how to set it with an app that does not exist or with constant manual intervention which does not even work because the service runs automatically without registering as a service queryable with `service --status-all`. I consider this a bug as it is clearly not a sane, intended behavior. There must be some way to accomplish this sanely if an app that sometimes exists is able to do it, so why not add real information to the documentation? Update: the offending page is [here](https://docs.ollama.com/context-length). I dug around, experimented some more, and discovered that this page requires an update to include the information [here](https://docs.ollama.com/faq#setting-environment-variables-on-linux) but made explicit, e.g. > 1. Edit the systemd service by calling `systemctl edit ollama.service`. This will open an editor. > 2. Add the following: > ``` > [Service] > Environment="OLLAMA_CONTEXT_LENGTH=32000" > ``` > If the `Environment` entry exists, add the `OLLAMA_CONTEXT_LENGTH` variable with the desired context length. > 3. Save and exit. > 4. Reload systemd and restart Ollama: > ```bash > systemctl daemon-reload > systemctl restart ollama > ``` ### Relevant log output ```shell ``` ### OS Linux ### GPU AMD ### CPU Intel ### Ollama version 0.20.4
GiteaMirror added the bug label 2026-05-05 03:34:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#72159