dsh-mistral-vibe
Verifieddsh-mistral-vibe Β· v1.1.1 Β· MIT Β· Web UI
Mistral Vibe in DeepSeek Harness: a self-contained Mistral La Plateforme provider with the current Vibe model catalogue, per-model thinking levels mapped to reasoning_effort, streaming reasoning blocks, and a settings page that stores the whole model list
Install
dsh plugin add dsh-mistral-vibe Confirm the layer applied with dsh --profile default --dump-config β see the install guide.
Source
Tags
Readme
dsh-mistral-vibe
Mistral Vibe in DeepSeek Harness: a provider route for Mistral La Plateforme
that ships the current Vibe model catalogue, maps each model's thinking levels onto
reasoning_effort, streams reasoning back as a thinking block, and gives the route a
real settings page.
Self-contained by design: no imports from @deepseek-ai/* or pi-ai, no install-time
dependencies. The two schema helpers it needs are vendored under vendor/.
Features
- One provider route,
mistral-vibeβ chat and streaming throughPOST /v1/chat/completions, with tool calls, usage, andproviderRetryPolicy. - Thinking levels per model, taken from what the catalogue actually publishes:
offβreasoning_effort: "none",low/medium/high/maxsent verbatim. A model with no ladder gets no level control and never receives an unsupported effort. - Reasoning streamed as a block, not as text:
delta.contentarrays of{type: "thinking"}becomereasoning-delta, so the harness renders them as thinking. - A model list that is data, not code. One fetch writes the whole list
(shipped rows + everything the API reported) into the row's
modelsJson; the chat picker, the settings page and id resolution all read that store, so nothing has to be fetched twice. - One row per model.
/v1/modelslists every alias as its own row (64 rows for 13 models,type: "base"on all of them); discovery unions each row with itsaliasesarray and emits one entry per model. models.devsupplies the ladder, read field by field rather than guessed from ids:typefor chattability,modalities.inputfor vision (attachment: trueis also set on pdf/audio-only models),limit.*for the windows,reasoning_optionsfor the levels.- A settings page at Settings β Mistral Vibe: both credentials with an eye toggle, the endpoint, and the model list with its ladder, modality and window on every row.
- Secrets stay out of the row file. A saved key goes to the credential store; the YAML keeps only the reference.
- No quota fiction. Mistral exposes no readable allowance (
/v1/billing/subscriptionreturns a plan name and nothing else), so the page shows no meter. The route still captures rate-limit headers and refuses a call locally when a header already reportedremaining: 0.
Install
Requires DeepSeek Harness with the dsh CLI.
# from a directory containing this repo (or publish it, then use the bare name);
# <name> is the profile you boot, e.g. `web`
dsh plugin --profile <name> add ./dsh-mistral-vibe
dsh --profile <name>
Then open Settings β Models, pick Mistral Vibe, and paste a Vibe Code API key.
Other install methods
From a packed tarball (npm run pack produces dsh-mistral-vibe-<version>.tgz):
dsh plugin --profile <name> add ./dsh-mistral-vibe-<version>.tgz
This package is not built: lib/ is the shipped source, so a profile loads exactly what
is in the repo.
Configuration
Settings β Mistral Vibe owns every field. The same row is editable in
cordis.patch.yml if you prefer text.
| field | default | meaning |
|---|---|---|
displayName |
Mistral Vibe |
the label the picker shows for this route |
baseURL |
https://api.mistral.ai/v1 |
chat and model-list endpoint |
apiKey |
β | Vibe Code key, sent as Authorization: Bearer |
studioApiKey |
β | Studio/API key for account reads; falls back to the Vibe Code key |
apiKeyEnv |
MISTRAL_API_KEY |
credential-store name consulted when the row is empty |
disabledModels |
[] |
ids hidden from the picker, still listed on the page |
modelsJson |
"" |
the stored model list, written by Fetch available models |
bypassRewrite |
true |
send x-bili-passthrough: 1 so an in-process rewriter relays the body verbatim |
allowRemote |
true |
answer the settings routes for a non-loopback request (same-origin or with the token) |
accessToken |
β | token a cross-origin request must present; falls back to MISTRAL_VIBE_ACCESS_TOKEN |
Both keys are role("secret") and volatile(). The page never receives either value β
it gets hasKey / hasStudioKey booleans.
Fetching the model list
Fetch available models calls GET /v1/models with the draft key, merges the answer
into the stored list, and saves it. What lands in the store:
- rows the shipped catalogue already serves, with their real limits and ladder;
- rows Mistral serves that the bundle does not ship, marked new;
- nothing that models.dev calls an
embedding,speechortranscriptionrecord.
If the row cannot be written (read-only profile), the page says so instead of silently dropping the result.
Exposed deployments (HTTP/S, not just loopback)
The settings routes are served by the same web server as the page, so exposing the web UI over HTTP/S does not need any extra setup: the page's own requests are same-origin and are accepted.
| request | answer |
|---|---|
loopback (127.0.0.1, localhost, [::1]) |
always accepted |
same origin (Origin/Referer host equals Host, or Sec-Fetch-Site: same-origin) |
accepted |
different origin, with the token in x-mistral-vibe-token or Authorization: Bearer β¦ |
accepted |
| different origin, no token configured | 401 {"code":"access_token_required"} |
| different origin, wrong token | 401 {"code":"access_token_rejected"} |
allowRemote: false |
403 {"code":"loopback_only"} |
The reason the token matters: these routes can move baseURL and therefore where
the key is sent. Remote access on the page stores the token in this browser's
localStorage and sends it on every request; the value never enters the bundle.
Thinking levels
A level is sent only when the model publishes one:
| model | levels | wire |
|---|---|---|
deepseek-v4-1-flash-1017 |
off, low, high, max | none, low, high, max |
mistral-large-4 |
low, medium, high | verbatim |
mistral-medium-2604 |
off, high | none, high |
codestral-2508, ministral-*, voxtral-* |
none | no reasoning_effort |
Development
npm test # host + client suites, offline
npm run test:host # adapter, discovery, settings, wire encoding
npm run test:client # the browser half, rendered against a React stub
npm run test:contract # the emitted stream, through the harness's own assembler
npm run check # node --check both halves, then the suites and the audit
npm run audit:harness # run this adapter through the installed harness's own validators
npm run sync:models # rewrite MODEL_CATALOGUE from models.dev
npm run probe # live /v1/models read with the stored key
npm run stamp # rewrite the BUILD stamp in lib/index.js
Layout:
lib/index.js host half: adapter, catalogue, discovery, HTTP surface
lib/client.js browser half: the settings page and its nav glyph
vendor/ schemastery + cosmokit, vendored as ESM
locale/ en/zh titles for the settings entry
scripts/ sync-models, live-check, client-half-toggle
test/ host.test.mjs, contract.test.mjs, client.test.mjs
The suites need no network and no key: the host suite runs the real adapter against a
local SSE server, and the models.dev read is pointed at a local stub through
MISTRAL_MODELS_DEV_URL.
Session-safety invariants
A stream that is wrong here does not fail a turn β it writes a session log that later refuses to load. The rules the host actually enforces, and what this route guarantees against each:
| rule | where it bites | this route |
|---|---|---|
| a tool-call id must be unique for the whole session | assistant/message repeats advertised tool call <id> |
ids are a 9-character hash of the provider id plus a serial that never resets, so a provider that numbers calls call_1, call_2 per response cannot repeat across turns |
tool/call must echo the advertised name and arguments byte for byte |
tool/call <id> does not match one advertised tool call |
the block-end carries the same accumulated name/arguments the deltas streamed, and {} when nothing arrived, so the value always parses |
| only text, reasoning and tool-call blocks | cannot assemble incomplete block of type β¦ |
no other block type is ever started |
chunk types are a closed set; argumentsDelta is a string; every index is a non-negative safe integer |
AssistantStreamAccumulator.push throws |
enforced by the contract test, chunk by chunk |
usage precedes finish, nothing follows finish |
a stream that ends early loses usage | the generator yields usage then finish, last |
| each call gets its own block | two calls merging concatenates their arguments | a missing index, or an index reused by a different id, allocates a fresh slot |
npm run test:contract runs the emitted stream through the harness's real
AssistantStreamAccumulator and BlockAssembler (imported from the installed
DeepSeek Harness; the file prints SKIP when that install is absent) and then
applies the tool-lifecycle rules above. It is the only check that would have
caught the chatcmplt corruption before it hit a log.
Which build is running
A host keeps an applied plugin module in memory: re-applying the entry writes
applied to the operation log but does not re-import the file, so a fix can
be on disk and still not run. BUILD makes that observable β it is the hash of
lib/index.js without the stamp line, logged on mount, returned by
GET /mistral-vibe/config, and printed under the model list on the settings
page. "host build unknown" means the host is still serving a module loaded
before this field existed; restart DeepSeek Harness to pick the file up.
Route surface
| route | effect |
|---|---|
GET /mistral-vibe/config |
the row as the page needs it, plus build β no key values |
POST /mistral-vibe/config |
save apiKey, studioApiKey, baseURL, displayName, disabledModels |
POST /mistral-vibe/discover |
merge GET /v1/models into the stored list; answers {source, added, models, persisted} |
All three accept loopback and same-origin requests, and answer anything else with
401 {"code":"access_token_required"} or 401 {"code":"access_token_rejected"}
unless allowRemote: false, which restores 403 {"code":"loopback_only"}.
Auditing against the installed harness
npm run audit:harness imports the harness's real LlmRuntime and
BlockAssembler from
%LOCALAPPDATA%\Programs\DSH NEXT\resources\app\node_modules\@deepseek-ai\dsh-llm
(or DSH_LLM_PATH) and feeds this adapter's output through them, so the checks
are the harness's own code rather than a restatement of it:
| check | the failure it prevents |
|---|---|
catalog passes listModels validation |
duplicate or unnamed id β INVALID_CATALOG |
every advertised id passes normalizeModelInfo |
bad name / window / maxTokens β INVALID_MODEL_INFO, INVALID_MODEL_CONTEXT |
| a retired alias echoes the requested id | resolved.id !== model β INVALID_MODEL_INFO on every turn |
| an unknown id still returns valid metadata | a session that stored a dropped id keeps working |
| ladders have unique efforts and a known default | INVALID_MODEL_REASONING |
a streamed reply builds through BlockAssembler |
an unknown chunk, a bad index or a non-string argumentsDelta |
It exits 0 with SKIP when no harness is installed, so it is safe in CI.
Notes / limitations
- No quota reading.
/v1/billing/subscriptionreturns{"plan_name": β¦}and no money fields; roughly three dozen other candidates (/v1/billing/usage,/v1/credits,/v1/vibe-code/usage, β¦) answer404 no Route matched. The console's API and Vibe Code allowances are not readable through the API, so this plugin does not pretend to show them. - A discovered model's ladder depends on models.dev. An id models.dev does not know
keeps "levels unknown": no level control, and no
reasoning_efforton the wire. - Replay is sanitised. Every request is rebuilt from the fields Mistral declares:
role,content, andtool_callswithid/type/function. Reasoning replays the way Vibe replays it β as{"type":"thinking","thinking":[{"type":"text",β¦}]}chunks insidecontent, gated on the model declaring an effort ladder β never as a siblingreasoning_contentfield, which Mistral answers with a body-wide422 extra_forbidden. - An in-process request rewriter is asked to stay out of the way. billion-context
("bili") injects a blank
reasoning_contentinto any assistant turn carryingtool_callswhen the model id matches/deepseek/iβ which is everydeepseek-v4-1-flash-1017turn that used a tool β and Mistral rejects the field. Every request here therefore carriesx-bili-passthrough: 1, bili's own verbatim-relay marker; Mistral ignores unknown headers. SetbypassRewrite: falseto stop sending it behind a gateway that rejects unknown headers. The trade-off is that bili does no folding on this route while the header is on. - Tool-call ids are hashed, never truncated. Harness ids share a long prefix
(
chatcmpltoolβ¦), so the first nine alphanumerics were the same string for every call in a message βchatcmpltβ and the session log then refused to load: "assistant/message repeats advertised tool call chatcmplt". Ids are now a 9-character hash of the whole id, with a per-turn collision guard. - Alias ids still resolve.
mistral-medium-latestis not a row of its own; a session that selected it resolves tomistral-medium-2604with that entry's limits.
License
MIT Β© Meltartica β see LICENSE.