Skip to main content

Signatures

Dart has no overloading, so prompts and conversations are separate methods:
Passing messages to generate does not compile. Use generateChat. This is the single most common mistake when porting code from the Swift or Web docs.

With options

Generation auto-loads what it needs, and downloads when options.model names a model that is absent.

LlmOptions

Structured output

The schema is a String on Flutter, not an object. Pass the JSON schema as text.

Cancelling

A namespace-level cancel exists on llm and vlm. No other SDK has this.

Errors

Throws SDKException when no model can be loaded or generation fails.