ModelRuntimeDefaults class
Runtime defaults resolved from a Hugging Face repo's deployment metadata
(e.g. a litertlm_manifest.json), in flutter_gemma's own runtime vocabulary.
Every field is nullable: null means "the manifest is silent — use the SDK
default". These are the how-to-run knobs the app passes to
FlutterGemma.getActiveModel / createSession, NOT install-time identity.
They are overridable defaults, never authoritative config baked into the
model — an explicit argument at the call site always wins over the field
here, which in turn wins over the SDK default.
Kept as its own value object (separate from ResolvedHfModel's identity
fields) so the identity record — InferenceModelSpec — never grows runtime
fields, preserving flutter_gemma's install-vs-runtime separation. It also
makes the merge a pure function: explicit ?? defaults?.x ?? sdkDefault.
Constructors
- ModelRuntimeDefaults({int? maxTokens, PreferredBackend? preferredBackend, bool? supportImage, bool? supportAudio, bool? isThinking, int? minOutputTokens})
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isThinking → bool?
-
Whether the model emits a thinking channel
(
capabilities.thinking.declared). Apply ascreateSession'senableThinking.final - maxTokens → int?
-
Context-window size (
maxTokens), if the manifest declares one (model.context_length). Still clamped by the engine downstream — a manifest cannot set a value the engine rejects.final - minOutputTokens → int?
-
The minimum output-token budget the model needs
(
session_defaults.max_output_tokens_min) — e.g. a reasoning model is cut off mid-<think>below this. This is a FLOOR, not a cap: when you setcreateSession(maxOutputTokens:), keep it at or above this value (or leave the cap unset). Do NOT assume it is itself the cap to apply blindly — passing a floor into a smaller cap would truncate output.final - preferredBackend → PreferredBackend?
-
Recommended text/decoder backend for this device.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportAudio → bool?
-
Declared audio capability (
capabilities.audio).final - supportImage → bool?
-
Declared vision capability (
capabilities.vision).final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited