Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(chat): open new conversations on a model that is actually serving

nirholasfe6ac106549b
diff --git a/chat/src/App.svelte b/chat/src/App.svelte
index 25f29846d..537f5f28a 100644
--- a/chat/src/App.svelte
+++ b/chat/src/App.svelte
@@ -19,6 +19,7 @@
priorityOrder,
formatMultipleModelNames,
BUILTIN_MODELS,
+ resolveDefaultModel,
} from './providers.js';
import ModelSelector from './ModelSelector.svelte';
import CompanyLogo from './CompanyLogo.svelte';
@@ -1750,11 +1751,13 @@
const seenIds = new Set(serverFreeModels.map((m) => m.id));
models = [...serverFreeModels, ...userModels.filter((m) => !seenIds.has(m.id))];
- // Auto-select default built-in model if no model chosen yet, or if the saved model no longer exists
+ // Auto-select the default model when none is chosen yet, or when the saved
+ // one is no longer being served. resolveDefaultModel prefers a LIVE model
+ // over the configured id, so a retired default cannot strand the picker on
+ // a model that answers every message with an error.
const savedModelStillValid = convo.models?.[0]?.id && models.some((m) => m.id === convo.models[0].id);
if (!savedModelStillValid) {
- const defaultId = $brandConfig.default_model;
- const defaultModel = models.find((m) => m.id === defaultId) ?? BUILTIN_MODELS[0];
+ const defaultModel = resolveDefaultModel(models, $brandConfig.default_model);
if (defaultModel) convo = { ...convo, models: [defaultModel] };
}
});
diff --git a/chat/src/providers.js b/chat/src/providers.js
index 3d02f4e5d..dc2b3e0be 100644
--- a/chat/src/providers.js
+++ b/chat/src/providers.js
@@ -9,14 +9,39 @@ import {
localProvidersEnabled,
} from './stores.js';
+// First-paint seed ONLY — the real list comes from /api/chat/models, which
+// returns what OpenRouter is serving right now, ranked best-first.
+//
+// Do not treat these ids as durable. OpenRouter retires `:free` endpoints with
+// no notice: in July 2026 all five ids this list previously carried went dead at
+// once and every new conversation opened on a model that could not answer. The
+// app now replaces this seed with the live list as soon as it loads, and falls
+// back to a live id rather than to this array (see resolveDefaultModel).
export const BUILTIN_MODELS = [
- { id: 'openai/gpt-oss-120b:free', name: 'GPT OSS 120B', provider: 'Built-in', modality: 'text->text' },
- { id: 'meta-llama/llama-3.3-70b-instruct:free', name: 'Llama 3.3 70B', provider: 'Built-in', modality: 'text->text' },
- { id: 'google/gemma-3-27b-it:free', name: 'Gemma 3 27B', provider: 'Built-in', modality: 'text->text' },
- { id: 'qwen/qwen3-coder:free', name: 'Qwen3 Coder', provider: 'Built-in', modality: 'text->text' },
- { id: 'nousresearch/hermes-3-llama-3.1-405b:free', name: 'Hermes 3 405B', provider: 'Built-in', modality: 'text->text' },
+ { id: 'openai/gpt-oss-20b:free', name: 'GPT OSS 20B', provider: 'Built-in', modality: 'text->text' },
+ { id: 'nvidia/nemotron-3-super-120b-a12b:free', name: 'Nemotron 3 Super 120B', provider: 'Built-in', modality: 'text->text' },
+ { id: 'google/gemma-4-31b-it:free', name: 'Gemma 4 31B', provider: 'Built-in', modality: 'text->text' },
+ { id: 'inclusionai/ling-3.0-flash:free', name: 'Ling 3.0 Flash', provider: 'Built-in', modality: 'text->text' },
+ { id: 'nvidia/nemotron-3-ultra-550b-a55b:free', name: 'Nemotron 3 Ultra 550B', provider: 'Built-in', modality: 'text->text' },
];
+/**
+ * Pick the model a conversation should open on.
+ *
+ * Order: the configured default when it is actually available, else the first
+ * model the server says is live, else the local seed. The middle rung is the
+ * one that matters — it is what keeps chat working through a model retirement
+ * without a redeploy.
+ */
+export function resolveDefaultModel(available, configuredId) {
+ const live = Array.isArray(available) ? available : [];
+ return (
+ (configuredId && live.find((m) => m.id === configuredId)) ||
+ live[0] ||
+ BUILTIN_MODELS[0]
+ );
+}
+
export const providers = [
{
name: 'OpenRouter',
diff --git a/chat/src/stores.js b/chat/src/stores.js
index 5d2ba3cc8..abef73557 100644
--- a/chat/src/stores.js
+++ b/chat/src/stores.js
@@ -8,7 +8,9 @@ export const brandConfig = writable({
logo_url: null,
accent_color: '#6366f1',
tagline: 'Chat with any AI model',
- default_model: 'openai/gpt-oss-120b:free',
+ // Overwritten by /api/chat/config, which resolves a model that is live now.
+ // Kept null so a stale id can never be the thing the picker opens on.
+ default_model: null,
agent_id: null,
system_prompt: '',
});