update default model to qwen3:14b across routes, services, and frontend components

This commit is contained in:
2026-09-21 19:40:15 +02:00
parent adbc547dfd
commit b1688ac7dd
5 changed files with 10 additions and 8 deletions
+2
View File
@@ -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`. - `POST /chat`: accepts `{ model, messages, stream: true }` and returns newline-delimited JSON stream chunks with `message.content`.
- `GET /tags`: returns the available model list. - `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. The refactor adds explicit upstream timeout handling, cached model listing, and `GET /health` for degraded-state visibility.
## Schema Notes ## Schema Notes
+1 -1
View File
@@ -1775,7 +1775,7 @@ async function displayModels() {
} }
modelSelect.innerHTML = ""; modelSelect.innerHTML = "";
availableModelsById = new Map(models.map((model) => [String(model.model || model.name || ""), model])); 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); const preferredIndex = models.findIndex((model) => (model.model || model.name) === preferredModelId);
models.forEach((model, index) => { models.forEach((model, index) => {
const modelId = String(model.model || model.name || ""); const modelId = String(model.model || model.name || "");
+3 -3
View File
@@ -22,7 +22,7 @@ const sendMessageValidator = (body) => {
if (!chatId) return {error: "chatId is required"}; if (!chatId) return {error: "chatId is required"};
if (!message) return {error: "message is required"}; if (!message) return {error: "message is required"};
if (body.webSearch !== undefined && typeof body.webSearch !== "boolean") return {error: "webSearch must be a boolean"}; 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) => ({ const organizationValidator = (body) => ({
@@ -478,7 +478,7 @@ export function createChatsRouter({repositories, chatService, modelService, conf
const result = await chatService.retryMessage({ const result = await chatService.retryMessage({
user: req.session.user, user: req.session.user,
chatId, chatId,
selectedModel: String(req.body?.model || "mistral:latest"), selectedModel: String(req.body?.model || "qwen3:14b"),
targetMessage, targetMessage,
retryStyle: String(req.body?.style || "").trim() || null retryStyle: String(req.body?.style || "").trim() || null
}); });
@@ -502,7 +502,7 @@ export function createChatsRouter({repositories, chatService, modelService, conf
const result = await chatService.retryMessage({ const result = await chatService.retryMessage({
user: req.session.user, user: req.session.user,
chatId, chatId,
selectedModel: String(req.body?.model || "mistral:latest"), selectedModel: String(req.body?.model || "qwen3:14b"),
targetMessage, targetMessage,
retryStyle: String(req.body?.style || "").trim() || null retryStyle: String(req.body?.style || "").trim() || null
}); });
+2 -2
View File
@@ -21,7 +21,7 @@ const roleplayStartValidator = (body) => {
assistantPersonaId, assistantPersonaId,
userPersonaId: body?.userPersonaId ? Number(body.userPersonaId) : null, userPersonaId: body?.userPersonaId ? Number(body.userPersonaId) : null,
scenarioPrompt: normalizeOptionalText(body?.scenarioPrompt), 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); chat = repositories.getChat(chat.id, user);
try { try {
const opener = await chatService.generateRoleplayOpener({ const opener = await chatService.generateRoleplayOpener({
selectedModel: "mistral:latest", selectedModel: "qwen3:14b",
assistantPersona: persona, assistantPersona: persona,
userPersona, userPersona,
scenarioPrompt, scenarioPrompt,
+2 -2
View File
@@ -69,7 +69,7 @@ export function createChatService(repositories, modelService, config, webSearchP
}; };
const getGenerationSettings = (session, requestedModel) => ({ const getGenerationSettings = (session, requestedModel) => ({
model: requestedModel || session.preferred_model || "mistral:latest", model: requestedModel || session.preferred_model || "qwen3:14b",
generation: { generation: {
temperature: session.temperature ?? undefined, temperature: session.temperature ?? undefined,
contextLength: session.context_length ?? 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); 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 = [ const baseMessages = [
{role: "system", content: buildPersonaPrompt(assistantPersona)}, {role: "system", content: buildPersonaPrompt(assistantPersona)},
...(userPersona ? [{role: "system", content: buildUserPersonaPrompt(userPersona)}] : []), ...(userPersona ? [{role: "system", content: buildUserPersonaPrompt(userPersona)}] : []),