Skip to content

Misc. bug: llama-server webui overriding command line parameters #13277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
merc4derp opened this issue May 3, 2025 · 3 comments
Open

Misc. bug: llama-server webui overriding command line parameters #13277

merc4derp opened this issue May 3, 2025 · 3 comments

Comments

@merc4derp
Copy link

Name and Version

llama-server --version
version: 5269 (1d36b36)
built with MSVC 19.43.34808.0 for x64

Operating systems

No response

Which llama.cpp modules do you know to be affected?

llama-server

Command line

Problem description & steps to reproduce

The server webui overrides the launch command parameters with its own saved settings. I can only see this as a bug.

Expected behavior would be to pass any explicitly given command line parameters to the webui and override its previously stored values instead.

The current behavior makes the webui needlessly hard to use when swapping models.

First Bad Commit

No response

Relevant log output

@TeeAaTeeUu
Copy link

If wanting to have it locally for now, you can skip sending those WebUI defaults:

Image
Show git diff for adding 'useServerDefaults' button to advanced settings
diff --git a/tools/server/webui/src/Config.ts b/tools/server/webui/src/Config.ts
index 5eef608c..1f564fef 100644
--- a/tools/server/webui/src/Config.ts
+++ b/tools/server/webui/src/Config.ts
@@ -37,6 +37,7 @@ export const CONFIG_DEFAULT = {
   dry_penalty_last_n: -1,
   max_tokens: -1,
   custom: '', // custom json-stringified object
+  useServerDefaults: false, // don't send defaults
   // experimental features
   pyIntepreterEnabled: false,
 };
@@ -79,6 +80,7 @@ export const CONFIG_INFO: Record<string, string> = {
     'DRY sampling reduces repetition in generated text even across long contexts. This parameter sets DRY penalty for the last n tokens.',
   max_tokens: 'The maximum number of token per output.',
   custom: '', // custom json-stringified object
+  useServerDefaults: 'When enabled, skip sending WebUI defaults (e.g., temperature) and use the server\'s default values instead.',
 };
 // config keys having numeric value (i.e. temperature, top_k, top_p, etc)
 export const CONFIG_NUMERIC_KEYS = Object.entries(CONFIG_DEFAULT)
diff --git a/tools/server/webui/src/components/SettingDialog.tsx b/tools/server/webui/src/components/SettingDialog.tsx
index b0044d25..a4f1f886 100644
--- a/tools/server/webui/src/components/SettingDialog.tsx
+++ b/tools/server/webui/src/components/SettingDialog.tsx
@@ -191,6 +191,11 @@ const SETTING_SECTIONS: SettingSection[] = [
         label: 'Show tokens per second',
         key: 'showTokensPerSecond',
       },
+      {
+        type: SettingInputType.CHECKBOX,
+        label: 'Use server defaults for parameters (skip sending WebUI defaults)',
+        key: 'useServerDefaults',
+      },
       {
         type: SettingInputType.LONG_INPUT,
         label: (
diff --git a/tools/server/webui/src/utils/app.context.tsx b/tools/server/webui/src/utils/app.context.tsx
index 96cffd95..8142196d 100644
--- a/tools/server/webui/src/utils/app.context.tsx
+++ b/tools/server/webui/src/utils/app.context.tsx
@@ -209,25 +209,27 @@ export const AppContextProvider = ({
         messages,
         stream: true,
         cache_prompt: true,
-        samplers: config.samplers,
-        temperature: config.temperature,
-        dynatemp_range: config.dynatemp_range,
-        dynatemp_exponent: config.dynatemp_exponent,
-        top_k: config.top_k,
-        top_p: config.top_p,
-        min_p: config.min_p,
-        typical_p: config.typical_p,
-        xtc_probability: config.xtc_probability,
-        xtc_threshold: config.xtc_threshold,
-        repeat_last_n: config.repeat_last_n,
-        repeat_penalty: config.repeat_penalty,
-        presence_penalty: config.presence_penalty,
-        frequency_penalty: config.frequency_penalty,
-        dry_multiplier: config.dry_multiplier,
-        dry_base: config.dry_base,
-        dry_allowed_length: config.dry_allowed_length,
-        dry_penalty_last_n: config.dry_penalty_last_n,
-        max_tokens: config.max_tokens,
+        ...(config.useServerDefaults ? {} : {
+            samplers: config.samplers,
+            temperature: config.temperature,
+            dynatemp_range: config.dynatemp_range,
+            dynatemp_exponent: config.dynatemp_exponent,
+            top_k: config.top_k,
+            top_p: config.top_p,
+            min_p: config.min_p,
+            typical_p: config.typical_p,
+            xtc_probability: config.xtc_probability,
+            xtc_threshold: config.xtc_threshold,
+            repeat_last_n: config.repeat_last_n,
+            repeat_penalty: config.repeat_penalty,
+            presence_penalty: config.presence_penalty,
+            frequency_penalty: config.frequency_penalty,
+            dry_multiplier: config.dry_multiplier,
+            dry_base: config.dry_base,
+            dry_allowed_length: config.dry_allowed_length,
+            dry_penalty_last_n: config.dry_penalty_last_n,
+            max_tokens: config.max_tokens,
+        }),
         timings_per_token: !!config.showTokensPerSecond,
         ...(config.custom.length ? JSON.parse(config.custom) : {}),
       };

@ServeurpersoCom
Copy link

ServeurpersoCom commented May 9, 2025

If wanting to have it locally for now, you can skip sending those WebUI defaults:
Image
Show git diff for adding 'useServerDefaults' button to advanced settings

This is exactly what I was missing, I was waiting on this thread without saying anything, I wanted my webui used by friends to be on the default recommended settings (for Qwen3 MoE for example you have to lower the temperature and the top_k for thought mode and have a min_p at 0). I had to script the patch of index.html with sed lol Thanks a lot ! I do a git pull sometimes every hour to keep up with the developers and try new models long live to llama.cpp

@ServeurpersoCom
Copy link

ServeurpersoCom commented May 10, 2025

I make this :
master...ServeurpersoCom:llama.cpp:webui-dynamic-config

Implemented dynamic config loading and reset behavior:
    - On startup, the app checks if localStorage.config exists and is non-empty. If not, it fetches defaults from the server.
    - The "Reset to default" button now properly:
        - fetches fresh config from the server,
        - updates localStorage,
        - calls saveConfig() to refresh the app state instantly.
    - Removed reliance on hardcoded CONFIG_DEFAULT. The server is now the single source of truth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants