ai_sdk_dart
Core AI SDK for Dart with provider-agnostic model APIs.
What this package is like to depend on
Last release 12 days ago
11 Aug 2026
Ships fairly regularly
a new release about every 6 weeks
Nearly every release is documented
notes for 5 of 5 stable releases
Nothing withdrawn
no release was ever pulled
5 months old
5 releases · first in 2026
5 releases in the last 12 months
see the full history below
Release timeline
5 releases · Mar 2026 to Aug 2026Releases
latest 5-
2.0.011 Aug 2026Release notes
Open source →AI SDK Dart 2.0 is a coordinated major release across all 13 packages.
Highlights
- V4 is now the only language-model provider contract.
- Generation and streaming gain scoped timeouts, provider-backed cancellation, stable runtime context and telemetry APIs, structured output improvements, and safer streamed tool execution.
- Provider usage reports nested input/output token details, including cache reads and writes where available.
- Flutter UI gains polished tool approval, source citation, reasoning, streaming, error, and long-history experiences.
- MCP transports and lifecycle handling are substantially hardened.
Breaking changes
Upgrade every ai_sdk package together. The obsolete V3 language-model contract, experimental API names, video surface, and old provider call fields were removed without compatibility shims.
Read the 2.0 migration guide before upgrading.
Packages
All 13 packages are published on pub.dev.
What's Changed
- fix(openai): surface reasoning/thinking deltas on streaming + non-streaming paths (fixes #3) by @codenameakshay in #7
- chore: add SessionStart hook to provision Flutter via FVM on the web by @codenameakshay in #5
- feat(usage): map provider cache tokens into inputTokenDetails by @codenameakshay in #9
- Prepare the next release with V4 providers and hardened UX by @codenameakshay in #10
- Prepare the coordinated 2.0.0 release by @codenameakshay in #11
Full Changelog: 1.2.0...2.0.0
Release notes
Open source →- Migrated generation, streaming, middleware, mocks, and tools to the V4 language-model contract.
- Added scoped total/step/chunk/tool timeouts, provider-backed cancellation,
stable
runtimeContext/telemetrynames, explicit approval policies, and machine-readable structured-stream benchmarks. - Tools now execute only after a complete validated stream tool call, not when its input stream ends.
-
1.2.001 Jul 2026Release notes
Open source →Coordinated 1.2.0 release across all 13 packages — now live on pub.dev. A v6 hardening pass that makes the AI SDK Dart port more complete, honest, and tested.
Highlights
🚨 Typed provider API errors (new)
Non-2xx provider responses now throw a typed
AiApiCallErrorcarrying the provider'smessage,type,code,statusCode, raw body, and anisRetryableflag — consistently across every provider. TheAiSdkErrorhierarchy moved intoai_sdk_provider(re-exported byai_sdk_dart, so the public surface is unchanged).🧩 Shared
ai_sdk_openai_compatiblebase (new package)A shared OpenAI Chat Completions implementation now powers OpenAI / Azure / Groq / Mistral. All 8 providers support tool use + multimodal image input; Cohere & Ollama gained them natively.
🔌 MCP
Real Server-Sent-Events streaming transport (
SseClientTransport) plus a plain request/responseHttpClientTransport; web-safe —dart:iois isolated behind conditional imports, so the client runs on Flutter web.📱 Flutter UI hub
19 prebuilt, themeable Material widgets plus hardened controllers (
ObjectStreamController.submit,ChatController.isStreaming, streaming-error surfacing). A restrained Material 3 redesign — bubbleless assistant transcript, anAiMotionmotion/haptics vocabulary, and a first-class reduced-motion path. Fixed aPressableScalecrash-on-dispose under reduced motion.✅ Correctness
onAbortnow interrupts an in-flightstreamText;stopWhencan extend the tool loop pastmaxSteps. Removed the unusablegenerateVideo/VideoModelV1(no backing provider). OpenAI image generation no longer sendsresponse_formattogpt-image-1.🧪 Quality
1,057 tests (924 Dart + 133 Flutter), 99.9% line coverage (11 of 12 packages at 100%), enforced by a CI coverage gate.
Packages (all published at 1.2.0)
ai_sdk_provider·ai_sdk_dart·ai_sdk_openai_compatible·ai_sdk_openai·ai_sdk_anthropic·ai_sdk_google·ai_sdk_azure·ai_sdk_cohere·ai_sdk_groq·ai_sdk_mistral·ai_sdk_ollama·ai_sdk_mcp·ai_sdk_flutter_uiSee each package's
CHANGELOG.mdfor full details.Full Changelog: 1.1.0...1.2.0
Release notes
Open source →Errors
- Provider HTTP failures now surface as a typed
AiApiCallErrorcarrying the provider'smessage/type/code/statusCode(and the raw response body), instead of a rawDioException. TheAiSdkErrorhierarchy was relocated intoai_sdk_providerso all provider packages can throw it;ai_sdk_dart's public surface is unchanged via a re-export shim, and existingimports keep working.
Bug Fixes
onAbortnow interrupts streaming. Cancelling theCancellationTokenduring astreamTextrun stops the read loop immediately, instead of firing the callback while the underlying stream kept draining to completion.stopWhencan extend the tool loop pastmaxSteps. Custom stop conditions are now the authoritative loop terminator: a higherstepCountIs(...)(or any custom condition) is honored even whenmaxStepsalone would have stopped earlier, matching Vercel AI SDK v6 semantics. A 1000-step safety cap still backstops runaway loops.
Removed (breaking for the unused video API)
generateVideo,AiNoVideoGeneratedError, the provider registry's video model category, and themockVideoModelV1test helper. No provider ever implementedVideoModelV1(also removed fromai_sdk_provider), so this API could not be exercised. If you referenced any of these symbols, delete the reference — there was no working code path behind them.
Internal
- Extracted a shared tool-loop run policy (
resolveStopConditions,resolveStepBudget,shouldStopAfterStep) and acompleteIfPendingfan-out helper, de-duplicatinggenerateTextandstreamText. No public API change.
Coverage
ai_sdk_dartnow has 100% line coverage oflib/.
- Provider HTTP failures now surface as a typed
-
1.1.015 Apr 2026Release notes
Open source →What's Changed
- Development environment setup: fix dependency conflict + add AGENTS.md by @codenameakshay in #1
- feat: update v1.1.0 by @codenameakshay in #2
New Contributors
- @codenameakshay made their first contribution in #1
Full Changelog: 1.0.0+1...1.1.0
Release notes
Open source →New APIs
embedMany()— batch embedding that fans out to the provider'sdoEmbedin configurable chunks, with merged usage stats.wrapEmbeddingModel()— middleware pipeline for embedding models, mirroringwrapLanguageModelfor language models.customProvider()— on-the-fly provider construction from plain model-factory maps without a fullcreateProviderRegistrysetup.onAbortcallback instreamText— fires synchronously when the caller'sCancellationTokenis cancelled, enabling graceful cleanup.timeoutparameter —Duration?timeout added togenerateText,streamText,generateObject,streamObject,embed,embedMany,generateImage,generateSpeech,transcribe,rerank. Wraps each underlying model call withFuture.timeout.smoothStreamdelayInMsoption —smoothStream(delayInMs: 20)adds per-chunk delay;experimentalTransformtype is nowStream<String> Function(Stream<String>)(async), enabling arbitrary async transforms.generateObject/streamObjectpassoutputSchema—LanguageModelV3CallOptions.outputSchemais now set toschema.jsonSchemaso providers that support native structured output (e.g. OpenAIresponse_format: json_schema) use it automatically.
New Error Types
AiToolCallRepairError— thrown when a tool-call repair attempt fails.AiNoImageGeneratedError— thrown whengenerateImagereceives no image content.AiNoVideoGeneratedError— thrown whengenerateVideoreceives no video content.AiNoSpeechGeneratedError— thrown whengenerateSpeechreceives no speech content.AiNoTranscriptGeneratedError— thrown whentranscribereceives no transcript.AiRetryError— wraps the list of errors from all exhausted retry attempts.AiDownloadError— thrown when an attachment download fails.
Registry Expansion
createProviderRegistrynow supports 6 model categories: language, embedding, image, speech, transcription, and rerank models (previously language + embedding only).RegistrableProviderexposesimageModelFactory,speechModelFactory,transcriptionModelFactory, andrerankModelFactoryfactories.
Testing Utilities
MockEmbeddingModelV3— fake embedding model for conformance tests, mirroringMockLanguageModelV2.
Bug Fixes
pruneMessages— removed duplicate messages that were incorrectly appended in multi-step loops whenmessageswas pre-populated; semantics now match Vercel AI SDK v6.
New Provider Packages
ai_sdk_azure— Azure OpenAI provider (AzureOpenAIProvider). Language models and embeddings via Azure-hosted deployments; configurableendpoint,apiKey, andapiVersion.ai_sdk_cohere— Cohere provider (cohere). Language models, text embeddings, and reranking (Command R, Command R+, embed-english-v3.0, rerank-english-v3.0).ai_sdk_groq— Groq provider (groq). Ultra-low latency inference for Llama, Mixtral, Gemma, and other Groq-hosted models.ai_sdk_mistral— Mistral AI provider (mistral). Language models and embeddings (Mistral Large, Mistral Small, Codestral, mistral-embed).ai_sdk_ollama— Ollama provider (ollama). Local inference for any model pulled via Ollama; no API key required.
Test Count
- 562+ tests covering all public APIs, conformance cases, and new features.
-
1.0.017 Mar 2026Release notes
Open source →First stable release. Package renamed from
ai→ai_sdk_dartto avoid conflicts with existing pub.dev packages.Core APIs
generateText/streamTextwith full v6 result parity — text, finishReason, usage, steps, toolCalls, toolResults, reasoning, sources, files, providerMetadata, request/response envelopes.generateObject/streamObjectwithOutput.text/object/array/choice/jsonAPI.embed/embedManywithcosineSimilarity.generateImage,generateSpeech,transcribe,rerank.
Agentic Tools
- Multi-step tool loop with
maxSteps,stopConditions, andprepareStep. - Typed tool definitions (
tool<INPUT, OUTPUT>,dynamicTool,Schema<T>). - Tool choice controls (
ToolChoiceAuto,ToolChoiceRequired,ToolChoiceNone,ToolChoiceSpecific). - Tool approval flow (
needsApproval) andToolLoopAgentfor autonomous agentic loops.
Middleware & Registry
- Middleware system:
wrapLanguageModel,extractReasoningMiddleware,extractJsonMiddleware,simulateStreamingMiddleware,defaultSettingsMiddleware,addToolInputExamplesMiddleware. createProviderRegistry— resolve models by'provider:modelId'string at runtime.
Streaming
smoothStream/experimentalTransformstream transform hooks.- Full
fullStreamevent taxonomy — 22 typedStreamTextEventsubtypes. - Lifecycle callbacks:
onFinish,onStepFinish,onChunk,onError,experimentalOnStart,experimentalOnStepStart.
Other
- Complete
AiSdkErrorsealed class hierarchy. - Utilities:
generateId,createIdGenerator,simulateReadableStream. - 230-test conformance suite covering all public APIs and provider wire formats.
-
1.0.0+117 Mar 2026Release notes
Open source →Full Changelog: https://github.com/codenameakshay/ai_sdk_dart/commits/1.0.0+1
Release notes
Open source →- Improved pubspec descriptions for better pub.dev discoverability.
- Added
example/example.mdwith usage examples and links to runnable apps.