[PR #14037] [MERGED] app: expose server's default context length to UI #25021

Closed
opened 2026-04-19 17:57:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14037
Author: @jmorganca
Created: 2/2/2026
Status: Merged
Merged: 2/21/2026
Merged by: @jmorganca

Base: mainHead: ollama-new-context


📝 Commits (1)

  • 68e8d47 app: expose server's default context length to UI

📊 Changes

12 files changed (+168 additions, -54 deletions)

View changed files

📝 app/server/server.go (+31 -10)
📝 app/server/server_test.go (+39 -14)
📝 app/store/database.go (+24 -2)
📝 app/store/database_test.go (+37 -0)
📝 app/store/testdata/schema.sql (+1 -1)
📝 app/ui/app/codegen/gotypes.gen.ts (+2 -0)
📝 app/ui/app/src/api.ts (+2 -4)
📝 app/ui/app/src/components/Settings.tsx (+11 -5)
📝 app/ui/app/src/components/ui/slider.tsx (+8 -4)
📝 app/ui/app/src/hooks/useSelectedModel.ts (+4 -2)
📝 app/ui/responses/types.go (+2 -1)
📝 app/ui/ui.go (+7 -11)

📄 Description

Parse the default_num_ctx from the server's "vram-based default context" log line and expose it through the inference compute API. This eliminates duplicate VRAM tier calculation logic in the frontend.

  • Add InferenceInfo struct with Computes and DefaultContextLength
  • Rename GetInferenceComputer to GetInferenceInfo
  • Handle missing default context line gracefully (older servers)
  • Add DefaultContextLength to InferenceComputeResponse
  • Update Settings UI to use server's default, disable slider while loading
  • Add disabled prop to Slider component (grays out + hides handle)
  • Migrate existing users with context_length=4096 to 0 (auto mode)

🔄 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/14037 **Author:** [@jmorganca](https://github.com/jmorganca) **Created:** 2/2/2026 **Status:** ✅ Merged **Merged:** 2/21/2026 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `ollama-new-context` --- ### 📝 Commits (1) - [`68e8d47`](https://github.com/ollama/ollama/commit/68e8d4771dce9ccd2a4c41e825b095b025937e2e) app: expose server's default context length to UI ### 📊 Changes **12 files changed** (+168 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `app/server/server.go` (+31 -10) 📝 `app/server/server_test.go` (+39 -14) 📝 `app/store/database.go` (+24 -2) 📝 `app/store/database_test.go` (+37 -0) 📝 `app/store/testdata/schema.sql` (+1 -1) 📝 `app/ui/app/codegen/gotypes.gen.ts` (+2 -0) 📝 `app/ui/app/src/api.ts` (+2 -4) 📝 `app/ui/app/src/components/Settings.tsx` (+11 -5) 📝 `app/ui/app/src/components/ui/slider.tsx` (+8 -4) 📝 `app/ui/app/src/hooks/useSelectedModel.ts` (+4 -2) 📝 `app/ui/responses/types.go` (+2 -1) 📝 `app/ui/ui.go` (+7 -11) </details> ### 📄 Description Parse the default_num_ctx from the server's "vram-based default context" log line and expose it through the inference compute API. This eliminates duplicate VRAM tier calculation logic in the frontend. - Add InferenceInfo struct with Computes and DefaultContextLength - Rename GetInferenceComputer to GetInferenceInfo - Handle missing default context line gracefully (older servers) - Add DefaultContextLength to InferenceComputeResponse - Update Settings UI to use server's default, disable slider while loading - Add disabled prop to Slider component (grays out + hides handle) - Migrate existing users with context_length=4096 to 0 (auto mode) --- <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-19 17:57: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#25021