Session

Hybrid AI in Flutter with Genkit — On-Device and Cloud Models Through a Single API

Most Flutter apps treat AI as a cloud-only feature — send a request, wait for a response, pay per token. But what about offline scenarios, real-time interactions, or features where user data should never leave the device?
Hybrid AI combines cloud and on-device models in a single application. Cloud providers like Gemini or OpenAI handle complex reasoning and multimodal tasks. Local models — Gemma, Llama, DeepSeek, Phi, and others — run directly on the user's device for low-latency responses, offline access, and data privacy. The challenge has always been maintaining two completely different AI stacks with different APIs, formats, and deployment models.
Genkit's Dart SDK and its plugin system solve this. With plugins like genkit_flutter_gemma for TFLite/LiteRT models and genkit_llamadart for GGUF, on-device inference runs across Android, iOS, macOS, Windows, Linux, and Web — through the same API you use for cloud providers. Switching between cloud and local inference is a one-line change: same flows, same structured output, same tool calling — just a different model reference.
We'll start with an overview of Genkit — its core concepts, plugin architecture, and capabilities for building AI orchestrations: flows, structured output, tool calling, agentic workflows, and the middleware system. Then we'll dive into what makes Genkit on Dart unique — a native SDK that lets you build AI features in the same language as your Flutter app, from backend to frontend. Finally, we'll focus on the hybrid AI approach in detail: why it matters, what architectural patterns it enables, and how to build it in practice — configuring cloud and on-device models, defining shared flows that work with both, and switching between them through a single Genkit API without changing your application logic.

Sasha Denisov

Brainform.ai, CTO, Cloud.AI, Flutter, Dart and Firebase GDE

Berlin, Germany

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top