Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

fix: prefer Ollama reasoning controls for local models

nash_su69987c398438
diff --git a/src/lib/llm-providers.test.ts b/src/lib/llm-providers.test.ts
index 7237ee87..b4e00da3 100644
--- a/src/lib/llm-providers.test.ts
+++ b/src/lib/llm-providers.test.ts
@@ -548,6 +548,21 @@ describe("reasoning controls", () => {
expect(body.reasoning_effort).toBe("none")
})
+ it("uses Ollama-native reasoning control instead of Qwen chat_template_kwargs", () => {
+ const cfg = mkConfig({
+ provider: "ollama",
+ model: "qwen3:8b",
+ ollamaUrl: "http://localhost:11434",
+ })
+ const body = getProviderConfig(cfg).buildBody(
+ [{ role: "user", content: "hi" }],
+ { reasoning: { mode: "off" } },
+ ) as Record<string, unknown>
+
+ expect(body.reasoning_effort).toBe("none")
+ expect(body.chat_template_kwargs).toBeUndefined()
+ })
+
it("maps Ollama low/medium/high reasoning straight through to reasoning_effort", () => {
const cfg = mkConfig({
provider: "ollama",
diff --git a/src/lib/llm-providers.ts b/src/lib/llm-providers.ts
index 70c26ac5..9db2fa2b 100644
--- a/src/lib/llm-providers.ts
+++ b/src/lib/llm-providers.ts
@@ -400,10 +400,6 @@ function buildOpenAiCompatibleBody(
return body
}
- if (reasoning.mode === "off" && isQwenThinkingModel(config.model)) {
- body.chat_template_kwargs = { enable_thinking: false }
- }
-
if (config.provider === "ollama") {
// Ollama's OpenAI-compatible /v1/chat/completions maps reasoning
// control onto `reasoning_effort` ("high"|"medium"|"low"|"none";
@@ -432,6 +428,10 @@ function buildOpenAiCompatibleBody(
return body
}
+ if (reasoning.mode === "off" && isQwenThinkingModel(config.model)) {
+ body.chat_template_kwargs = { enable_thinking: false }
+ }
+
if (config.provider === "openai" && reasoning.mode !== "auto" && reasoning.mode !== "off") {
if (reasoning.mode === "low" || reasoning.mode === "medium" || reasoning.mode === "high") {
body.reasoning_effort = reasoning.mode