]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
webui: updated the chat service to only include max_tokens in the req… (#16489)
authorPascal <redacted>
Thu, 9 Oct 2025 20:54:57 +0000 (22:54 +0200)
committerGitHub <redacted>
Thu, 9 Oct 2025 20:54:57 +0000 (22:54 +0200)
* webui: updated the chat service to only include max_tokens in the request payload when the setting is explicitly provided, while still mapping explicit zero or null values to the infinite-token sentinel

* chore: update webui build output

tools/server/public/index.html.gz
tools/server/webui/src/lib/services/chat.ts

index 550df72e93c334ec409f53abeeee6ae77e46df38..5026edcebed37b7176eeaec592c60899b558a027 100644 (file)
Binary files a/tools/server/public/index.html.gz and b/tools/server/public/index.html.gz differ
index e1dad24a8f2460e52728970188a7da9581f3bc16..8d9dcf75801c64b369797fa71a453186204cdbba 100644 (file)
@@ -122,9 +122,10 @@ export class ChatService {
                requestBody.reasoning_format = currentConfig.disableReasoningFormat ? 'none' : 'auto';
 
                if (temperature !== undefined) requestBody.temperature = temperature;
-               // Set max_tokens to -1 (infinite) if not provided or empty
-               requestBody.max_tokens =
-                       max_tokens !== undefined && max_tokens !== null && max_tokens !== 0 ? max_tokens : -1;
+               if (max_tokens !== undefined) {
+                       // Set max_tokens to -1 (infinite) when explicitly configured as 0 or null
+                       requestBody.max_tokens = max_tokens !== null && max_tokens !== 0 ? max_tokens : -1;
+               }
 
                if (dynatemp_range !== undefined) requestBody.dynatemp_range = dynatemp_range;
                if (dynatemp_exponent !== undefined) requestBody.dynatemp_exponent = dynatemp_exponent;