From 107def07c836f90184ec2068841080adde0d48da Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Fri, 2 Jan 2026 17:27:28 +0800 Subject: [PATCH] updated lite and sdui (+1 squashed commits) Squashed commits: [3172b5d19] updated lite (+1 squashed commits) Squashed commits: [45081b0e2] updated glm nothink template --- embd_res/kcpp_sdui.embd | 20 ++++++++++---------- embd_res/klite.embd | 20 +++++++++++++++++++- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/embd_res/kcpp_sdui.embd b/embd_res/kcpp_sdui.embd index def6a9bd5..0ef7f0eea 100644 --- a/embd_res/kcpp_sdui.embd +++ b/embd_res/kcpp_sdui.embd @@ -5,10 +5,10 @@ Stable UI for KoboldCpp - diff --git a/embd_res/klite.embd b/embd_res/klite.embd index f8eda3d33..d39ae828f 100644 --- a/embd_res/klite.embd +++ b/embd_res/klite.embd @@ -4078,7 +4078,7 @@ Current version indicated by LITEVER below. "name":"GLM-4.5 Non-Thinking", "user":"<|user|>\\n", "user_end":"/nothink", - "assistant":"<|assistant|>\\n", + "assistant":"<|assistant|>\\nWe can answer immediately.", "assistant_end":"", "system":"<|system|>\\n", "system_end":"", @@ -6532,6 +6532,19 @@ Current version indicated by LITEVER below. if (event.data && event.data.choices && event.data.choices.length>0) { if(event.data.choices[0].text) { + //crappy fix for OpenRouter completions, which can provide reasoning on the same chunk + if(streaming_was_thinking) + { + streaming_was_thinking = false; + if(event.data.choices[0].reasoning!=null && event.data.choices[0].reasoning!="") + { + synchro_pending_stream += event.data.choices[0].reasoning; + } + if(localsettings.think_injected==1 || synchro_pending_stream.includes(localsettings.start_thinking_tag.replaceAll("\\n", "\n"))) + { + synchro_pending_stream += localsettings.stop_thinking_tag.replaceAll("\\n", "\n"); + } + } synchro_pending_stream += event.data.choices[0].text; } else if(event.data.choices[0].delta && event.data.choices[0].delta.content) @@ -6605,6 +6618,11 @@ Current version indicated by LITEVER below. } } } + else if(event.data.choices[0].reasoning!=null && event.data.choices[0].reasoning!="") + { + streaming_was_thinking = true; + synchro_pending_stream += event.data.choices[0].reasoning; + } //collect logprobs if detected if(event.data.choices[0].logprobs && event.data.choices[0].logprobs.content && event.data.choices[0].logprobs.content.length>0)