feat: add a disabled-by-default Slotstream AI Providers preset - #6223
Conversation
Closes atomantic#5816. The rest of the issue's scope was already shipped independently (atomantic#6162 and follow-ups): slotstreamModelManager.js already enumerates cached checkpoints, previews size/destination/free-disk and refuses before the first byte via the shared download-preflight helper, verifies each file's sha256, and resumes across restart/cancel; the consent modal (DownloadPreflightConfirm.jsx) and card UI (SlotstreamServerCard.jsx) already wire it up. The one piece missing was the AI Providers preset itself. - data.reference/providers.json + providers.sample.json: new `slotstream` api-type preset (127.0.0.1:5564, disabled by default), modeled exactly on the mtplx preset. Text-only, so no CLI/TUI wrapper is registered, unlike MTPLX. - migration 340: seeds the preset into existing installs via the same makeProviderSeedMigration factory migration 272 used for MTPLX. - docs/features/slotstream.md: removes the "if one exists" hedge now that the preset is real, documents the per-file hash verification, and adds an AI Providers section. - docs/features/product-surfaces.md: lists Slotstream (and MTPLX, previously missing) under Local LLM Runtimes. - Two existing tests hardcode the shipped-provider-id list this preset joins (an api-type provider always gets a refresh button): client/src/utils/providers.test.js and server/lib/aiToolkit/internal/modelFetchers.test.js, both updated to include 'slotstream' in their expected/refreshable lists. Verified: the new migration's test, every test that derives its expectations from providers.json/providers.sample.json (tuiHandshake, cliChildEnv, harnesses, bootstrapSequence, providerModels, the two updated above), and the slotstream server/model-manager suites — all green. Two unrelated pre-existing failures on this Windows machine (aiToolkit/runner.test.js EBUSY temp-file cleanup, AIProviders.test.jsx a waitFor timing flake) were confirmed to reproduce identically on a clean main with none of this branch's changes applied, so they are not from this change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
atomantic
left a comment
There was a problem hiding this comment.
✅ Approved
Approve: the PR ships the one piece issue #5816 left unshipped, a disabled-by-default api-type Slotstream provider preset (seed entries, migration 340 for existing installs, docs), modeled exactly on the proven mtplx factory pattern. The consent-gated model manager and docs page the issue also asked for already exist in main, so the diff matches the issue's remaining requirement, and the seed lockstep plus every affected suite run green.
Scope: Adds a disabled-by-default slotstream api provider preset to data.reference/providers.json and the aiToolkit sample, adds seed migration 340 for existing installs, updates docs/features/slotstream.md and product-surfaces.md, and updates the two shipped-catalog test lists.
💡 Non-blocking (1)
docs/features/product-surfaces.md:197— Row also adds MTPLX, which the linked issue did not ask for
Test evidence
- ✅
cd server && npx vitest run lib/aiToolkit/internal/modelFetchers.test.js lib/tuiHandshake.test.js lib/cliChildEnv.test.js lib/providerModels.test.js routes/harnesses.test.js services/harnesses.test.js services/bootstrapSequence.test.js ../scripts/migrations/340-slotstream-provider.test.js— 8 files, 545 tests passed, including the new migration 340 test and both shipped-catalog invariants the PR updates; the route-error log lines in output are negative-path assertions, not failures. - ✅
cd client && npx vitest run src/utils/providers.test.js— 1 file, 280 tests passed, including the updated withButton list which now matches the server decorator for every shipped provider. - ✅
cd server && npx vitest run lib/aiToolkit/defaults/providersSeedParity.test.js lib/ollamaContext.test.js services/agentTuiSpawning.test.js cos-runner/allowedCommands.test.js lib/slotstreamCatalog.test.js lib/slotstreamModels.test.js lib/localProviderRuntime.test.js services/slotstreamModelManager.test.js services/slotstreamServerManager.test.js services/providerExecutionReadiness.test.js services/localRuntimeSetup.test.js— 11 files, 399 tests passed, including the data.reference-to-sample seed lockstep guard and all slotstream runtime suites the PR calls unaffected. - ⏭️
npm test (full server + client workspace suites)— Deliberately not used as review evidence: the sandbox denies network binds and some toolchains and background services, so a from-zero full run would report environment failures unrelated to the change; the targeted suites above cover every patched file and its callers.
Notes
- Migration number 340 duplicates 340-cos-config-seed-repair.js; harmless because the runner keys migrations by filename (scripts/run-migrations.js scanMigrationFiles and the applied-list), and 335, 336, and 339 already ship as duplicate pairs, so this follows the established pattern.
Claims verified against the code
- The slotstream preset is api-type, disabled by default, endpoint http://127.0.0.1:5564/v1, and its models array is exactly the three SLOTSTREAM_CATALOG ids (data.reference/providers.json:599; server/lib/slotstreamCatalog.js:30,38,46); 5564 is PORTS.SLOTSTREAM (server/lib/ports.js:20).
- The sample entry mirrors the seed entry field-for-field plus the sample-only secretEnvVars (server/lib/aiToolkit/defaults/providers.sample.json:641), and the seed parity guard passes.
- scripts/migrations/340-slotstream-provider.js:36 uses makeProviderSeedMigration (scripts/migrations/_lib.js:927), the same factory as migration 272-mtplx-providers; its frozen payload matches the seed entries and an install that already owns the slotstream id is left untouched.
- canRefreshModels returns true for every api-type provider (server/lib/aiToolkit/internal/modelFetchers.js:190), so slotstream gets the Refresh models button, matching both updated test lists.
- Docs claims verified against code: isSlotstreamProvider (server/services/slotstreamServerManager.js:518) matches any api/tui provider pointed at the managed loopback port, ensureSlotstreamProviderReady (server/services/slotstreamServerManager.js:526) lazy-starts the runtime, and streamResumableDownload (server/lib/downloadPreflight.js:315) takes expectedSha256 for per-file hash verification.
- No CLI/TUI slotstream wrapper is registered: the preset is api-only and the migration test pins opencode-slotstream and opencode-slotstream-tui as absent, as the issue requires for a text-only runtime.
- docs/README.md:42 already links slotstream.md (shipped with the earlier model-manager work), so the issue's doc-page-and-map requirement is met with this PR's product-surfaces update.
| | Surface / Area | Route(s) | Key Capabilities & Workflows | Related Guides | | ||
| |---|---|---|---| | ||
| | **Local LLM Runtimes** | `/models/llms` | Management of local model servers: Ollama, LM Studio, vLLM, SGLang, and llama.cpp / llama-server. | [Claude on Ollama](./claude-ollama.md) | | ||
| | **Local LLM Runtimes** | `/models/llms` | Management of local model servers: Ollama, LM Studio, vLLM, SGLang, llama.cpp / llama-server, MTPLX, and Slotstream (SSD-streaming MoE for checkpoints larger than RAM). | [Claude on Ollama](./claude-ollama.md), [MTPLX](./mtplx.md), [Slotstream](./slotstream.md) | |
There was a problem hiding this comment.
💡 Non-blocking — Row also adds MTPLX, which the linked issue did not ask for
Issue #5816 asked to list the new Slotstream page under the product surface map; this row additionally adds MTPLX and its doc link to the same cell, which the issue never requested. The mention is accurate (docs/features/mtplx.md exists) and corrects a real omission in the very row being updated, so it is a scope note, not a blocker; split it out only if the maintainers want strict single-issue scope.
Summary
Closes #5816.
The rest of the issue's scope shipped independently while this was in flight (#6162 and its follow-ups):
slotstreamModelManager.jsalready enumerates cached checkpoints, previews size/destination/free-disk and refuses before the first byte via the shared download-preflight helper (assessDownloadPreflight/assertDownloadFits), verifies each file's sha256 (expectedSha256instreamResumableDownload), and resumes across restart/cancel. The consent modal (DownloadPreflightConfirm.jsxviauseDownloadPreflightConfirm) and the card UI (SlotstreamServerCard.jsx) already wire all of that up. The one piece the issue asked for that genuinely didn't exist yet was the AI Providers preset itself.What this adds
data.reference/providers.json+providers.sample.json: a newslotstreamapi-type preset (http://127.0.0.1:5564/v1, disabled by default), modeled exactly on the existingmtplxpreset. Text-only, so — per the issue — noopencode-slotstreamCLI/TUI wrapper is registered, unlike MTPLX: Slotstream is not a valid CoS coding-agent runner.scripts/migrations/340-slotstream-provider.js(+ test): seeds the preset into existing installs via the samemakeProviderSeedMigrationfactory migration 272 used for MTPLX. An install that already owns theslotstreamid is left untouched.docs/features/slotstream.md: removes the "(or use theslotstreampreset if one exists in AI Providers)" hedge now that it's real, documents the per-file hash verification under the download step, and adds a short AI Providers preset section.docs/features/product-surfaces.md: lists Slotstream (and MTPLX, which was missing too) under Local LLM Runtimes.api-type provider gets a "Refresh models" button (canRefreshModelsinmodelFetchers.js), same asmtplx/lmstudio/ollama:client/src/utils/providers.test.jsandserver/lib/aiToolkit/internal/modelFetchers.test.js, both updated to includeslotstream.models/defaultModeluse the threeSLOTSTREAM_CATALOGcheckpoint ids (server/lib/slotstreamCatalog.js) rather than a fabricated served-model name — whichever checkpoint is actually cached and started is what answers, regardless of which catalog id a request names.Test plan
npx vitest run scripts/migrations/340-slotstream-provider.test.js— new migration test, green.providers.json/providers.sample.json—tuiHandshake.test.js,cliChildEnv.test.js,harnesses.test.js,bootstrapSequence.test.js,providerModels.test.js, plus the two updated above — all green, confirming the new preset doesn't trip any shipped-catalog invariant beyond the two intentional list updates.slotstreamServerManager.test.js/slotstreamModelManager.test.js— unaffected, still green.aiToolkit/runner.test.js— anEBUSYtemp-file-cleanup race;AIProviders.test.jsx— awaitFortiming flake in a fully self-mocked test with no dependency onproviders.json) were confirmed to reproduce identically on a cleanmainwith none of this branch's changes applied, so they're not from this change — left untouched as out of scope.🤖 Generated with Claude Code