[PR #14803] [CLOSED] server: use server's context length to set as part of config for local models #46093

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14803
Author: @hoyyeva
Created: 3/12/2026
Status: Closed

Base: mainHead: hoyyeva/server-context-length-local-config


📝 Commits (3)

  • ebd4d0e server: use server's context length to set as part of config for local models
  • 6287a80 add tests
  • 010af4e clean up

📊 Changes

2 files changed (+110 additions, -13 deletions)

View changed files

📝 server/routes.go (+36 -13)
📝 server/routes_test.go (+74 -0)

📄 Description

This PR updates:

  • update /api/show to report the server's context length for local models instead of the one from GGUF file
  • GetModelInfo now returns the model so ShowHandler can compute the context length without a redundant model load.

The problem we have on main is that the local models report their context length in /api/show but at runtime they actually use the server's context length. The integration tools reading /api/show see a context length that the server is actually not providing.


🔄 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/14803 **Author:** [@hoyyeva](https://github.com/hoyyeva) **Created:** 3/12/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `hoyyeva/server-context-length-local-config` --- ### 📝 Commits (3) - [`ebd4d0e`](https://github.com/ollama/ollama/commit/ebd4d0e498f96b460fbf8511280131e89cf0ed08) server: use server's context length to set as part of config for local models - [`6287a80`](https://github.com/ollama/ollama/commit/6287a8058778f1aa6f804d4e401138141a94f3da) add tests - [`010af4e`](https://github.com/ollama/ollama/commit/010af4e730e2ab5cae4a78d6bdeebbc731c0ee4f) clean up ### 📊 Changes **2 files changed** (+110 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `server/routes.go` (+36 -13) 📝 `server/routes_test.go` (+74 -0) </details> ### 📄 Description This PR updates: - update `/api/show` to report the server's context length for local models instead of the one from GGUF file - `GetModelInfo` now returns the model so `ShowHandler` can compute the context length without a redundant model load. The problem we have on main is that the local models report their context length in `/api/show` but at runtime they actually use the server's context length. The integration tools reading `/api/show` see a context length that the server is actually not providing. --- <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:37:53 -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#46093