From 010af4e730e2ab5cae4a78d6bdeebbc731c0ee4f Mon Sep 17 00:00:00 2001 From: Eva Ho Date: Thu, 12 Mar 2026 14:32:19 -0400 Subject: [PATCH] clean up --- server/routes.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/routes.go b/server/routes.go index 3fede3b5f..920a3aaa1 100644 --- a/server/routes.go +++ b/server/routes.go @@ -1168,23 +1168,21 @@ func (s *Server) ShowHandler(c *gin.Context) { return } - // For local (non-remote) models, override the context_length in ModelInfo - // with the server's effective context length so clients see what the model - // will actually run with, not just the training context from the GGUF file. + // For local models, override the context_length in ModelInfo + // with the server's context length so clients see what the model + // will actually run with, not just the context from the GGUF file. if resp.RemoteHost == "" && resp.ModelInfo != nil && m != nil { effectiveCtx := int(envconfig.ContextLength()) if effectiveCtx == 0 { effectiveCtx = s.defaultNumCtx } - // Apply model-level num_ctx override if set if numCtx, ok := m.Options["num_ctx"]; ok { if v, ok := numCtx.(float64); ok { effectiveCtx = int(v) } } - // Find and override the {arch}.context_length key for k := range resp.ModelInfo { if strings.HasSuffix(k, ".context_length") { resp.ModelInfo[k] = effectiveCtx