[PR #15851] docs(context-length): add Linux (systemd) section for OLLAMA_CONTEXT_LENGTH #62025

Open
opened 2026-04-29 16:58:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15851
Author: @Anai-Guo
Created: 4/28/2026
Status: 🔄 Open

Base: mainHead: docs/context-length-systemd


📝 Commits (1)

  • cef0d3c docs(context-length): add Linux/systemd section for setting OLLAMA_CONTEXT_LENGTH

📊 Changes

1 file changed (+24 additions, -0 deletions)

View changed files

📝 docs/context-length.mdx (+24 -0)

📄 Description

Summary

Adds a "Linux (systemd)" subsection to docs/context-length.mdx describing how to set OLLAMA_CONTEXT_LENGTH when Ollama runs as a systemd service — the default after installing via the Linux install script.

Why

The current page only documents two paths:

  • App (slider) — not present on a headless Linux server.
  • CLI (OLLAMA_CONTEXT_LENGTH=64000 ollama serve) — won't take effect when the service is already running under systemd; exporting an env var in the shell does not affect the service.

Linux server users need the systemd unit-file approach. The information exists in the FAQ (Setting environment variables on Linux) but is generic and not linked from the context-length page, so users discovering the context-length docs first don't know to look there.

Reported in #15848.

Change

Adds a new ### Linux (systemd) subsection between the existing ### CLI and ### Check allocated context length and model offloading sections, with:

  • A 4-step systemctl edit walkthrough (mirroring the FAQ pattern, but specialized to OLLAMA_CONTEXT_LENGTH).
  • A note that shell-exported env vars don't reach the service.
  • A back-reference to the FAQ for other env vars, so this page stays focused.

Test plan

  • Markdown renders cleanly (verified locally — no MDX syntax issues).
  • Internal link ./faq#setting-environment-variables-on-linux matches the existing anchor in docs/faq.mdx.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15851 **Author:** [@Anai-Guo](https://github.com/Anai-Guo) **Created:** 4/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `docs/context-length-systemd` --- ### 📝 Commits (1) - [`cef0d3c`](https://github.com/ollama/ollama/commit/cef0d3ce7a6021432fb8ff63027807a02e5ff1f9) docs(context-length): add Linux/systemd section for setting OLLAMA_CONTEXT_LENGTH ### 📊 Changes **1 file changed** (+24 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/context-length.mdx` (+24 -0) </details> ### 📄 Description ## Summary Adds a "Linux (systemd)" subsection to `docs/context-length.mdx` describing how to set `OLLAMA_CONTEXT_LENGTH` when Ollama runs as a systemd service — the default after installing via the Linux install script. ## Why The current page only documents two paths: - **App** (slider) — not present on a headless Linux server. - **CLI** (`OLLAMA_CONTEXT_LENGTH=64000 ollama serve`) — won't take effect when the service is already running under systemd; exporting an env var in the shell does not affect the service. Linux server users need the systemd unit-file approach. The information exists in the FAQ ([Setting environment variables on Linux](https://docs.ollama.com/faq#setting-environment-variables-on-linux)) but is generic and not linked from the context-length page, so users discovering the context-length docs first don't know to look there. Reported in [#15848](https://github.com/ollama/ollama/issues/15848). ## Change Adds a new `### Linux (systemd)` subsection between the existing `### CLI` and `### Check allocated context length and model offloading` sections, with: - A 4-step `systemctl edit` walkthrough (mirroring the FAQ pattern, but specialized to `OLLAMA_CONTEXT_LENGTH`). - A note that shell-exported env vars don't reach the service. - A back-reference to the FAQ for other env vars, so this page stays focused. ## Test plan - [x] Markdown renders cleanly (verified locally — no MDX syntax issues). - [x] Internal link `./faq#setting-environment-variables-on-linux` matches the existing anchor in `docs/faq.mdx`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 16:58:57 -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#62025