AI chat template

A Flutter AI chat template with streaming and tool calling

AI chat is the most requested feature in mobile apps right now, and the easiest to get wrong. Flutter Agent Kit ships a streaming chat skill with tool calling that works against any OpenAI-compatible endpoint.

What the ai-chat skill does

  • Streaming responses: Token-by-token rendering so the chat feels fast, with the stream managed through Riverpod state.
  • Tool calling: The model can call functions in your app, with results fed back into the conversation.
  • OpenAI-compatible endpoints: Works against OpenAI, or any compatible API, so you are not locked to one provider.
  • Conversation state: Message history and loading states handled consistently with the kit's architecture.

Why AI chat is hard to build alone

Streaming, cancellation, error recovery, tool calling and history management interact with each other. An AI agent asked to build chat from scratch produces something that works in the happy path and breaks on timeouts, cancelled requests or malformed tool calls.

The skill encodes the production path: how to manage the stream, how to handle tool call loops, where state lives. The agent implements the proven design instead of inventing one.

It is proven: BitPong, a Flutter app with 1000+ active users on the App Store ships AI features built with these patterns, and Any AI for Notion is an AI assistant built with the kit.

API key handling

The skill follows the architecture's service layer conventions: LLM calls go through service classes, so the endpoint and key handling live in one place. For apps that call your own backend, the same pattern points the service at your server instead of the provider directly.

Frequently asked questions

Which LLM providers work?

Any OpenAI-compatible endpoint. That covers OpenAI and compatible APIs, so you can switch providers without changing the feature.

Does it support images or only text?

The skill focuses on text chat with tool calling. The service layer pattern extends to multimodal payloads if your endpoint supports them.

Get Flutter Agent Kit

Each of these templates ships as part of Flutter Agent Kit, along with the AGENTS.md context layer and the skills that keep your agent inside the architecture. One purchase, €99.99, lifetime updates, unlimited projects.