From b1688ac7ddf56c2bc392bf7d96d13d11b050fb2f Mon Sep 17 00:00:00 2001 From: fretuks Date: Mon, 21 Sep 2026 19:40:15 +0200 Subject: [PATCH] update default model to `qwen3:14b` across routes, services, and frontend components --- README.md | 2 ++ public/script.js | 2 +- src/routes/chats.js | 6 +++--- src/routes/personas.js | 4 ++-- src/services/chatService.js | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8e26121..3c771e8 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ The server is configured around an Ollama-compatible API surface: - `POST /chat`: accepts `{ model, messages, stream: true }` and returns newline-delimited JSON stream chunks with `message.content`. - `GET /tags`: returns the available model list. +`qwen3:14b` is the default model for chat and roleplay. The model selector loads available models from `/tags` and selects `qwen3:14b` when available (otherwise the first returned model). Existing chats retain their saved model selection. + The refactor adds explicit upstream timeout handling, cached model listing, and `GET /health` for degraded-state visibility. ## Schema Notes diff --git a/public/script.js b/public/script.js index 34705af..9fe6260 100644 --- a/public/script.js +++ b/public/script.js @@ -1775,7 +1775,7 @@ async function displayModels() { } modelSelect.innerHTML = ""; availableModelsById = new Map(models.map((model) => [String(model.model || model.name || ""), model])); - const preferredModelId = "mistral:latest"; + const preferredModelId = "qwen3:14b"; const preferredIndex = models.findIndex((model) => (model.model || model.name) === preferredModelId); models.forEach((model, index) => { const modelId = String(model.model || model.name || ""); diff --git a/src/routes/chats.js b/src/routes/chats.js index 6b216f7..863cd21 100644 --- a/src/routes/chats.js +++ b/src/routes/chats.js @@ -22,7 +22,7 @@ const sendMessageValidator = (body) => { if (!chatId) return {error: "chatId is required"}; if (!message) return {error: "message is required"}; if (body.webSearch !== undefined && typeof body.webSearch !== "boolean") return {error: "webSearch must be a boolean"}; - return {value: {message, chatId, model: String(body?.model || "mistral:latest"), webSearch: body.webSearch === true}}; + return {value: {message, chatId, model: String(body?.model || "qwen3:14b"), webSearch: body.webSearch === true}}; }; const organizationValidator = (body) => ({ @@ -478,7 +478,7 @@ export function createChatsRouter({repositories, chatService, modelService, conf const result = await chatService.retryMessage({ user: req.session.user, chatId, - selectedModel: String(req.body?.model || "mistral:latest"), + selectedModel: String(req.body?.model || "qwen3:14b"), targetMessage, retryStyle: String(req.body?.style || "").trim() || null }); @@ -502,7 +502,7 @@ export function createChatsRouter({repositories, chatService, modelService, conf const result = await chatService.retryMessage({ user: req.session.user, chatId, - selectedModel: String(req.body?.model || "mistral:latest"), + selectedModel: String(req.body?.model || "qwen3:14b"), targetMessage, retryStyle: String(req.body?.style || "").trim() || null }); diff --git a/src/routes/personas.js b/src/routes/personas.js index 81ad459..6fd3e0b 100644 --- a/src/routes/personas.js +++ b/src/routes/personas.js @@ -21,7 +21,7 @@ const roleplayStartValidator = (body) => { assistantPersonaId, userPersonaId: body?.userPersonaId ? Number(body.userPersonaId) : null, scenarioPrompt: normalizeOptionalText(body?.scenarioPrompt), - model: String(body?.model || "mistral:latest") + model: String(body?.model || "qwen3:14b") } }; }; @@ -255,7 +255,7 @@ export function createPersonasRouter({repositories, chatService, modelService, c chat = repositories.getChat(chat.id, user); try { const opener = await chatService.generateRoleplayOpener({ - selectedModel: "mistral:latest", + selectedModel: "qwen3:14b", assistantPersona: persona, userPersona, scenarioPrompt, diff --git a/src/services/chatService.js b/src/services/chatService.js index d54caf6..6b56b80 100644 --- a/src/services/chatService.js +++ b/src/services/chatService.js @@ -69,7 +69,7 @@ export function createChatService(repositories, modelService, config, webSearchP }; const getGenerationSettings = (session, requestedModel) => ({ - model: requestedModel || session.preferred_model || "mistral:latest", + model: requestedModel || session.preferred_model || "qwen3:14b", generation: { temperature: session.temperature ?? undefined, contextLength: session.context_length ?? undefined, @@ -168,7 +168,7 @@ export function createChatService(repositories, modelService, config, webSearchP return repositories.createChat(user, persona.name, persona.id, userPersonaId, scenarioPrompt, scenarioSummary); }; - const generateRoleplayOpener = async ({selectedModel = "mistral:latest", assistantPersona, userPersona, scenarioPrompt, sceneSummary}) => { + const generateRoleplayOpener = async ({selectedModel = "qwen3:14b", assistantPersona, userPersona, scenarioPrompt, sceneSummary}) => { const baseMessages = [ {role: "system", content: buildPersonaPrompt(assistantPersona)}, ...(userPersona ? [{role: "system", content: buildUserPersonaPrompt(userPersona)}] : []),