Skip to content
pubscout

ollama_dart

5.0.0, released 12 days ago by davidmiguel.com

Type‑safe Dart client for Ollama’s chat, generation, embeddings, audio and model management APIs.

WASM-ready
$ flutter pub add ollama_dart
Source repository

What it does

Provides Dart classes to call Ollama’s REST endpoints for chat completions, streaming responses, multimodal embeddings, speech generation, transcription, and model operations. Handles configuration, retries, and error handling without requiring Flutter.

AI-written summary of version 5.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need direct access to a local or Ollama Cloud server from Dart or Flutter
  • You want streaming chat or audio responses with type‑safe models
  • You require model management (pull, push, delete) and cloud usage reporting

Skip it when

  • You need a higher‑level abstraction that includes UI widgets
  • You prefer a Flutter‑only package with built‑in widgets

Strengths

  • Pure Dart, no Flutter dependency
  • Comprehensive coverage of Ollama API, including newer speech and System One features
  • Built‑in streaming, retries, and interceptors

Weaknesses

  • Limited to Ollama backend; not a generic LLM client
  • No UI components, so you must build your own UI

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
3
import 'package:ollama_dart/ollama_dart.dart';

void main() async {
  final client = OllamaClient();
  final response = await client.chat.create(
    request: ChatRequest(model: 'gpt-oss', messages: [ChatMessage.user('Explain isolates.')]),
  );
  print(response.message?.content);
  client.close();
}

Alternatives

Packages that do the same job and could replace ollama_dart.

  • llamadart

    Another Dart client for Ollama/LLM APIs with a similar feature set

Works with

Packages commonly used together with ollama_dart: ones it builds on, ones built on it, and its own family.