[PR #13181] docs: clarify num_ctx parameter description #45359

Open
opened 2026-04-25 01:04:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13181
Author: @ssam18
Created: 11/20/2025
Status: 🔄 Open

Base: mainHead: fix-num-ctx-docs


📝 Commits (5)

  • fa5b043 docs: clarify num_ctx parameter description
  • 2363fad docs: correct num_ctx description based on reviewer feedback
  • 61cd137 Update num_ctx default value to 4096
  • 6170d7f docs: expand num_ctx description to address review feedback
  • b8839d7 docs: fix num_ctx cap behavior per reviewer feedback.

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 docs/modelfile.mdx (+4 -1)

📄 Description

Description

This PR clarifies the description of the num_ctx parameter in the Modelfile documentation.

Problem

The previous description stated: "Sets the size of the context window used to generate the next token."

This was misleading because it suggested num_ctx only affects the next token generation, when it actually defines the total token capacity for the entire conversation (input prompt + generated response).

Solution

Updated the description to:

Sets the size of the context window. This is the maximum number of tokens the model can handle at once, including both the input prompt and the generated response.

This clarification helps users understand:

  • num_ctx limits the total conversation size
  • It includes both the prompt and the generated tokens
  • Why ollama may fail when the combined prompt and response exceed this limit

Changes

  • Updated docs/modelfile.mdx with clearer num_ctx description

Fixes #12474


🔄 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/13181 **Author:** [@ssam18](https://github.com/ssam18) **Created:** 11/20/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-num-ctx-docs` --- ### 📝 Commits (5) - [`fa5b043`](https://github.com/ollama/ollama/commit/fa5b043a848b9117dfa4dff878e3a3c449b2c773) docs: clarify num_ctx parameter description - [`2363fad`](https://github.com/ollama/ollama/commit/2363fad38ef49f9a706a2eb0150ad3acd305596f) docs: correct num_ctx description based on reviewer feedback - [`61cd137`](https://github.com/ollama/ollama/commit/61cd137c5445b4f411a091992cdb06b22604b8de) Update num_ctx default value to 4096 - [`6170d7f`](https://github.com/ollama/ollama/commit/6170d7f4494d2a059adfee1d9132ad561207ca05) docs: expand num_ctx description to address review feedback - [`b8839d7`](https://github.com/ollama/ollama/commit/b8839d7e834f94a86f4766b52fcd4345b7969a0f) docs: fix num_ctx cap behavior per reviewer feedback. ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/modelfile.mdx` (+4 -1) </details> ### 📄 Description ## Description This PR clarifies the description of the `num_ctx` parameter in the Modelfile documentation. ## Problem The previous description stated: "Sets the size of the context window used to generate the next token." This was misleading because it suggested `num_ctx` only affects the next token generation, when it actually defines the **total token capacity** for the entire conversation (input prompt + generated response). ## Solution Updated the description to: > Sets the size of the context window. This is the maximum number of tokens the model can handle at once, including both the input prompt and the generated response. This clarification helps users understand: - `num_ctx` limits the **total** conversation size - It includes both the prompt and the generated tokens - Why ollama may fail when the combined prompt and response exceed this limit ## Changes - Updated `docs/modelfile.mdx` with clearer `num_ctx` description Fixes #12474 --- <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-25 01:04:37 -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#45359