Skip to content

Commit 5d73507

Browse files
committed
ML Intern: fixed model set with pinned providers, plus a model probe script
ML Intern conversations now run on ML_ASSISTANT_MODELS, a JSON5 list where each entry pins the inference provider the model was verified on. Creating a mode conversation swaps any unlisted model (the router alias included) for the set's default, switching a mode conversation to an unlisted model is refused, and the pinned provider overrides the user's per-model preference at request time in both the conversation route and the parked-turn sweeper. With the pill on, the Models page and the settings sidebar list only the set. Why: probing GLM-5.3-Flash on the router showed the same model behaving very differently by provider at 300k-1M tokens. On baseten it intermittently fabricated, looped, or emitted garbage and then ended the turn with a normal finish_reason "stop", which chat-ui shows as a finished answer. Together and novita answered verbatim at 1,034k tokens. Baseten also silently discards a tool call whose name is not in the tools array. The router's auto choice landed on baseten, so pinning is the only way to keep the mode off unverified serving. scripts/probe-model.ts (npm run probe-model) reproduces the check: it sends the tool loop's request shape with a generated ML Intern history and grades recall of verbatim log lines, so candidates can be verified before they are listed. Chart pins from the 2026-09-02 matrix: GLM-5.3-Flash on together, Kimi-K3 on baseten, GLM-5.3 on novita.
1 parent a84171c commit 5d73507

21 files changed

Lines changed: 1204 additions & 21 deletions

File tree

.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,14 @@ APP_BASE="" # base path of the app, e.g. /chat, left blank as default
230230
# set). Enforced server-side: submissions reserve their worst case (flavor
231231
# price x timeout) and settle to actual runtime.
232232
ML_ASSISTANT_MODE=
233+
# Models ML Intern conversations may run on, JSON5 array; first entry is the
234+
# default. Each entry pins the inference provider the model was verified on for
235+
# 1M-token tool loops (scripts/probe-model.ts) — the user's provider preference
236+
# and "auto" are ignored for mode conversations. `parameters` merge over the
237+
# catalog entry's. The router alias cannot be listed. Empty: the mode refuses
238+
# to start a conversation.
239+
# e.g. [{"id":"zai-org/GLM-5.3-Flash","provider":"together"},{"id":"moonshotai/Kimi-K3","provider":"together"}]
240+
ML_ASSISTANT_MODELS=
233241
### Body size limit for SvelteKit https://svelte.dev/docs/kit/adapter-node#Environment-variables-BODY_SIZE_LIMIT
234242
BODY_SIZE_LIMIT=15728640
235243
PUBLIC_COMMIT_SHA=

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ models/*
2525
/test-results
2626
/playwright-report
2727
/blob-report
28-
/playwright/.cache
28+
/playwright/.cache
29+
.probe-results/

chart/env/dev.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ envVars:
7373
LLM_ROUTER_ENABLE_TOOLS: "true"
7474
LLM_ROUTER_TOOLS_MODEL: "moonshotai/Kimi-K2.6"
7575
TRANSCRIPTION_MODEL: "openai/whisper-large-v3-turbo"
76+
# ML Intern model set: provider pinned per model from scripts/probe-model.ts runs
77+
# (2026-09-02). GLM-5.3-Flash on together recalled 5/5 at 924k tokens; Kimi-K3 on
78+
# baseten 6/6 at 1,046k (fireworks-ai is the alternate: 6/6, slower prefill);
79+
# GLM-5.3 degrades above ~800k on every provider — novita was the best of them.
80+
ML_ASSISTANT_MODELS: >
81+
[{"id": "zai-org/GLM-5.3-Flash", "provider": "together"}, {"id": "moonshotai/Kimi-K3", "provider": "baseten"}, {"id": "zai-org/GLM-5.3", "provider": "novita"}]
7682
MCP_SERVERS: >
7783
[{"name": "Web Search (Exa)", "url": "https://mcp.exa.ai/mcp?tools=web_search_exa,get_code_context_exa,crawling_exa"}, {"name": "Hugging Face", "url": "https://hf.co/mcp?login"}]
7884
MCP_TOOL_TIMEOUT_MS: "120000"

chart/env/prod.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ envVars:
8383
LLM_ROUTER_ENABLE_TOOLS: "true"
8484
LLM_ROUTER_TOOLS_MODEL: "moonshotai/Kimi-K2.6"
8585
TRANSCRIPTION_MODEL: "openai/whisper-large-v3-turbo"
86+
# ML Intern model set: provider pinned per model from scripts/probe-model.ts runs
87+
# (2026-09-02). GLM-5.3-Flash on together recalled 5/5 at 924k tokens; Kimi-K3 on
88+
# baseten 6/6 at 1,046k (fireworks-ai is the alternate: 6/6, slower prefill);
89+
# GLM-5.3 degrades above ~800k on every provider — novita was the best of them.
90+
ML_ASSISTANT_MODELS: >
91+
[{"id": "zai-org/GLM-5.3-Flash", "provider": "together"}, {"id": "moonshotai/Kimi-K3", "provider": "baseten"}, {"id": "zai-org/GLM-5.3", "provider": "novita"}]
8692
MCP_SERVERS: >
8793
[{"name": "Web Search (Exa)", "url": "https://mcp.exa.ai/mcp?tools=web_search_exa,get_code_context_exa,crawling_exa"}, {"name": "Hugging Face", "url": "https://hf.co/mcp?login"}]
8894
MCP_TOOL_TIMEOUT_MS: "120000"

docs/source/configuration/overview.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,23 @@ ML_ASSISTANT_MODE=true # Compile in ML Assistant mode (composer header
8484
Pass it to `npm run build`, or as a `--build-arg` to `docker build`. Setting it on
8585
an already-built instance has no effect.
8686

87+
## ML Assistant Models
88+
89+
When the build ships ML Assistant mode, its conversations run on a fixed model set
90+
rather than whatever the composer has selected. Each entry pins the inference
91+
provider the model was verified on for long tool loops (`npm run probe-model` runs
92+
that verification); the user's provider preference and `auto` are ignored for mode
93+
conversations, and the router alias can't be listed. The first entry is the default.
94+
95+
```ini
96+
ML_ASSISTANT_MODELS=`[
97+
{"id": "zai-org/GLM-5.3-Flash", "provider": "together", "parameters": {"max_tokens": 49152}},
98+
{"id": "moonshotai/Kimi-K3", "provider": "together"}
99+
]`
100+
```
101+
102+
Leave it empty and the mode refuses to start a conversation.
103+
87104
## User Authentication
88105

89106
Use OpenID Connect for authentication:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"updateLocalEnv": "vite-node --options.transformMode.ssr='/.*/' scripts/updateLocalEnv.ts",
2121
"populate": "vite-node --options.transformMode.ssr='/.*/' scripts/populate.ts",
2222
"config": "vite-node --options.transformMode.ssr='/.*/' scripts/config.ts",
23+
"probe-model": "vite-node --options.transformMode.ssr='/.*/' scripts/probe-model.ts --",
2324
"prepare": "husky"
2425
},
2526
"devDependencies": {

0 commit comments

Comments
 (0)