[PR #1971] [MERGED] add max context length check #10743

Closed
opened 2026-04-12 23:09:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/1971
Author: @mxyng
Created: 1/12/2024
Status: Merged
Merged: 1/12/2024
Merged by: @mxyng

Base: mainHead: mxyng/max-context-length


📝 Commits (1)

  • eaed6f8 add max context length check

📊 Changes

3 files changed (+15 additions, -0 deletions)

View changed files

📝 llm/ggml.go (+1 -0)
📝 llm/gguf.go (+9 -0)
📝 llm/llm.go (+5 -0)

📄 Description

setting a context length greater than what the model is trained for has adverse effects. to prevent this, if the user requests a larger context length, log and set it to the model's max


🔄 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/1971 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 1/12/2024 **Status:** ✅ Merged **Merged:** 1/12/2024 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/max-context-length` --- ### 📝 Commits (1) - [`eaed6f8`](https://github.com/ollama/ollama/commit/eaed6f8c4589197789b8f16d949bba67ab005114) add max context length check ### 📊 Changes **3 files changed** (+15 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `llm/ggml.go` (+1 -0) 📝 `llm/gguf.go` (+9 -0) 📝 `llm/llm.go` (+5 -0) </details> ### 📄 Description setting a context length greater than what the model is trained for has adverse effects. to prevent this, if the user requests a larger context length, log and set it to the model's max --- <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-12 23:09:22 -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#10743