unstale

npm / @ai-sdk/groq

@ai-sdk/groq

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

36 breaking1 security5 deprecations14 new APIs and options14 behavior and defaults14 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/groq 742 changes

Breaking changes 27

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

    4.0.0, 7.0.0release notesupgrade guide

  • OpenTelemetry span collection moves out of the ai package; install this package and register its OpenTelemetry instance to continue receiving traces.

    7.0.0upgrade guide

  • System messages in prompt or messages are rejected by default; set allowSystemInMessages to true to opt in to the previous behavior for existing chat histories.

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • The deprecated experimental_customProvider export was removed; replace it with customProvider.

    7.0.0upgrade guide

  • The deprecated result type export was removed; use GenerateImageResult instead.

    7.0.0upgrade guide

  • The deprecated experimental_prepareStep option was removed; replace it with prepareStep.

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • The deprecated experimental_generateImage export was removed; use generateImage instead.

    7.0.0upgrade guide

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

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • The tool-loop stop condition helper was renamed from stepCountIs to isStepCount.

    7.0.0upgrade guide

  • The deprecated top-level cachedInputTokens field is removed; use inputTokenDetails.cacheReadTokens instead.

    7.0.0upgrade guide

  • The deprecated top-level reasoningTokens field is removed; use outputTokenDetails.reasoningTokens instead.

    7.0.0upgrade guide

  • AI SDK 7 requires Node.js 22 or later; Node.js 18 and 20 are no longer supported.

    7.0.0upgrade guide

  • Telemetry integrations and tracing-channel subscribers receive onEmbedEnd instead of onEmbedFinish.

    7.0.0upgrade guide

  • Completed embed and embedMany calls use onEnd instead of experimental_onFinish for their per-call callback.

    7.0.0upgrade guide

  • Completed rerank calls use onEnd instead of experimental_onFinish for their per-call callback.

    7.0.0upgrade guide

  • Telemetry integrations and tracing-channel subscribers receive onRerankEnd instead of onRerankFinish.

    7.0.0upgrade guide

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

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • The deprecated experimental_output option and result property were removed; use output for call options and result access.

    7.0.0upgrade guide

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

    7.0.0upgrade guide

  • Messages returned from prepareStep now become the base for subsequent steps, combined with the prior step's response messages.

    7.0.0upgrade guide

  • Register a telemetry integration globally at application startup to enable telemetry collection.

    7.0.0upgrade guide

  • Each step's response.messages now contains only that step's response messages; use result.responseMessages for the full response history.

    7.0.0upgrade guide

  • onChunk now receives every TextStreamPart, including lifecycle, boundary, terminal, and error parts; handlers should guard the chunk types they process.

    7.0.0upgrade guide

Deprecations 5

  • CallSettings is split into LanguageModelCallOptions and RequestOptions; replace it with LanguageModelCallOptions & Omit<RequestOptions, 'timeout'>. The deprecated type remains available.

    7.0.0upgrade guide

  • The final lifecycle callback for text generation, streaming, and agents is renamed from onFinish to onEnd; onFinish remains a deprecated alias, and onEnd takes precedence when both are provided.

    7.0.0upgrade guide

  • The per-step lifecycle callback is renamed from onStepFinish to onStepEnd; the old name remains a deprecated alias for user-facing callbacks.

    7.0.0upgrade guide

  • The top-level includeRawChunks option is deprecated; move it to include.rawChunks.

    7.0.0upgrade guide

  • The full event stream is renamed from fullStream to stream; fullStream remains a deprecated alias.

    7.0.0upgrade guide

New APIs and options 1

  • The top-level system prompt option is renamed to instructions across prompt-taking APIs and related callbacks; system remains a deprecated fallback, and instructions takes precedence when both are provided.

    7.0.0upgrade guide

Behavior and default changes 9

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

    7.0.0upgrade guide

  • The stable include option replaces experimental_include for generateText, streamText, and ToolLoopAgent; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • The tool execution end callback replaces experimental_onToolCallFinish; the old name remains a deprecated fallback alias.

    7.0.0upgrade guide

  • The tool execution start callback replaces experimental_onToolCallStart; the old name remains a deprecated fallback alias.

    7.0.0upgrade guide

  • The speech result type has a stable name; Experimental_SpeechResult remains a deprecated alias.

    7.0.0upgrade guide

  • The telemetry option replaces experimental_telemetry; the old name remains a deprecated alias during the migration window.

    7.0.0upgrade guide

  • Telemetry is opt-out once an integration is registered: calls emit events by default, and isEnabled: false opts out a specific call.

    7.0.0upgrade guide

  • The transcription API graduated from experimental status and is available under the stable name transcribe; the old name remains a deprecated alias.

    7.0.0upgrade guide

  • The transcription result type has a stable name; Experimental_TranscriptionResult remains a deprecated alias.

    7.0.0upgrade guide

@ai-sdk/groq 430 changes

Breaking changes 6

  • This value can be undefined when a provider fetches the audio URL natively, so telemetry integrations should check for missing values before using it as a number.

    4.0.77release notes

  • The experimental OpenAI Live method can now resolve asynchronously; await its result before using the connection settings.

    4.0.74release notes

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

    4.0.68release notes

  • Reasoning is now placed before text in doGenerate.

    3.0.78, 4.0.65release notesrelease notes

  • The provider option baseUrl has been removed; use baseURL instead when configuring a Groq provider.

    4.0.0upgrade guide

  • The minimum supported Node.js version is 22; supported versions are 22, 24, and 26.

    4.0.0release notes

Security 1

  • @ai-sdk/provider-utils has an Uncontrolled Resource Consumption issue

    4.0.33security advisory

New APIs and options 8

  • Groq can transcribe HTTP(S) audio URLs without downloading and re-uploading them. A custom download function retains local download behavior; media fragments are stripped, and rejected redirects fall back to secure local download and file upload.

    4.0.77release notes

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

    4.0.74release notes

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

    4.0.74release notes

  • The reasoning level type now includes max. Third-party providers and consumers with exhaustive mappings must handle the new value; existing reasoning levels remain accepted.

    4.0.56release notes

  • Groq adds support for the performance service tier.

    4.0.0release notes

  • Adds support for provider references and uploading files as supported per provider.

    4.0.0release notes

  • Providers support the new top-level reasoning parameter.

    4.0.0release notes

  • Provider model classes gain static serialization and deserialization methods so models can cross workflow step boundaries.

    4.0.0release notes

Behavior and default changes 5

  • 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.

    4.0.84release notes

  • This value can be undefined when a provider fetches the audio URL natively, so telemetry integrations should check for missing values before using it as a string.

    4.0.77release notes

  • Schema construction is deferred until first use.

    4.0.67release notes

  • Browser search tools are kept for unknown model IDs instead of being dropped with a warning; known models without browser search remain excluded.

    2.0.58, 3.0.73, 4.0.60release notesrelease notesrelease notes

  • Provider config types make headers optional, allowing manually constructed model configs to omit them.

    4.0.0release notes

Fixes and other changes 10

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

    2.0.61, 3.0.81, 4.0.75release notesrelease notesrelease notes

  • On Groq GPT-OSS models that cannot disable reasoning, setting reasoning to 'none' maps to the model's lowest level with a compatibility warning instead of being dropped or rejected.

    4.0.73release notes

  • Groq streams that end cleanly without a provider completion signal now report interrupted, preserving partial output without emitting an error solely for the interruption.

    4.0.68release notes

  • Uses the JSON response tool for structured outputs when tool calling is enabled.

    4.0.55release notes

  • The User-Agent header is now standards-compliant.

    4.0.52release notes

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

    4.0.51release notes

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

    4.0.47release notes

  • Disables reasoning for supported Groq models when top-level reasoning is set to none.

    4.0.31release notes

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

    3.0.62, 4.0.31release notesrelease notes

  • Fixes handling of empty string tool call IDs.

    4.0.29release notes

@ai-sdk/groq 35 changes

Breaking changes 3

  • Removed the decomissioned moonshotai/kimi-k2-instruct model from the Groq provider.

    3.0.0release notes

  • Added moonshotai/kimi-k2-instruct-0905 as a Groq model.

    3.0.0release notes

  • Groq provider options now restrict reasoningEffort to allowed enum values.

    3.0.0release notes

Fixes and other changes 2

  • Reasoning streams are preserved across empty tool-call deltas.

    3.0.66release notes

  • Fixed tracking of cached token usage.

    3.0.0release notes

@ai-sdk/groq 27 changes

New APIs and options 5

Fixes and other changes 2

  • Tool calls are finalized when the stream ends, preventing valid partial JSON from causing tools to run with truncated arguments.

    2.0.64release notes

  • Improves Zod compatibility.

    2.0.0release notes