Skip to main content

1. Register a backend, then initialize

Named arguments, not an options object. Pass an empty API key for keyless local mode.

2. Generate text

3. Stream it instead

4. Hold a conversation

Flutter uses a separate method for conversations, because Dart has no overloading:

5. Add speech

tts.speak is synchronous and returns the handle immediately.

A complete widget

Cancelling the subscription in dispose is what stops the generation outliving the widget.

Next

Managing models

Download, load, and unload

Tool calling

Let the model call your functions

Voice agent

A full spoken conversation

Error handling

What throws and when