ActiveModelParams class

The runtime knobs a caller passes to getActiveModel, captured so a second call can tell whether the cached singleton still satisfies the request.

This exists because the check was written twice and drifted. Mobile compared nothing beyond the model name, so getActiveModel(preferredBackend: cpu) after a GPU creation silently returned the GPU model; desktop compared three of the nine parameters, so the other six were equally silent there. Two copies of one rule is how the copies stop agreeing — keep the comparison here and let both shells call it.

Constructors

ActiveModelParams({required int maxTokens, PreferredBackend? preferredBackend, PreferredBackend? preferredVisionBackend, PreferredBackend? preferredAudioBackend, bool supportImage = false, bool supportAudio = false, int? maxNumImages, bool? enableSpeculativeDecoding, int? maxConcurrentSessions, List<int>? loraRanks})
const

Properties

enableSpeculativeDecoding bool?
final
hashCode int
The hash code for this object.
no setterinherited
loraRanks List<int>?
MediaPipe LoRA ranks. Forwarded to the engine by createModel, so a change must rebuild — it was the tenth knob and the comparison had nine.
final
maxConcurrentSessions int?
final
maxNumImages int?
final
maxTokens int
final
preferredAudioBackend PreferredBackend?
final
preferredBackend PreferredBackend?
final
preferredVisionBackend PreferredBackend?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportAudio bool
final
supportImage bool
final

Methods

firstDifference(ActiveModelParams other) String?
Name of the first parameter that differs from other, or null when the cached model can be reused. Both sides are normalized first.
normalized() ActiveModelParams
The same request with every value the engines normalise away already applied, so two requests that build a bit-identical engine compare equal.
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