MobileInferenceModel class
Constructors
-
MobileInferenceModel({required int maxTokens, required VoidCallback onClose, required ModelType modelType, ModelFileType fileType = ModelFileType.task, PreferredBackend? preferredBackend, PreferredBackend? activeBackend, List<int>? supportedLoraRanks, bool supportImage = false, bool supportAudio = false, int? maxNumImages, int? maxConcurrentSessions})
-
Methods
-
close()
→ Future<void>
-
override
-
createChat({double temperature = .8, int randomSeed = 1, int topK = 1, double? topP, int tokenBuffer = 256, String? loraPath, bool? supportImage, bool? supportAudio, List<Tool> tools = const [], bool? supportsFunctionCalls, bool isThinking = false, ModelType? modelType, ToolChoice toolChoice = ToolChoice.auto, int? maxFunctionBufferLength, String? systemInstruction})
→ Future<InferenceChat>
-
override
-
createSession({double temperature = .8, int randomSeed = 1, int topK = 1, double? topP, String? loraPath, bool? enableVisionModality, bool? enableAudioModality, String? systemInstruction, bool enableThinking = false, List<Tool> tools = const []})
→ Future<InferenceModelSession>
-
Creates a new InferenceModelSession for generation.
override
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
openChat({double temperature = .8, int randomSeed = 1, int topK = 1, double? topP, int tokenBuffer = 256, String? loraPath, bool? supportImage, bool? supportAudio, List<Tool> tools = const [], bool? supportsFunctionCalls, bool isThinking = false, ModelType? modelType, ToolChoice toolChoice = ToolChoice.auto, int? maxFunctionBufferLength, String? systemInstruction})
→ Future<InferenceChat>
-
Same as createChat, but uses openSession internally so the
resulting chat owns an independent session that does not touch the
legacy session field or other open chats. Use this when you need
concurrent chats on a single loaded model.
inherited
-
openSession({double temperature = .8, int randomSeed = 1, int topK = 1, double? topP, String? loraPath, bool? enableVisionModality, bool? enableAudioModality, String? systemInstruction, bool enableThinking = false, List<Tool> tools = const []})
→ Future<InferenceModelSession>
-
Opens a new session detached from session. Each call returns a
fresh independent session sharing the loaded model weights but with
isolated context (history / KV cache). Use this for concurrent
dialogues on a single loaded model.
override
-
toString()
→ String
-
A string representation of this object.
inherited