mistralai_dart
8.3.0, released 2 weeks ago by langchaindart.dev
Pure Dart client for the Mistral AI API, supporting chat, embeddings, fine-tuning, agents, and more.
What it does
It provides a type‑safe, fully‑featured client for the Mistral AI API, including chat completions, streaming, embeddings, fine‑tuning, agents, and operational APIs. The client works on all Dart platforms without Flutter dependencies.
AI-written summary of version 8.3.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to integrate Mistral AI into a Dart or Flutter app
- You want a fully typed client with streaming support
- You prefer a pure Dart solution over HTTP wrappers
Skip it when
- You only need a minimal HTTP client for a single endpoint
- You are building a Flutter‑only UI that requires widget helpers
Strengths
- Full API coverage including beta features
- Pure Dart, no Flutter dependency
- Built‑in streaming, retries, and error handling
- Type‑safe request/response models
Weaknesses
- No Flutter widgets or UI helpers
- Requires an API key and network access
- Large feature set may be overkill for simple use cases
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add mistralai_dart to pubspec, set MISTRAL_API_KEY env var or pass key in code, then create MistralClient
import 'package:mistralai_dart/mistralai_dart.dart';
Future<void> main() async {
final client = MistralClient.fromEnvironment();
try {
final response = await client.chat.create(
request: ChatCompletionRequest(
model: 'mistral-small-latest',
messages: [ChatMessage.user('Hello! How are you?')],
),
);
print(response.text);
} finally {
client.close();
}
}Alternatives
Packages that do the same job and could replace mistralai_dart.
- ollama_dart
Type‑safe Dart client for Ollama’s chat, generation, embeddings, audio and model management APIs.
88Compare - langchain
A Dart/Flutter library for building LLM‑powered applications with LangChain patterns.
86Compare - openai_dart
Dart and Flutter client for OpenAI REST APIs and realtime WebSocket/WebRTC workflows.
91Compare - anthropic_sdk_dart
Dart client for the Anthropic API with streaming and tool support
86Compare
Works with
Packages commonly used together with mistralai_dart: ones it builds on, ones built on it, and its own family.