Welcome to Dartantic!
Dartantic
Hello and welcome to Dartantic!
The dartantic_ai package is an agent framework inspired by pydantic-ai and designed to make building client and server-side apps in Dart with generative AI easier and more fun!
Why Dartantic?
Dartantic was born out of frustration with not being able to easily use generative AI in my Dart and Flutter apps without doing things in a very different way based on the model I chose and the type of app I was building, i.e. GUI, CLI or server-side. It's all Dart -- why can't I use all the models with a single API across all the apps?
As an example of the kinds of apps that I wanted to build, consider CalPal, a Flutter app that uses Dartantic to build an agentic workflow for managing a user's calendar. Check out this screenshot:

In about ~300 LOC, CalPal is able to figure out the events in my schedule based on an English phrase. To do this, it first has to figure out the local date and time to understand what "today" means anyway and then uses the result of that against the Zapier MCP server connected to my Google Calendar.
That multi-step tool usage is all built into Dartantic and it's what makes it an "agentic" framework.
Oh, and then just for fun, I asked CalPal to add a calendar event to my calendar based on a picture of the events at my local pool. I can't image the person-years of effort that would've been required to build this without generative AI, but I couldn't rest until I had that kind of power for all my Dart and Flutter apps.
Combine that with pydantic-ai for inspiration and Dartantic was born.
Enjoy!
Quick Start
Get started with dartantic_ai:
void main() async {
// Create an agent with a model string and a system prompt
final agent = Agent(
'openai', // Can also use 'openai:gpt-4o' or 'openai/gpt-4o'
systemPrompt: 'Be concise, reply with one sentence.',
);
// Run the agent with a prompt (non-streaming)
final result = await agent.run('Where does "hello world" come from?');
print(result.output); // Output: one sentence on the origin of "hello world"
}
Getting Started
- Basic Agent Usage - Simple agent creation and usage
- Features - Complete feature overview
- Supported Providers - Available AI model providers
- Notes On AI Codegen - Notes on how Dartantic was built and why
Core Features
- Multi-turn Chat - Multi-message chat with history for context
- Typed Output - Typed Dart objects from your
run
results - Tool Calling - Type-safe tool integration
- Streaming Output - Real-time response streaming
Advanced Features
- Agentic Behavior - Multi vs. single step tool calling
- Multi-media Input - File and image processing
- Embeddings - Vector embeddings and similarity
- Using DotPrompt - Structured prompt management
Integration & Configuration
- Logging - Debug and monitor your agents
- Model Discovery - Enumerate available models
- MCP Server Support - External tool integration
- Provider Capabilities - Check what providers support
- Custom Providers - Build your own integrations