llama.cpp release b9438, shipped May 30 2026, adds custom CSS injection to the built-in web interface. Operators can apply styles at server launch via the --ui-config flag; users can apply CSS interactively through the settings panel. No rebuild or source access required.

What Happened

PR #23904 introduces a customCSS field in the Developer section of the web UI settings. Pass a JSON file containing a customCSS key to --ui-config to apply styles at server startup, or open the settings panel and paste CSS directly into the Custom JSON field for live, reactive updates without a page reload. Both paths inject CSS into a single <style> element in the document head via a Svelte action. The implementation writes CSS as textContent, not innerHTML, so malformed CSS cannot introduce HTML injection. A startup migration converts the legacy custom config key to the new customJson format automatically, preserving existing setups.

Why It Matters

Before this release, every visual change to the llama.cpp web interface meant patching TypeScript source and recompiling the entire binary. That ruled out theming for anyone running prebuilt releases, binary distributions, or Homebrew installs. With b9438, appearance configuration is a runtime concern: a team operator can ship a branded dark-mode interface without touching the build pipeline, and individual users can match the UI to their monitor setup or reduce eye strain with a single config change. Because customCSS is a syncable setting, the style persists across browser reloads and sessions automatically.

Key Details

  • Release b9438, May 30 2026, PR #23904
  • customCSS field available in Developer > Custom JSON in the settings panel
  • Also configurable via --ui-config yourfile.json at server startup
  • CSS syncs across sessions and updates reactively without a page reload
  • CSS is injected as text content, not innerHTML: malformed CSS cannot introduce XSS
  • Legacy custom config key migrates to customJson at startup; backward compatible

What to Do Next

If you run llama.cpp via llama-server, create a JSON config file and point --ui-config at it:

{
  "customCSS": "body { background: #1a1a1a; color: #f0f0f0; } .message { font-size: 15px; line-height: 1.6; }"
}

Then launch with llama-server --ui-config my-theme.json. For interactive use while the server is already running, open the settings panel, go to Developer > Custom JSON, and add the customCSS key. Changes apply immediately. For prebuilt binaries, this approach is currently the only way to change the interface appearance without compiling from source.