API ReferenceFlutter
Enums and Constants
Flutter enum and support types for zetic_mlange.
This page reflects zetic_mlange 1.11.1.
General Model Types
| Type | Values |
|---|---|
ModelMode | runAuto, runFp32, runQuantized, runSpeed, runAccuracy |
APType | cpu, gpu, npu, na |
ModelCacheHandlingPolicy | removeOverlapping, keepExisting |
Target contains backend identifiers used by selected general-model artifacts. Most Flutter apps use ModelMode.
LLM Types
| Type | Values |
|---|---|
LLMModelMode | runAuto, runSpeed, runAccuracy |
LLMTarget | llamaCpp, litertLm, mllm |
LLMQuantType | GGUF quantization variants such as ggufQuantF16, ggufQuantQ4KM, and ggufQuantQ80 |
LLMKVCacheCleanupPolicy | cleanUpOnFull, doNotCleanUp |
KVStateStatus | ok, notSupported, invalidArgument, fileNotFound, ioError, corrupt, modelMismatch, contextTooSmall |
LLMInitOption
final class LLMInitOption {
const LLMInitOption({
this.kvCacheCleanupPolicy = LLMKVCacheCleanupPolicy.cleanUpOnFull,
this.nCtx = 2048,
});
}| Field | Default | Description |
|---|---|---|
kvCacheCleanupPolicy | cleanUpOnFull | In-memory KV-cache behavior when context storage is full. |
nCtx | 2048 | Requested context size. The runtime may normalize it. |
Result and Error Types
| Type | Purpose |
|---|---|
LLMNextTokenResult | Token result returned by waitForNextToken(). |
MlangeException | Dart exception for validation and native SDK failures. |
MlangeKVException | Typed exception carrying a non-OK KVStateStatus. |
MlangeProgressCallback | Download progress callback from 0.0 to 1.0. |
Background Download Types
| Type | Values or purpose |
|---|---|
BackgroundDownloadHandle | Durable job identifier returned by downloadInBackground(...); retain it to query or stop the job. |
BackgroundDownloadState | queued, resolving, downloading, verifying, installed, failed, stopped |
BackgroundDownloadStatus | Latest job snapshot: handle, state, downloaded bytes, optional total bytes, optional error message, progress, and isTerminal. |
BackgroundDownloadStopResult | stopped, alreadyFinished, notFound |
ModelRemovalResult | Removal outcome: removed, isInUse, deletedFiles, and deletedBytes. |
installed, failed, and stopped are terminal states. If ModelRemovalResult.isInUse is true, close active model instances before retrying removal.