unstale

npm / @ai-sdk/deepseek

@ai-sdk/deepseek

What changed in @ai-sdk/deepseek 1 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

48 breaking13 deprecations32 new APIs and options19 behavior and defaults26 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@ai-sdk/deepseek 71 changes

Breaking changes 1

  • The codemod migrates named Google imports and direct re-exports to the new API names while preserving local bindings and application export names as aliases. Namespace member access remains unchanged.

    7.0.0upgrade guide

@ai-sdk/deepseek 3125 changes

Breaking changes 45

  • Affected error paths that previously reported other now report error; actual provider, parsing, and transport errors retain their error paths.

    3.0.71release notes

  • OpenTelemetry span collection moved out of the ai package. Install this package and register an OpenTelemetry instance globally to receive traces.

    3.0.0upgrade guide

  • Opt in to accepting system messages in prompt or messages for existing chat histories; use only with trusted messages.

    3.0.0upgrade guide

  • CallSettings is split into LanguageModelCallOptions and RequestOptions; replace usages with LanguageModelCallOptions & Omit<RequestOptions, 'timeout'>.

    3.0.0upgrade guide

  • Top-level content, tool-call and result collections, files, sources, and warnings on generateText and streamText results now accumulate values across every step; use finalStep for final-step-only values.

    3.0.0upgrade guide

  • Tool callbacks now use stable, tool-specific context instead of experimental_context. Declare its shape with contextSchema and provide values through toolsContext.

    3.0.0upgrade guide

  • Declare tool-specific context fields with contextSchema; tool callback context is inferred from that schema.

    3.0.0upgrade guide

  • The package is ESM-only; consumers using require() must switch to ESM import syntax.

    3.0.0release notesupgrade guide

  • The deprecated option is removed; use activeTools in generateText and streamText calls.

    3.0.0upgrade guide

  • The deprecated export is removed; replace it with customProvider.

    3.0.0upgrade guide

  • The deprecated export is removed; replace it with generateImage.

    3.0.0upgrade guide

  • The deprecated type export is removed; replace it with GenerateImageResult.

    3.0.0upgrade guide

  • The deprecated option and generateText result property are removed; use output for both call options and result access.

    3.0.0upgrade guide

  • The deprecated option is removed; replace it with prepareStep.

    3.0.0upgrade guide

  • The tracer property was removed from experimental_telemetry; pass a custom tracer to the OpenTelemetry constructor instead.

    3.0.0upgrade guide

  • File part data is now tagged with a type, and the image part type is removed.

    3.0.0release notes

  • The stable include option replaces experimental_include for generateText, streamText, and ToolLoopAgent; include takes precedence if both are set.

    3.0.0upgrade guide

  • Move streamText's deprecated top-level includeRawChunks option into include.rawChunks.

    3.0.0upgrade guide

  • Request bodies are no longer included in generateText and streamText step results by default; opt in with include.requestBody.

    3.0.0upgrade guide

  • generateText no longer includes response bodies by default; opt in with include.responseBody.

    3.0.0upgrade guide

  • Use isStepCount instead of stepCountIs in tool-loop stop conditions.

    3.0.0upgrade guide

  • The deprecated function is removed; use isToolUIPart instead.

    3.0.0upgrade guide

  • The top-level cachedInputTokens field has been removed; use inputTokenDetails.cacheReadTokens instead.

    3.0.0upgrade guide

  • The top-level reasoningTokens field has been removed; use outputTokenDetails.reasoningTokens instead.

    3.0.0upgrade guide

  • The deprecated { type: 'media' } tool-result content part is removed; use a file part with tagged data instead.

    3.0.0upgrade guide

  • Raises the minimum supported Node.js version to 22; supported versions are 22, 24, and 26.

    3.0.0release notesupgrade guide

  • Replaces onEmbedFinish in telemetry integrations and tracing-channel events for individual embedding model calls.

    3.0.0upgrade guide

  • Use onEnd instead of experimental_onFinish for completed embed and embedMany operations.

    3.0.0upgrade guide

  • Use onEnd instead of experimental_onFinish for completed rerank operations.

    3.0.0upgrade guide

  • The callback follows the result changes: usage and content collections include all steps, while final-step-only properties are available on finalStep.

    3.0.0upgrade guide

  • Replaces onRerankFinish in telemetry integrations and tracing-channel events for individual reranking model calls.

    3.0.0upgrade guide

  • The generation start callback is renamed from experimental_onStart to onStart for generateText, streamText, and agents.

    3.0.0upgrade guide

  • Replaces onStepFinish as the per-step lifecycle callback across text and object generation, agents, workflow agents, and UI message stream helpers. Telemetry integrations should implement onStepEnd.

    3.0.0upgrade guide

  • The per-step start callback is renamed from experimental_onStepStart to onStepStart for generateText, streamText, and agents.

    3.0.0upgrade guide

  • Instructions returned from prepareStep carry forward to future steps until another instructions or system override is returned.

    3.0.0upgrade guide

  • Messages returned from prepareStep become the base for subsequent steps, combined with response messages from the previous step.

    3.0.0upgrade guide

  • Some models can return files in reasoning under this distinct content type; exhaustive part handling should support it.

    3.0.0upgrade guide

  • MCPTransportConfig redirect now defaults to error rather than follow, rejecting HTTP redirects by default to prevent SSRF; set it to follow if redirects are required.

    3.0.0upgrade guide

  • Shared generation or agent runtime data now flows through runtimeContext, separate from tool-specific context.

    3.0.0upgrade guide

  • Each step's response.messages now contains only messages produced by that step. Use result.responseMessages for the accumulated response history.

    3.0.0upgrade guide

  • onChunk now receives every emitted TextStreamPart, including lifecycle, boundary, and terminal parts, so handlers may need to guard chunk types.

    3.0.0upgrade guide

  • System messages in prompt or messages are rejected by default; pass system instructions through the top-level instructions option.

    3.0.0upgrade guide

  • The deprecated type is removed; replace imports and type references with ToolExecutionOptions.

    3.0.0upgrade guide

  • Provide tool-specific context values through toolsContext, keyed by tool name; when a tool declares contextSchema, toolsContext becomes required.

    3.0.0upgrade guide

  • generateText and streamText result usage now totals tokens across all steps; use finalStep.usage for final-step-only usage.

    3.0.0upgrade guide

Deprecations 13

  • The @ai-sdk/vue Chat class is deprecated in favor of useChat, which provides reactive refs and recreates the underlying chat when its init object changes.

    3.0.0upgrade guide

  • Tool-result image-* and legacy file-* variants are deprecated in favor of one file variant with mediaType and tagged data; legacy outputs are auto-migrated at runtime.

    3.0.0upgrade guide

  • The user-message { type: 'image' } part is deprecated; use a file part with an image mediaType instead.

    3.0.0upgrade guide

  • The tool() and dynamicTool() property is deprecated; move approval logic to toolApproval on the call or agent so policy can vary by request.

    3.0.0upgrade guide

  • Replaces onFinish as the final lifecycle callback for generateText, streamText, agents, and ToolLoopAgent settings. onFinish remains a deprecated alias; onEnd takes precedence when both are provided.

    3.0.0upgrade guide

  • The streamText result method is deprecated; use the stateless helper with a text stream.

    3.0.0upgrade guide

  • The streamText result method is deprecated; use the stateless helper with a UI message stream.

    3.0.0upgrade guide

  • Top-level reasoning, reasoningText, request, response, and providerMetadata result properties are deprecated; read final-step values from result.finalStep.

    3.0.0upgrade guide

  • The full event stream is now available as stream instead of fullStream; fullStream remains a deprecated alias.

    3.0.0upgrade guide

  • totalUsage is deprecated; use usage, which now contains usage across all steps.

    3.0.0upgrade guide

  • The streamText result method is deprecated; use toTextStream and createTextStreamResponse instead.

    3.0.0upgrade guide

  • The streamText result method is deprecated; use the stateless top-level helper with result.stream.

    3.0.0upgrade guide

  • The streamText result method is deprecated; compose toUIMessageStream with createUIMessageStreamResponse instead.

    3.0.0upgrade guide

New APIs and options 29

  • Adds a Responses API model to the DeepSeek provider.

    3.0.83release notes

  • Adds a web search tool to the DeepSeek provider.

    3.0.83release notes

  • Adds max as a portable reasoning level, with native provider mappings, compatibility coercions, and budget-based fallback support.

    3.0.60release notes

  • provider-utils adds deleteFromApi.

    3.0.38release notes

  • FilesV4 call options now support abortSignal.

    3.0.38release notes

  • FilesV4 gains an optional deleteFile operation.

    3.0.38release notes

  • FilesV4 gains an optional streaming downloadFile operation.

    3.0.38release notes

  • FilesV4 gains an optional getFileMetadata operation.

    3.0.38release notes

  • FilesV4 call options now support headers.

    3.0.38release notes

  • provider-utils adds postMultipartStreamToApi for streaming multipart uploads with deterministic part ordering and failure-path stream teardown.

    3.0.38release notes

  • Upload data now accepts a { type: 'stream' } variant.

    3.0.38release notes

  • Upload results now expose byteSize.

    3.0.38release notes

  • Upload results now expose createdAt.

    3.0.38release notes

  • Upload results now expose expiresAt.

    3.0.38release notes

  • Adds support for beta assistant prefix completion through message provider options.

    2.0.59, 3.0.32release notesrelease notes

  • Adds support for requesting and receiving chat completion log probabilities.

    2.0.59, 3.0.32release notesrelease notes

  • Adds support for image detail and inline file-data content parts.

    3.0.32release notes

  • Adds provider-specific names for system, user, and assistant messages.

    2.0.59, 3.0.32release notesrelease notes

  • Exposes response system fingerprints in provider metadata for generated and streamed text.

    2.0.59, 3.0.32release notesrelease notes

  • Adds model IDs for DeepSeek V4 Flash and Pro.

    2.0.59, 3.0.32release notesrelease notes

  • Adds the chat option userId and serializes it as user_id.

    2.0.59, 3.0.32release notesrelease notes

  • DeepSeek V4 Flash Vision Exp gains Files API support.

    3.0.30release notes

  • Adds reasoning effort support for DeepSeek V4.

    3.0.0release notes

  • The top-level system prompt option and related prepareStep, repair, and lifecycle fields are renamed to instructions; system remains a deprecated fallback, with instructions taking precedence.

    3.0.0upgrade guide

  • The callback receives instructions for the current state and initialInstructions for the original top-level value.

    3.0.0upgrade guide

  • The provider supports the new top-level reasoning parameter.

    3.0.0release notes

  • Accepts thinking.type: 'adaptive' and the full reasoningEffort enum, including low, medium, high, xhigh, and max.

    3.0.0release notes

  • The Vue composable exposes reactive refs for messages, status, and error, and can recreate the underlying chat when reactive initialization inputs change.

    3.0.0upgrade guide

  • Provider model classes can cross workflow step boundaries using WORKFLOW_SERIALIZE and WORKFLOW_DESERIALIZE.

    3.0.0release notes

Behavior and default changes 17

  • Known model ID suggestions are derived from provider model catalog declarations, so catalog updates automatically update autocomplete while preserving existing suggestions, endpoint-specific model lists, and support for custom model IDs.

    3.0.87release notes

  • Endpoints with unspecified strict-tool support now allow strict tools, while explicit endpoint restrictions remain in effect.

    3.0.80release notes

  • Provider API key and token settings now support promises and synchronous or asynchronous callbacks, resolving credentials per authenticated request while preserving existing authentication behavior and synchronous credential serialization.

    3.0.77release notes

  • Preserves reasoning content on all assistant turns for future DeepSeek models, using current reasoning-enabled defaults; known pre-V4 versions and legacy chat/reasoner aliases retain previous handling.

    1.0.63, 2.0.72, 3.0.64release notesrelease notesrelease notes

  • Deprecated or ineffective sampling options now trigger warnings and are omitted, while penalty sampling is preserved for Azure-hosted DeepSeek models.

    2.0.59, 3.0.32release notesrelease notes

  • Aligns thinking and reasoning effort options with documented API values and maps legacy options with compatibility warnings.

    2.0.59, 3.0.32release notesrelease notes

  • DeepSeek V4 Flash Vision Exp gains image input support.

    3.0.30release notes

  • The speech generation function graduates from experimental status under the stable name generateSpeech; the old name remains a deprecated alias.

    3.0.0upgrade guide

  • Provider config types make headers optional, allowing manually constructed model configs to omit them when auth is provided separately.

    3.0.0release notes

  • Replaces experimental_onToolCallFinish for tool execution callbacks in generateText and streamText; the old name remains a deprecated fallback alias.

    3.0.0upgrade guide

  • Replaces experimental_onToolCallStart for tool execution callbacks in generateText and streamText; the old name remains a deprecated fallback alias.

    3.0.0upgrade guide

  • The top-level reasoning option controls reasoning effort; overlapping providerOptions settings take precedence and can bypass it.

    3.0.0upgrade guide

  • The speech result type is available under the stable name SpeechResult; the old name remains a deprecated alias.

    3.0.0upgrade guide

  • Telemetry events are emitted by default on AI SDK calls after a telemetry integration is registered; set isEnabled: false to opt out for a call.

    3.0.0upgrade guide

  • The telemetry option replaces experimental_telemetry. The old name remains a deprecated alias, and telemetry takes precedence when both are provided.

    3.0.0upgrade guide

  • The transcription API graduates from experimental status under the stable name transcribe; the old name remains a deprecated alias.

    3.0.0upgrade guide

  • The transcription result type is available under the stable name TranscriptionResult; the old name remains a deprecated alias.

    3.0.0upgrade guide

Fixes and other changes 21

  • Preserves string tool call arguments and safely serializes BigInt and circular structures in tool calls and outputs.

    1.0.66, 2.0.79, 3.0.78release notesrelease notesrelease notes

  • DeepSeek streams that end cleanly without a provider completion signal now report interrupted and preserve partial output without emitting an error solely for the interruption.

    3.0.71release notes

  • Fixes cached input token reporting for OpenAI-compatible DeepSeek responses.

    1.0.61, 2.0.70, 3.0.57release notesrelease notesrelease notes

  • Uses a standards-compliant User-Agent header.

    3.0.56release notes

  • Fixes streamed tool calls with missing, blank, or repeated IDs.

    3.0.55release notes

  • Tool-result images are now sent as image content parts.

    3.0.50release notes

  • Non-streaming responses without choices now return a typed error.

    3.0.49release notes

  • The deepseek-flash alias is treated as a V4 model so prior-turn reasoning_content is preserved in multi-turn requests.

    2.0.64, 3.0.44release notesrelease notes

  • Preserves reasoning streams across empty tool-call deltas.

    1.0.57, 2.0.64, 3.0.43release notesrelease notesrelease notes

  • The core uploadFile() helper now forwards abortSignal.

    3.0.38release notes

  • The core uploadFile() helper now forwards headers.

    3.0.38release notes

  • Preserves complete raw chat usage objects.

    3.0.35release notes

  • Preserves documented chat response metadata for generate and stream.

    2.0.59, 3.0.32release notesrelease notes

  • Validates file response discriminators and numeric metadata while remaining compatible with omitted optional metadata.

    3.0.32release notes

  • Validates upload formats, sizes, and filename lengths before sending requests.

    3.0.32release notes

  • Validates strict tool calls against beta endpoint requirements.

    2.0.59, 3.0.32release notesrelease notes

  • Preserves the file object discriminator in upload provider metadata.

    3.0.32release notes

  • Prevents negative text output token counts when providers report reasoning tokens; Perplexity reasoning tokens are treated as separate from completion tokens.

    3.0.32release notes

  • Handles empty string tool call IDs.

    3.0.29release notes

  • Preserves reasoning_content for DeepSeek V4 in multi-turn requests.

    3.0.0release notes

  • Tool calls are finalized only after the stream is fully consumed, preventing execution with incomplete arguments when partial JSON is already parsable.

    1.0.69, 3.0.0release notesrelease notes

@ai-sdk/deepseek 26 changes

Breaking changes 1

  • The DeepSeek provider was rewritten; developers may need to adapt integrations to the updated provider implementation.

    2.0.0release notes

New APIs and options 2

Behavior and default changes 2

  • Adds image input support for DeepSeek V4 Flash Vision Exp.

    1.0.51, 2.0.57release notesrelease notes

  • A JSON instruction is automatically injected when the provider is deepseek.chat, which affects how JSON output requests are handled.

    2.0.0release notes

Fixes and other changes 1

  • Complete raw chat usage objects are now preserved, so developers retain all usage data.

    2.0.61release notes

@ai-sdk/deepseek 16 changes

Breaking changes 1

  • The OpenAI-compatible provider integration converts to providerOptions.

    1.0.0release notes

New APIs and options 1

Fixes and other changes 4

  • String tool call arguments are preserved instead of being altered.

    1.0.66release notes

  • Treats the deepseek-flash alias as a V4 model so prior-turn reasoning_content is preserved in multi-turn requests.

    1.0.57release notes

  • The release includes AI SDK 5, which may affect how developers use the provider with the SDK.

    1.0.0release notes

  • Zod compatibility is improved.

    1.0.0release notes