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@ai-sdk/groq 742 changes
Breaking changes 27
The package is now ESM-only; consumers using require() must switch to ESM import syntax.
OpenTelemetry span collection moves out of the ai package; install this package and register its OpenTelemetry instance to continue receiving traces.
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.
Tool callbacks use stable, tool-specific context instead of experimental_context; declare its shape with contextSchema and provide values through toolsContext.
The deprecated experimental_customProvider export was removed; replace it with customProvider.
The deprecated result type export was removed; use GenerateImageResult instead.
The deprecated experimental_prepareStep option was removed; replace it with prepareStep.
The tracer property is removed from experimental_telemetry; pass a custom tracer to the OpenTelemetry constructor instead.
The deprecated experimental_generateImage export was removed; use generateImage instead.
Request bodies are no longer included in generateText and streamText step results by default; opt in with include.requestBody.
generateText no longer includes response bodies by default; opt in with include.responseBody.
The tool-loop stop condition helper was renamed from stepCountIs to isStepCount.
The deprecated top-level cachedInputTokens field is removed; use inputTokenDetails.cacheReadTokens instead.
The deprecated top-level reasoningTokens field is removed; use outputTokenDetails.reasoningTokens instead.
AI SDK 7 requires Node.js 22 or later; Node.js 18 and 20 are no longer supported.
Telemetry integrations and tracing-channel subscribers receive onEmbedEnd instead of onEmbedFinish.
Completed embed and embedMany calls use onEnd instead of experimental_onFinish for their per-call callback.
Completed rerank calls use onEnd instead of experimental_onFinish for their per-call callback.
Telemetry integrations and tracing-channel subscribers receive onRerankEnd instead of onRerankFinish.
The generation start callback was renamed from experimental_onStart to onStart for generateText, streamText, and agents.
The per-step start callback was renamed from experimental_onStepStart to onStepStart for generateText, streamText, and agents.
The deprecated experimental_output option and result property were removed; use output for call options and result access.
Instructions returned from prepareStep now carry forward to future steps until another instructions or system override is returned.
Messages returned from prepareStep now become the base for subsequent steps, combined with the prior step's response messages.
Register a telemetry integration globally at application startup to enable telemetry collection.
Each step's response.messages now contains only that step's response messages; use result.responseMessages for the full response history.
onChunk now receives every TextStreamPart, including lifecycle, boundary, terminal, and error parts; handlers should guard the chunk types they process.
Deprecations 5
CallSettings is split into LanguageModelCallOptions and RequestOptions; replace it with LanguageModelCallOptions & Omit<RequestOptions, 'timeout'>. The deprecated type remains available.
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.
The per-step lifecycle callback is renamed from onStepFinish to onStepEnd; the old name remains a deprecated alias for user-facing callbacks.
The top-level includeRawChunks option is deprecated; move it to include.rawChunks.
The full event stream is renamed from fullStream to stream; fullStream remains a deprecated alias.
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.
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.
The stable include option replaces experimental_include for generateText, streamText, and ToolLoopAgent; the old name remains a deprecated alias.
The tool execution end callback replaces experimental_onToolCallFinish; the old name remains a deprecated fallback alias.
The tool execution start callback replaces experimental_onToolCallStart; the old name remains a deprecated fallback alias.
The speech result type has a stable name; Experimental_SpeechResult remains a deprecated alias.
The telemetry option replaces experimental_telemetry; the old name remains a deprecated alias during the migration window.
Telemetry is opt-out once an integration is registered: calls emit events by default, and isEnabled: false opts out a specific call.
The transcription API graduated from experimental status and is available under the stable name transcribe; the old name remains a deprecated alias.
The transcription result type has a stable name; Experimental_TranscriptionResult remains a deprecated alias.
@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.
The experimental OpenAI Live method can now resolve asynchronously; await its result before using the connection settings.
Affected error paths that previously reported other now report error; actual provider, parsing, and transport errors retain their error paths.
Reasoning is now placed before text in doGenerate.
The provider option baseUrl has been removed; use baseURL instead when configuring a Groq provider.
The minimum supported Node.js version is 22; supported versions are 22, 24, and 26.
Security 1
@ai-sdk/provider-utils has an Uncontrolled Resource Consumption issue
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.
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.
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.
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.
Groq adds support for the performance service tier.
Adds support for provider references and uploading files as supported per provider.
Providers support the new top-level reasoning parameter.
Provider model classes gain static serialization and deserialization methods so models can cross workflow step boundaries.
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.
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.
Schema construction is deferred until first use.
Browser search tools are kept for unknown model IDs instead of being dropped with a warning; known models without browser search remain excluded.
Provider config types make headers optional, allowing manually constructed model configs to omit them.
Fixes and other changes 10
Preserves string tool call arguments and safely serializes BigInt and circular structures in tool calls and outputs.
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.
Groq streams that end cleanly without a provider completion signal now report interrupted, preserving partial output without emitting an error solely for the interruption.
Uses the JSON response tool for structured outputs when tool calling is enabled.
The User-Agent header is now standards-compliant.
Fixes streamed tool calls with missing, blank, or repeated IDs.
Non-streaming responses with no choices now return a typed error.
Disables reasoning for supported Groq models when top-level reasoning is set to none.
Prevents negative text output token counts when providers report reasoning tokens; Perplexity reasoning tokens are treated separately from completion tokens.
Fixes handling of empty string tool call IDs.
@ai-sdk/groq 35 changes
Breaking changes 3
Removed the decomissioned moonshotai/kimi-k2-instruct model from the Groq provider.
Added moonshotai/kimi-k2-instruct-0905 as a Groq model.
Groq provider options now restrict reasoningEffort to allowed enum values.
Fixes and other changes 2
Reasoning streams are preserved across empty tool-call deltas.
Fixed tracking of cached token usage.
@ai-sdk/groq 27 changes
New APIs and options 5
Adds the Kimi K2 model via Groq.
Adds the Llama 4 model.
Adds raw chunk support.
Adds structured outputs support.
Adds transcription support.
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.
Improves Zod compatibility.