Add model dropdowns to settings and set qwen2.5:1.5b as intent default
- Default OLLAMA_INTENT_MODEL to qwen2.5:1.5b in code instead of empty - Add GET /api/settings/models endpoint returning installed models and defaults - Validate intent_model against installed models on save (same as default_model) - Replace intent model text input with a dropdown of installed models - Add chat model dropdown to Assistant settings section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,11 @@ const store = useSettingsStore();
|
||||
const authStore = useAuthStore();
|
||||
const toastStore = useToastStore();
|
||||
const assistantName = ref("");
|
||||
const defaultModel = ref("");
|
||||
const intentModel = ref("");
|
||||
const installedModels = ref<string[]>([]);
|
||||
const defaultChatModel = ref("");
|
||||
const defaultIntentModel = ref("");
|
||||
const newEmail = ref("");
|
||||
const emailPassword = ref("");
|
||||
const changingEmail = ref(false);
|
||||
@@ -66,8 +70,19 @@ onMounted(async () => {
|
||||
assistantName.value = store.assistantName;
|
||||
newEmail.value = authStore.user?.email ?? "";
|
||||
|
||||
// Load installed models and configured defaults
|
||||
try {
|
||||
const modelsData = await apiGet<{ models: string[]; default_chat_model: string; default_intent_model: string }>("/api/settings/models");
|
||||
installedModels.value = modelsData.models;
|
||||
defaultChatModel.value = modelsData.default_chat_model;
|
||||
defaultIntentModel.value = modelsData.default_intent_model;
|
||||
} catch {
|
||||
// Ollama unreachable — dropdowns will be empty
|
||||
}
|
||||
|
||||
// Load notification preferences from user settings
|
||||
const allSettings = await apiGet<Record<string, string>>("/api/settings");
|
||||
defaultModel.value = allSettings.default_model ?? "";
|
||||
intentModel.value = allSettings.intent_model ?? "";
|
||||
if (allSettings.notify_task_reminders !== undefined) {
|
||||
notifyTaskReminders.value = allSettings.notify_task_reminders !== "false";
|
||||
@@ -157,7 +172,8 @@ async function saveAssistant() {
|
||||
try {
|
||||
await store.updateSettings({
|
||||
assistant_name: assistantName.value.trim() || "Fable",
|
||||
intent_model: intentModel.value.trim(),
|
||||
default_model: defaultModel.value,
|
||||
intent_model: intentModel.value,
|
||||
});
|
||||
saved.value = true;
|
||||
setTimeout(() => (saved.value = false), 2000);
|
||||
@@ -342,20 +358,22 @@ async function handleRestoreFile(event: Event) {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="default-model">Chat Model</label>
|
||||
<select id="default-model" v-model="defaultModel" class="input">
|
||||
<option value="">Default ({{ defaultChatModel || "qwen3" }})</option>
|
||||
<option v-for="m in installedModels" :key="m" :value="m">{{ m }}</option>
|
||||
</select>
|
||||
<p class="field-hint">Model used for new conversations.</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="intent-model">Intent Model</label>
|
||||
<input
|
||||
id="intent-model"
|
||||
v-model="intentModel"
|
||||
type="text"
|
||||
placeholder="Same as chat model"
|
||||
class="input"
|
||||
/>
|
||||
<p class="field-hint">
|
||||
Optional smaller/faster model for intent routing (e.g. <code>llama3.2:3b</code>,
|
||||
<code>qwen2.5:3b</code>). Leave empty to use the same model as chat.
|
||||
Can also be set via <code>OLLAMA_INTENT_MODEL</code> environment variable.
|
||||
</p>
|
||||
<select id="intent-model" v-model="intentModel" class="input">
|
||||
<option value="">Default ({{ defaultIntentModel || "qwen2.5:1.5b" }})</option>
|
||||
<option v-for="m in installedModels" :key="m" :value="m">{{ m }}</option>
|
||||
</select>
|
||||
<p class="field-hint">Smaller/faster model for intent routing. Runs before the main model to detect tool calls.</p>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
|
||||
Reference in New Issue
Block a user