LiteRtLmClient class

gRPC client wrapper for LiteRT-LM server communication

Constructors

LiteRtLmClient()

Properties

conversationId String?
Current conversation ID
no setter
hashCode int
The hash code for this object.
no setterinherited
isInitialized bool
Whether the client is connected and model is initialized
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

chat(String text, {String? conversationId}) Stream<String>
Send a chat message and get streaming response
chatWithAudio(String text, Uint8List audioBytes, {String? conversationId}) Stream<String>
Send a multimodal chat message (text + audio) - Gemma 3n E4B only
chatWithImage(String text, Uint8List imageBytes, {String? conversationId}) Stream<String>
Send a multimodal chat message (text + image)
chatWithImageSync(String text, Uint8List imageBytes, {String? conversationId}) Future<String>
Send a multimodal chat message (text + image) - SYNC version
closeConversation({String? conversationId}) Future<void>
Close current conversation
connect({String host = 'localhost', int? port}) Future<void>
Connect to the gRPC server
createConversation({String? systemMessage, double? temperature, int? topK, double? topP}) Future<String>
Create a new conversation
disconnect() Future<void>
Disconnect from server
healthCheck() Future<bool>
Health check
initialize({required String modelPath, String backend = 'gpu', int maxTokens = 2048, bool enableVision = false, int maxNumImages = 1, bool enableAudio = false}) Future<void>
Initialize the model
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shutdown() Future<void>
Shutdown the model engine
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited