@tanstack/ai-mistral
1.0.0 · 22 Oct 2026MIT34.8k / weekRepositorynpmAtom feed
36 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 1.x · latest line
1.0.0
22 Oct 2026- breaking
TanStack AI 1.0.0. This release removes every API that was deprecated in 0.x. Read the upgrade guide before you upgrade: tanstack.com/ai/latest/docs/migration/v1
- removed
Remove model ids that providers have retired. Each one now fails on the provider's API, so the types no longer accept it.
Types and helpers that only served those models are removed:
Major Changes
- breaking
TanStack AI 1.0.0. This release removes every API that was deprecated in 0.x. Read the upgrade guide before you upgrade: tanstack.com/ai/latest/docs/migration/v1
Removed all
@deprecatedexports, options, fields, and type aliases. Each one has a replacement that already shipped in 0.x.Removed
addToolApprovalResponse()fromChatClientand every chat hook. Resolve the boundtool-approvalinterrupt withresolveInterruptinstead. The devtools eventtools:approval:respondedis also removed.Removed the old wire formats: the CUSTOM
approval-requestedandtool-input-availableevents, the[DONE]SSE line, thedatacopy offorwardedProps, pre-binding interrupt descriptors and theirapproval_requiredandclient_tool_inputreasons, and the STEP events that adapters sent next toREASONING_*events. Use a 1.0 client with a 1.0 server.Removed the
toolNamealias fromTOOL_CALL_STARTchunks. ReadtoolCallNameinstead.threadIdis now required onuseChatand every other chat hook,ChatClient, the generation hooks and clients,chat(),summarize(), the generation functions,codeModeWithSnippets(),selectRelevantSnippets(),CompactionContext, andSummarizeInput. TanStack AI no longer makes a thread id for you. Pass a stable id for each conversation.createChatHookfactory options no longer takethreadId: pass it on each hook call. Octane generation hooks takethreadIdinstead ofid.@tanstack/ai-sandboxremovesresolveDurableThreadIdandDurableThreadIdRequiredError.The published
@tanstack/ai-octane/uitypes are now strict.UI.Messages,UI.Message,UI.Part, andUI.Interruptstype their render children.ToolPropstypespart.inputandpart.outputfor the named tool.toolsComponentsandinterruptsComponentsare required when the chat options declare tools or named interrupts. Code that relied on the old loose types can fail to compile.A connection adapter's
connect()andsend()need the run context (withthreadId) as their fourth argument.ChatClientand the generation clients pass it.@tanstack/ai-sandbox:createToolBridgeCore(),startHostToolBridge(), aToolBridgeProvisioner, andexecuteHostTool()take a requiredthreadId. Bridged tools get it in their context.@tanstack/ai-sandbox: the harness tool bridge andexecuteHostTool()refuse a tool withneedsApproval. Before, the tool ran with no approval. RemoveneedsApproval, or run the tool with an HTTP adapter.stream()andrpcStream()pass the AG-UIRunAgentInputfor the run as the fourth factory argument, the same body the HTTP adapters send. Read it on the server withchatParamsFromRequestBody()orgenerationParamsFromBody(), sothreadId,runId, and interruptresumereach a server function.RunAgentInputis exported from@tanstack/ai/client.A generation
fetchergetsthreadIdandrunIdin its second argument, next tosignalandheaders. Pass them to the server generation call.generationParamsFromBody()andgenerationParamsFromRequest()read the generation input fromforwardedProps. A server that readsbody.datagetsundefined. Readbody.forwardedPropsinstead. They also requirethreadIdandrunIdand return them as strings, the same aschatParamsFromRequestBody()and the AG-UIRunAgentInput. A body that holds only the input is rejected.Removed the readers for data saved in old 0.x formats (old Cloudflare run-log records, a bare
UIMessagefrom client persistence, artifact records withoutblobKey).Removed provider models that are shut down.
@tanstack/ai-react-ui,@tanstack/ai-solid-ui, and@tanstack/ai-vue-uiget no 1.0 release. Import from@tanstack/ai-react/ui,@tanstack/ai-solid/ui, or@tanstack/ai-vue/ui.
Patch Changes
- removed
Remove model ids that providers have retired. Each one now fails on the provider's API, so the types no longer accept it.
Groq:
llama-3.3-70b-versatile,llama-3.1-8b-instant,meta-llama/llama-4-maverick-17b-128e-instruct,meta-llama/llama-4-scout-17b-16e-instruct,meta-llama/llama-guard-4-12b,moonshotai/kimi-k2-instruct-0905,qwen/qwen3-32b. Addsqwen/qwen3.8-27b.Mistral:
pixtral-large-latest,pixtral-12b-2409,open-mistral-nemo.OpenAI:
chatgpt-4o-latest,codex-mini-latest,gpt-4o-audio,gpt-4o-mini-audio,gpt-5.6,dall-e-2,dall-e-3,computer-use-preview. The speech modelgpt-4o-audio-previewis replaced bygpt-4o-mini-tts.Anthropic:
claude-opus-4-1,claude-opus-5-fast.Gemini:
imagen-4.0-generate-001,imagen-4.0-ultra-generate-001,imagen-4.0-fast-generate-001.
Types and helpers that only served those models are removed:
@tanstack/ai-gemini:GeminiImageProviderOptions,GeminiAnyImageProviderOptions,GeminiAspectRatio,PersonGeneration,SafetyFilterLevel,ImagePromptLanguage,GEMINI_NATIVE_IMAGE_MODELS,isGeminiNativeImageModel. Every Gemini image model usesGeminiNativeImageProviderOptions.@tanstack/openai-base:OpenAIComputerToolName.resolveComputerUseTool(tool)no longer takes a model.@tanstack/ai-openai: the dall-e option and size types.
- 0.7.x
0.7.2
21 Oct 2026Only updates a dependency:@tanstack/ai 0.71.0
0.7.1
19 Oct 2026Keep the provider's raw tool argument string for replay.
Patch Changes
Keep the provider's raw tool argument string for replay.
Adapters now send the raw argument string as
argsonTOOL_CALL_END.The tool call in the history keeps that exact string when it is the same JSON value as the parsed input, so the next request sends the provider's own bytes back (for example
1.50, or an id pastNumber.MAX_SAFE_INTEGER). When the parsed input differs, only the changed values are written again.The
TOOL_CALL_ENDthat reaches the client carries the same string inmetadata.tanstack.args, so the client history matches the server history. It no longer also carriesmetadata.tanstack.input: in-processchat()andStreamProcessorparseinputfromargs. Run the client and the server on the same release: an older client ignoresargs, so it builds the tool input from the streamed deltas only, and a tool call with no deltas (for example an Anthropic server tool) gets no input.History converters for Bedrock and the Gemini Interactions API send malformed tool arguments as
{}instead of failing the request.Gemini Interactions: the initial
step.argumentssnapshot goes out as aTOOL_CALL_ARGSdelta only when no argument deltas follow, so the deltas always add up to the final arguments.Malformed tool arguments are no longer turned into
{}by an adapter. The tool gets a "Failed to parse tool arguments as JSON" error that the model can repair. Mistral still ends the run with an error on malformed arguments, as before.
0.7.0
13 Oct 2026Prompt caching is now on by default. Each
chat()call asks the provider to cache the stable start of the request (system prompt, tools, and earlier messages), so repeated requests cost less and answer sooner.Set reasoning with
chat({ reasoning }).Breaking: none. The adapter had no reasoning option before.
chat({ adapter: mistralText('mistral-small-latest'), messages, reasoning: 'high', })Keep a schema property or a tool argument named
__proto__. Before this fix, code that copied it without[key] = valuewent to the__proto__setter instead, so the key was lost.
Minor Changes
Prompt caching is now on by default. Each
chat()call asks the provider to cache the stable start of the request (system prompt, tools, and earlier messages), so repeated requests cost less and answer sooner.New
chat()optionpromptCache:'none' | 'short' | 'long', or{ retention, key }. The default is'short'. The key ispromptCache.key, else thethreadIdorconversationIdthat you give. AthreadIdthatchat()makes up is never the key.To turn it off, pass
promptCache: 'none'. Do this for a large prompt that you send to Claude one time only, because Claude bills the cache write.A middleware can change it for the next model call:
onConfiggetsconfig.promptCacheand can return a new value.Each adapter sends its own fields:
Claude on Anthropic, Bedrock Converse, and OpenRouter gets cache markers.
'long'asks for the 1-hour TTL.OpenAI (Responses and Chat Completions) gets
prompt_cache_key, andprompt_cache_retentionorprompt_cache_optionson'long'.Mistral gets
prompt_cache_key, and usage now reports cache reads.OpenRouter gets
sessionId.
A manual
cache_control,cachePoint,prompt_cache_key, orsessionIdwins over the automatic value.New types:
PromptCacheRetention,PromptCacheOptions, andResolvedPromptCache. Adapters readTextOptions.promptCache.
Set reasoning with
chat({ reasoning }).Mistral Small and Mistral Medium get
reasoning_effort, andnoneforoff.Magistral gets
prompt_mode: 'reasoning'.offsends nothing.Each chat model has its reasoning data in
model-meta.ts.MistralModelReasoningByNameandMISTRAL_MODEL_REASONINGcome from it.
Breaking: none. The adapter had no reasoning option before.
chat({ adapter: mistralText('mistral-small-latest'), messages, reasoning: 'high', })
Patch Changes
Keep a schema property or a tool argument named
__proto__. Before this fix, code that copied it without[key] = valuewent to the__proto__setter instead, so the key was lost.@tanstack/ai-utils:transformNullsToUndefinedandundoNullWideningkeep the key.@tanstack/openai-base: the strict schema and its null-widening map keep the key.@tanstack/ai-mistral: the null-widening map keeps the key.@tanstack/ai-openrouter: the Responses tool input normalizer keeps the key.@tanstack/ai-gemini: the Interactions adapter keeps the key in tool parameters.@tanstack/ai-bedrock: the Converse adapter puts the tool schemas and tool inputs back into the request body after the AWS SDK serializes it, because the SDK drops the key.
Keep a conversation valid when the next request goes to a different model.
Each assistant message records
metadata.tanstack.source({ provider, api, model }), andresponseIdand the resolvedmodelwhen the provider sends them. A failed or aborted answer getsstopReason: 'error'or'aborted'.RUN_FINISHEDhas a newresponseIdfield.TextAdapterhas new optionalproviderandapifields.When the next request goes to a different source, the adapter removes signatures and redacted thinking, turns readable thinking into text, and rewrites tool call IDs to the shape the target API accepts. Each call stays paired with its result.
Every request drops failed and aborted assistant batches and adds a
No result providedresult for an unanswered tool call. The saved history does not change.RUN_FINISHEDandRUN_ERRORmetadata now merge onto the assistant messages of that model call inStreamProcessor.Anthropic: the new
allowEmptySignatureoption (defaultfalse) replays unsigned thinking from the same source, for gateways. The newprovideroption names a gateway.Azure OpenAI reports the
azure-openai-responsesAPI.Gemini, Mistral, and Bedrock Converse send same-source thinking back to the model, in block order.
withPersistencewrites the source and the stop reason onto streaming snapshot rows.Adapter authors get
transformMessagesForReplay()andhashToolCallId()from@tanstack/ai/adapter-internals.
Send
chat({ toolChoice })to each provider.Anthropic and Bedrock Converse. Claude Fable 5.1, Mythos 5.1, Opus 5.5, and Sonnet 5.5 reject a forced tool, and every Claude model rejects one while thinking is on. On those,
'required'and a named tool fall back toauto.Bedrock Converse has no
none.'none'sends no tool config. Bedrock refuses tool calls in the history without a tool config, so the history goes out as text.Gemini maps the choice to
functionCallingConfig(AUTO,NONE,ANY, andallowedFunctionNames). With only provider tools, such as Google Search, it sends no tool config.OpenAI and Azure OpenAI (Responses), Grok, Mistral, and OpenRouter (Chat Completions and Responses) send their own
tool_choiceshape.
- 0.6.x
0.6.18
9 Oct 2026Only updates a dependency:@tanstack/ai 0.68.0
0.6.17
9 Oct 2026Text adapters can now give
inputModalitiesat run time: the input kinds that the model reads, for example['text', 'image', 'document'].undefinedmeans that the adapter does not know.Add
wrapFetchtochat(), to the middlewareonConfigconfig, and toTextOptions. A wrapper gets the next fetch and gives back a new fetch. Use it to change the URL, the headers, the request, or the response of a model call. The newFetchWrappertype names the wrapper.The engine chains the
chat()wrapper and the middleware wrappers into one function. A middleware wrapper runs inside thechat()wrapper and applies to one model call only.These text adapters send their requests through the wrapper: every adapter on
@tanstack/openai-base(OpenAI, the OpenAI-compatible adapters, Grok, Groq, BytePlus, LLM Gateway, Lovable, Vercel AI Gateway, Cloudflare, and the Bedrock Chat Completions and Responses APIs), Anthropic, Mistral, Ollama, and OpenRouter. The wrapper wraps the fetch of the adapter config, not the global fetch. An Anthropic or Ollama adapter with an injected client ignoreswrapFetch. In Cloudflare binding mode, the wrapper runs, but the binding does not send the URL or the headers. WithoutwrapFetch, the requests do not change.
Patch Changes
Text adapters can now give
inputModalitiesat run time: the input kinds that the model reads, for example['text', 'image', 'document'].undefinedmeans that the adapter does not know.TextAdapterhas the new optionalinputModalitiesproperty. ABaseTextAdaptersubclass sets it from its model metadata.The text adapters of OpenAI, Anthropic, Gemini, Mistral, Groq, BytePlus, Grok, OpenRouter, and LLM Gateway set it. A known model gives its input kinds. An unknown model gives
undefined.
Add
wrapFetchtochat(), to the middlewareonConfigconfig, and toTextOptions. A wrapper gets the next fetch and gives back a new fetch. Use it to change the URL, the headers, the request, or the response of a model call. The newFetchWrappertype names the wrapper.The engine chains the
chat()wrapper and the middleware wrappers into one function. A middleware wrapper runs inside thechat()wrapper and applies to one model call only.These text adapters send their requests through the wrapper: every adapter on
@tanstack/openai-base(OpenAI, the OpenAI-compatible adapters, Grok, Groq, BytePlus, LLM Gateway, Lovable, Vercel AI Gateway, Cloudflare, and the Bedrock Chat Completions and Responses APIs), Anthropic, Mistral, Ollama, and OpenRouter. The wrapper wraps the fetch of the adapter config, not the global fetch. An Anthropic or Ollama adapter with an injected client ignoreswrapFetch. In Cloudflare binding mode, the wrapper runs, but the binding does not send the URL or the headers. WithoutwrapFetch, the requests do not change.
0.6.15
8 Oct 2026Structured output now reports a truncation error when the response stops at the output token limit. Before, you got a JSON parse error, or the partial result came back as valid data.
openai-baseandai-openrouteralready do this (#1426).
Patch Changes
Structured output now reports a truncation error when the response stops at the output token limit. Before, you got a JSON parse error, or the partial result came back as valid data.
openai-baseandai-openrouteralready do this (#1426).
0.6.1 – 0.6.1411 releases that only update dependencies@tanstack/ai 0.65.0@tanstack/ai-utils 0.4.1Show each
- 0.6.146 Oct 2026@tanstack/ai 0.65.0
- 0.6.132 Oct 2026@tanstack/ai 0.64.0
- 0.6.1227 Sep 2026@tanstack/ai 0.63.0
- 0.6.1024 Sep 2026@tanstack/ai 0.61.0
- 0.6.824 Sep 2026@tanstack/ai 0.59.0
- 0.6.721 Sep 2026@tanstack/ai 0.58.0
- 0.6.621 Sep 2026@tanstack/ai-utils 0.4.1
- 0.6.521 Sep 2026@tanstack/ai 0.57.0
- 0.6.317 Sep 2026@tanstack/ai 0.55.0
- 0.6.210 Sep 2026@tanstack/ai 0.54.0
- 0.6.13 Sep 2026@tanstack/ai 0.53.0
0.6.0
3 Sep 2026Accept
baseURLanddefaultHeaderson every adapter's client config so one gateway config (Cloudflare AI Gateway, Vercel AI Gateway, a corporate proxy) can be spread into any adapter. The vendor-specific names (httpOptions,serverURL,host,baseUrl,headers) keep working. Bedrock's Converse adapter now appliesdefaultHeaderstoo.
Minor Changes
Accept
baseURLanddefaultHeaderson every adapter's client config so one gateway config (Cloudflare AI Gateway, Vercel AI Gateway, a corporate proxy) can be spread into any adapter. The vendor-specific names (httpOptions,serverURL,host,baseUrl,headers) keep working. Bedrock's Converse adapter now appliesdefaultHeaderstoo.
- 0.5.x
0.5.2 – 0.5.32 releases that only update dependencies@tanstack/ai 0.52.0Show each
- 0.5.328 Aug 2026@tanstack/ai 0.52.0
- 0.5.227 Aug 2026@tanstack/ai 0.51.0
0.5.1
27 Aug 2026Stop requiring Zod as a peer dependency when the adapters do not import it at runtime.
Patch Changes
Stop requiring Zod as a peer dependency when the adapters do not import it at runtime.
0.5.0
24 Aug 2026Add headless BYOK:
defineByokin@tanstack/ai-client/byok, passbyokinto chat and generation hooks, and read keys on the relay withgetByokKeyfrom@tanstack/ai/byok/server. Provider ids are open slugs (x-byok-<slug>). Each adapter exports a{ id, label, env? }object (openaiByok, …);idis required.envis the env var name(s) for the relay — names only; the client never readsprocess.env. A wrong key surfaces as the provider's own401through the relay, so no client-side key check is needed. OpenRouter PKCE (@tanstack/ai-openrouter/pkce) saves the minted key underopenrouterByok.id.
Minor Changes
Add headless BYOK:
defineByokin@tanstack/ai-client/byok, passbyokinto chat and generation hooks, and read keys on the relay withgetByokKeyfrom@tanstack/ai/byok/server. Provider ids are open slugs (x-byok-<slug>). Each adapter exports a{ id, label, env? }object (openaiByok, …);idis required.envis the env var name(s) for the relay — names only; the client never readsprocess.env. A wrong key surfaces as the provider's own401through the relay, so no client-side key check is needed. OpenRouter PKCE (@tanstack/ai-openrouter/pkce) saves the minted key underopenrouterByok.id.
- 0.4.x
0.4.1
22 Aug 2026Only updates a dependency:@tanstack/ai 0.48.0
0.4.0
21 Aug 2026Add Vertex AI factories for Grok (
grokVertexText,grokVertexSummarize) and Mistral (mistralVertexText) on@tanstack/ai-grok/vertexand@tanstack/ai-mistral/vertex. Vertex factories accept only the chat models in the Google partner catalog.anthropicVertexTextnow uses the same Vertex Claude catalog.Preserve genuine nullable values while removing nulls synthesized for optional strict tool inputs and structured outputs.
Minor Changes
Add Vertex AI factories for Grok (
grokVertexText,grokVertexSummarize) and Mistral (mistralVertexText) on@tanstack/ai-grok/vertexand@tanstack/ai-mistral/vertex. Vertex factories accept only the chat models in the Google partner catalog.anthropicVertexTextnow uses the same Vertex Claude catalog.
Patch Changes
Preserve genuine nullable values while removing nulls synthesized for optional strict tool inputs and structured outputs.
- 0.3.x
0.3.2 – 0.3.43 releases that only update dependencies@tanstack/ai 0.47.0Show each
- 0.3.420 Aug 2026@tanstack/ai 0.47.0
- 0.3.319 Aug 2026@tanstack/ai 0.46.0
- 0.3.218 Aug 2026@tanstack/ai 0.45.0
0.3.1
11 Aug 2026populate StructuredOutputResult.usage from non-stream structuredOutput()
Adapters that already returned tokens/cost on streaming structured paths were dropping response.usage on the non-stream structuredOutput() method. OpenRouter now forwards tokens and cost; openai-base, Mistral, and Bedrock Converse do the same for tokens so fallbackStructuredOutputStream and middleware can observe usage.
0.3.0
10 Aug 2026Add a multimodal
embed()activity. A single primitive covers one input or a batch —inputaccepts a string, a text part, an image part, or a fused text+image item written as a nestedArray<ContentPart>([textPart, imagePart], the same shape chat messages use), one vector per item, with the accepted item types narrowed per model at compile time. Top-leveldimensionsrequests Matryoshka output sizes where supported. Results carryembeddings: [{ vector, index }]plususagewhen the provider reports it, andembed()participates in generation middleware, debug logging, OTel (gen_ai.operation.name: embeddings), and devtools events like every other activity.Provider adapters:
openaiEmbedding(text-embedding-3-small/large),geminiEmbedding(gemini-embedding-001),mistralEmbedding(mistral-embed, codestral-embed),ollamaEmbedding(nomic-embed-text and any local model),bedrockEmbedding(Titan Text V2, Titan Multimodal G1 with fused text+image, Cohere Embed v3 on Bedrock), and@tanstack/ai-cohere'scohereEmbedding(embed-v4.0, multimodal text+image with requiredinputType).Support document (PDF) input for Mistral vision models via
document_url. The text adapter now mapsdocumentcontent parts to Mistral'sdocument_urlformat (hosted URLs pass through; inline bytes are wrapped in adata:URL, mirroring image handling), anddocumentis declared as an input modality for the vision-capable models. Previously anydocumentcontent part threw "Supported types: text, image".
Minor Changes
Add a multimodal
embed()activity. A single primitive covers one input or a batch —inputaccepts a string, a text part, an image part, or a fused text+image item written as a nestedArray<ContentPart>([textPart, imagePart], the same shape chat messages use), one vector per item, with the accepted item types narrowed per model at compile time. Top-leveldimensionsrequests Matryoshka output sizes where supported. Results carryembeddings: [{ vector, index }]plususagewhen the provider reports it, andembed()participates in generation middleware, debug logging, OTel (gen_ai.operation.name: embeddings), and devtools events like every other activity.Provider adapters:
openaiEmbedding(text-embedding-3-small/large),geminiEmbedding(gemini-embedding-001),mistralEmbedding(mistral-embed, codestral-embed),ollamaEmbedding(nomic-embed-text and any local model),bedrockEmbedding(Titan Text V2, Titan Multimodal G1 with fused text+image, Cohere Embed v3 on Bedrock), and@tanstack/ai-cohere'scohereEmbedding(embed-v4.0, multimodal text+image with requiredinputType).Support document (PDF) input for Mistral vision models via
document_url. The text adapter now mapsdocumentcontent parts to Mistral'sdocument_urlformat (hosted URLs pass through; inline bytes are wrapped in adata:URL, mirroring image handling), anddocumentis declared as an input modality for the vision-capable models. Previously anydocumentcontent part threw "Supported types: text, image".
- 0.2.x
0.2.4
4 Aug 2026Only updates a dependency:@tanstack/ai 0.43.0
0.2.3
20 Jul 2026Reading the note…
0.2.2
16 Jul 2026Reading the note…
0.2.1
6 Jul 2026Reading the note…
0.2.0
30 Jun 2026Reading the note…
- 0.1.x
0.1.0
30 Jun 2026Reading the note…