-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Webui/server config defaults #18028
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
ServeurpersoCom
wants to merge
12
commits into
ggml-org:master
Choose a base branch
from
ServeurpersoCom:webui/server-config-defaults
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Webui/server config defaults #18028
ServeurpersoCom
wants to merge
12
commits into
ggml-org:master
from
ServeurpersoCom:webui/server-config-defaults
+152
−18
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add --webui-config-file and LLAMA_WEBUI_CONFIG to configure - WebUI defaults from server side. Exposes webui_settings in - /props for both router and child modes Completes TODO placeholder in server-models.cpp
- Add webui_settings support in parameter sync service - Adds WebUI params to SYNCABLE_PARAMETERS User-specific settings (apiKey, theme, etc.) excluded
Collaborator
Author
Collaborator
Author
|
It work |
ggerganov
reviewed
Dec 14, 2025
ggerganov
reviewed
Dec 14, 2025
Co-authored-by: Georgi Gerganov <[email protected]>
Co-authored-by: Georgi Gerganov <[email protected]>
Co-authored-by: Georgi Gerganov <[email protected]>
Co-authored-by: Georgi Gerganov <[email protected]>
allozaur
approved these changes
Dec 15, 2025
Collaborator
allozaur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good on my end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Make sure to read the contributing guidelines before submitting a PR
server/webui: add CLI support for configuring WebUI defaults
Summary
Implements issue #17940: adds '--webui-config-file' CLI argument and 'LLAMA_WEBUI_CONFIG' environment variable to configure WebUI default settings from the server side.
Problem
WebUI settings are hardcoded in the frontend with no server-side configuration. This causes problems:
Example: Issue #17940 requests ability to set 'pasteLongTextToFileLen: 0' by default, but currently every user must manually configure this in every new browser session.
The TODO that guided this implementation
While exploring the codebase, I found this intentional placeholder in 'server-models.cpp' (lines 6-16):
This empty JSON was left by the original developers as a clear signal for where webui settings should go. This PR completes that TODO.
Backend Changes (C++)
What was added
1. CLI argument ('common/arg.cpp')
2. Environment variable ('server.cpp')
3. JSON parsing logic ('server.cpp')
4. Expose in /props ('server-models.cpp' + 'server-context.cpp')
How it works
The C++ backend is completely agnostic: it doesn't know what settings exist. It just:
This means adding new WebUI settings never requires C++ changes.
Frontend Changes (TypeScript)
What was added
1. API type ('types/api.d.ts')
2. Syncable parameters ('services/parameter-sync.ts')
3. Store integration ('stores/server.svelte.ts' + 'stores/settings.svelte.ts')
4. Tests ('parameter-sync.spec.ts')
Settings intentionally excluded
These are user-specific and should NOT be server-configurable:
Priority Order
Server operators set defaults, but users keep control:
This means:
Usage Examples
Config file
Environment variable
LLAMA_WEBUI_CONFIG='{"pasteLongTextToFileLen":0}' ./llama-serverBoth (env var overrides file)
LLAMA_WEBUI_CONFIG='{"pdfAsImage":true}' \ ./llama-server --webui-config-file webui-defaults.jsonCheck it works
curl http://localhost:8080/props | jq .webui_settingsTesting
Backend
Frontend
Backward Compatibility
No breaking changes:
What this enables
Now server operators can:
And adding new configurable settings only requires TypeScript changes: no C++ recompilation needed.
Fixes #17940