ollama_dart
Dart client for the Ollama API to run LLMs locally (OpenAI gpt-oss, DeepSeek-R1, Gemma 3, Llama 4, and more).
2.5.0
12K downloads/mo
#2771 most downloaded on pub.dev
davidmigloz/ai_clients_dart
What this package is like to depend on
Last release 21 days ago
02 Aug 2026
Release timing varies
gaps range from 9 days to 5 months
Nearly every release is documented
notes for 34 of 34 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
34 releases · first in 2023
17 releases in the last 12 months
see the full history below
Release timeline
34 releases · Nov 2023 to Aug 2026Releases
latest 34-
2.5.002 Aug 2026Release notes
Open source →Adds
rendererandparsertoCreateRequest, matching the upstream OpenAPI spec's new tool-calling prompt renderer (e.g.qwen3.5) and output parser (e.g.harmony) fields. Also adds client-ahead fields for fullapi/types.goparity that the spec still omits —files/adapters(filename → SHA256 digest maps, per the Create a Model docs) for creating models from GGUF/Safetensors and LoRA adapters, plusdraftQuantize/draftFiles,remoteHost,requires, andinfo. Also fixesCreateRequest's==/hashCode/toStringcontract, which previously only comparedmodel, to cover all 18 fields with content-based map/list equality. -
2.4.005 Jul 2026Release notes
Open source →Adds the new
maxthinking level (ThinkLevel.max), matching Ollama's spec update that added"max"to thethinkenum onChatRequestandGenerateRequest— useChatRequest(..., think: ThinkWithLevel(ThinkLevel.max))to request the highest thinking level on supported reasoning models. Also fixesbuildUrlproducing a double slash (//api/...) whenOllamaConfig.baseUrl(orOLLAMA_HOST) has a trailing slash, and preserves base-URL query params (including repeated keys) that were previously dropped — proxy setups with tokens in the base URL now work correctly. -
2.3.006 Jun 2026Release notes
Open source →Adds experimental image generation to the
/api/generateendpoint:GenerateRequestgainswidth/height/steps, andGenerateResponseand the streamingGenerateStreamEventgainimage(base64),completed, andtotalfor diffusion progress. These fields are implemented client-side ahead of the upstream spec, which keeps them out ofopenapi.yamlwhile they remain experimental. Also adds thedraftNumPredictmodel option toModelOptionsand completes the previously-partial==/hashCode/toStringcontracts onGenerateStreamEventandChatStreamEvent, which had compared only a subset of fields. -
2.2.024 May 2026Release notes
Open source →Fixes browser usage (Flutter Web / dart2wasm) by no longer sending the non-CORS-safelisted
X-Request-IDheader by default — Ollama'sAccess-Control-Allow-Headerslist excludes it, so the preflight previously failed and blocked all browser requests against a real Ollama server. A request ID is still generated internally for logging, error correlation, and retry/abort tracing; the newOllamaConfig(sendRequestIdHeader: true)opt-in restores the wire header for callers behind a proxy configured to accept it, and anX-Request-IDset explicitly viadefaultHeadersis always sent. -
2.1.016 Apr 2026Release notes
Open source →Annotates
llms.txtwith per-link token counts and per-package totals so coding agents can budget context before fetching documentation, examples, or changelogs — inspired by Addy Osmani's Agentic Engine Optimization article. -
2.0.129 Mar 2026 -
2.0.027 Mar 2026Release notes
Open source →[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
Replaces untyped
Object/Object?fields with sealed union types (KeepAlive,EmbedInput,StopSequence) for improved type safety across request models. Also adds anamefield toRunningModelfrom the upstream Ollama API update and overhauls README documentation with llms.txt ecosystem files. -
1.4.112 Mar 2026 -
1.4.010 Mar 2026Release notes
Open source →This release adds inline streaming error detection for improved reliability when handling streamed responses.
-
1.3.006 Mar 2026 -
1.2.106 Mar 2026Release notes
Open source →Internal improvements to build tooling and package publishing configuration.
-
1.2.004 Mar 2026Release notes
Open source →Added
baseUrlanddefaultHeadersparameters towithApiKeyconstructors, fixedhashCodefor list fields, and unified equality helpers. -
1.1.004 Mar 2026Release notes
Open source →Added
withApiKeyconvenience constructor for simplified client initialization. -
1.0.003 Mar 2026Release notes
Open source →[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
TL;DR: Complete reimplementation with a new architecture, minimal dependencies, resource-based API, and improved developer experience. Hand-crafted models (no code generation), interceptor-driven architecture, comprehensive error handling, and full Ollama API coverage.
What's new
- Resource-based API organization:
client.chat— Chat completions (multi-turn conversations)client.completions— Text generation (single-turn)client.embeddings— Generate text embeddingsclient.models— Model management (list, show, pull, push, copy, delete, create, ps)client.version— Server version info
- Architecture:
- Interceptor chain (Auth → Logging → Error → Transport with Retry wrapper).
- Authentication: Bearer token or custom via
AuthProviderinterface. - Retry with exponential backoff + jitter (only for idempotent methods on 429, 5xx, timeouts).
- Abortable requests via
abortTriggerparameter. - NDJSON streaming parser for real-time responses.
- Central
OllamaConfig(timeouts, retry policy, log level, baseUrl, auth).
- Hand-crafted models:
- No code generation dependencies (no freezed, json_serializable).
- Minimal runtime dependencies (
http,loggingonly). - Immutable models with
copyWithusing sentinel pattern. - Full type safety with sealed exception hierarchy.
- Type-safe enums and sealed classes:
DoneReasonenum for completion stop reasons (stop,length,load,unload).ThinkValuesealed class for thinking mode (ThinkEnabled,ThinkWithLevel).ResponseFormatsealed class for format options (JsonFormat,SchemaFormat).MessageRoleenum for message roles (system,user,assistant,tool).
- Improved DX:
- Simplified model names (e.g.,
ChatRequestinstead ofGenerateChatCompletionRequest). - Named constructors for common patterns (e.g.,
ChatMessage.user(),ChatMessage.system()). - Explicit streaming methods (
createStream()vscreate()). - Rich logging with field redaction for sensitive data.
- Simplified model names (e.g.,
- Full API coverage:
- Chat completions with tool calling support.
- Text completions with thinking mode.
- Embeddings generation.
- Model management (list, show, create, copy, delete, pull, push, ps).
- Server version info.
Breaking Changes
- Resource-based API: Methods reorganized under strongly-typed resources:
client.generateChatCompletion()→client.chat.create()client.generateChatCompletionStream()→client.chat.createStream()client.generateCompletion()→client.completions.generate()client.generateCompletionStream()→client.completions.generateStream()client.generateEmbedding()→client.embeddings.create()client.listModels()→client.models.list()client.showModelInfo()→client.models.show()client.listRunningModels()→client.models.ps()client.getVersion()→client.version.get()
- Model class renames:
GenerateChatCompletionRequest→ChatRequestGenerateChatCompletionResponse→ChatResponseGenerateCompletionRequest→GenerateRequestGenerateCompletionResponse→GenerateResponseGenerateEmbeddingRequest→EmbedRequestGenerateEmbeddingResponse→EmbedResponseMessage→ChatMessageTool→ToolDefinitionRequestOptions→ModelOptions
- Configuration: New
OllamaConfigwithAuthProviderpattern. - Exceptions: Replaced
OllamaClientExceptionwith typed hierarchy:ApiException,ValidationException,RateLimitException,TimeoutException,AbortedException.
- Dependencies: Removed
freezed,json_serializable; now minimal (http,logging). - Base URL: No longer needs
/apisuffix — just usehttp://localhost:11434.
See MIGRATION.md for step-by-step examples and mapping tables.
Commits
- BREAKING FEAT: Complete v1.0.0 reimplementation (#1). (0ff41032)
- FEAT: Add type-safe enums and sealed classes (#22). (73372581)
- FIX: Pre-release documentation and code fixes (#45). (b33ae6d5)
- REFACTOR: Align client package architecture across SDK packages (#37). (cf741ee1)
- REFACTOR: Align API surface across all SDK packages (#36). (ed969cc7)
- REFACTOR: Extract streaming helpers to StreamingResource mixin (#2). (0b6f0ed9)
- DOCS: Refactors repository URLs to new location. (76835268)
- Resource-based API organization:
-
0.3.015 Oct 2025Release notes
Open source →[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
- FEAT: Enhance CreateModelRequest with new fields (#802). (c5c73549)
- FEAT: Add tool_name and index support (#800). (f0f77286)
- FEAT: Add remote_model and remote_host support (#799). (36b9d5f2)
- FEAT: Add truncate and shift support (#798). (098a0815)
- FEAT: Support high, medium, low for think (#797). (1cbe3fcf)
- FEAT: Support JSON schema in ResponseFormat (#796). (2f399465)
- FEAT: Upgrade to http v1.5.0 (#785). (f7c87790)
- BREAKING REFACTOR: Improve factory names (#806). (fbfa7acb)
- BREAKING BUILD: Require Dart >=3.8.0 (#792). (b887f5c6)
-
0.3.0+116 Oct 2025 -
0.2.531 Aug 2025 -
0.2.430 Jul 2025 -
0.2.312 Jun 2025Release notes
Open source →- FEAT: Add think/thinking params to ollama_dart (#721). (701d7968)
- FEAT: Add capabilities, projector_info, tensors and modified_at to Ollama's ModelInfo (#690). (c5e247db)
- FEAT: Update dependencies (requires Dart 3.6.0) (#709). (9e3467f7)
- REFACTOR: Remove fetch_client dependency in favor of http v1.3.0 (#659). (0e0a685c)
- FIX: Fix linter issues (#656). (88a79c65)
-
0.2.225 Sep 2024 -
0.2.2+116 Dec 2024 -
0.2.122 Aug 2024 -
0.2.026 Jul 2024Release notes
Open source →[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
- FEAT: Add tool calling support (#504). (1ffdb41b)
- BREAKING FEAT: Update Ollama default model to llama-3.1 (#506). (b1134bf1)
- FEAT: Add support for Ollama version and model info (#488). (a110ecb7)
- FEAT: Add suffix support in Ollama completions API (#503). (30d05a69)
- BREAKING REFACTOR: Change Ollama push model status type from enum to String (#489). (90c9ccd9)
- DOCS: Update Ollama request options default values in API docs (#479). (e1f93366)
-
0.1.202 Jul 2024 -
0.1.131 May 2024 -
0.1.014 May 2024Release notes
Open source →[!CAUTION] This release has breaking changes. See the Migration Guide for upgrade instructions.
-
0.1.0+120 May 2024 -
0.0.315 Feb 2024 -
0.0.3+110 Apr 2024Release notes
Open source → -
0.0.226 Dec 2023 -
0.0.2+131 Jan 2024 -
0.0.121 Nov 2023Release notes
Open source → -
0.0.1+105 Dec 2023 -
0.0.1+215 Dec 2023Release notes
Open source →