From f4f7758cae656c0252b40a469477dfc9b3e42532 Mon Sep 17 00:00:00 2001 From: Emanuil Rusev Date: Fri, 7 Aug 2026 16:31:40 +0300 Subject: [PATCH] webui: load the model selected via ?model= when ?load=true (#26707) * webui: load the model selected via ?model= Opening the WebUI with ?model= selects the model but doesn't load it. The load only starts when you send your first message, so you wait for it then. This loads it as soon as the page opens, while you're still typing your prompt. It's what the model dropdown already does, and it isn't awaited, so the UI still works while the model loads. This is the path the Llama macOS app uses to open the WebUI, so it's a common way in. * webui: gate the load behind ?load=true Loading on landing is opt-in, so a plain ?model= link behaves as before and doesn't allocate memory on its own. * webui: name the chat URL params Collects the query params the chat routes read into a URL_PARAMS constant, instead of repeating the literals across three files. NEW_CHAT_PARAM folds into it. --- .../dialogs/DialogModelNotAvailable.svelte | 3 ++- tools/ui/src/lib/constants/routes.ts | 14 +++++++++-- tools/ui/src/routes/(chat)/+page.svelte | 25 +++++++++++++------ .../src/routes/(chat)/chat/[id]/+page.svelte | 10 ++++---- 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/tools/ui/src/lib/components/app/dialogs/DialogModelNotAvailable.svelte b/tools/ui/src/lib/components/app/dialogs/DialogModelNotAvailable.svelte index 89d23cd4b..583c5fcb0 100644 --- a/tools/ui/src/lib/components/app/dialogs/DialogModelNotAvailable.svelte +++ b/tools/ui/src/lib/components/app/dialogs/DialogModelNotAvailable.svelte @@ -1,5 +1,6 @@