llamadart: on-device LLMs for Flutter and Dart
llamadart runs LLMs on-device in Flutter and Dart apps, with one API for GGUF and LiteRT-LM models on six platforms. See what it does and where to start.
On this page
llamadart is a Dart package for on-device inference. It runs GGUF models
through llama.cpp and .litertlm bundles through LiteRT-LM, on Android, iOS,
macOS, Linux, Windows and the web, behind one Dart API. Web support is
experimental.
Who this is for#
- Flutter and Dart developers who want AI features that run on the user's device: prompts stay private, and there is no inference server or API key.
- Apps that must work offline. Native targets need no network once the model is on the device; on the web, the page fetches the runtime and model over the network, then runs inference in the browser.
- Teams that want one codebase across mobile, desktop and web instead of a separate SDK per platform.
- Tools that need an OpenAI-compatible HTTP endpoint backed by a local model: see the OpenAI-compatible server example.
What you can build#
- Streaming chat and text generation, with structured JSON output.
- Tool calling driven by the model's chat template.
- Embeddings for search and retrieval.
- Image and audio input with multimodal models.
- Speech to text and text to speech.
- Image generation from text prompts on native platforms, with the opt-in stable-diffusion.cpp runtime (Preview).
- Decision models that answer typed questions without generating text.
- Runtime LoRA adapters.
Engines#
-
LlamaEngine: text generation, chat, embeddings and tool calling.ChatSessionis the stateful chat wrapper over it. ImageGenerationEngine: image generation (Preview).-
SpeechToTextEngineandTextToSpeechEngine: speech to text and text to speech. DecisionEngine: typed answers from decision models.
An engine reaches its runtime through LlamaBackend. The
glossary defines these terms.
Where to go next#
- New to llamadart: Install it, run the Quickstart, and read Finding models.
- Tutorials: build a Flutter chat app, or answer from your own documents with the RAG tutorial.
- Concepts and compatibility: check Model compatibility and Choosing llama.cpp or LiteRT-LM.
- Choosing a runnable app: see the Examples overview.
- Shipping: the support matrix, performance tuning and troubleshooting.
- Upgrading: the upgrade checklist.