update default model to qwen3:14b across routes, services, and frontend components
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
@@ -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 || "");
|
||||
|
||||
+3
-3
@@ -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
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)}] : []),
|
||||
|
||||
Reference in New Issue
Block a user