dartantic_gemma 0.3.0
dartantic_gemma: ^0.3.0 copied to clipboard
Dartantic provider plugin enabling local LLM inference using Google's Gemma models via Flutter
dartantic_gemma #
Dartantic provider plugin for Flutter Gemma local LLM inference.
Overview #
This package provides a Dartantic provider implementation that uses the flutter_gemma library for managing local LLM model interactions on Flutter mobile applications.
Features #
- Local LLM Inference: Run Gemma and other local models on-device
- Thinking Mode: Support for Gemma 4 E2B/E4B thinking mode via
enableThinkingparameter - Tool Calling: Full function calling support for GPT-style tool usage
- Embeddings: Text embeddings generation for semantic search and retrieval
Usage #
import 'package:dartantic_gemma/dartantic_gemma.dart';
final provider = FlutterGemmaProvider(huggingFaceToken: 'your-token');
// Create a chat model with thinking enabled
final chatModel = provider.createChatModel(
name: 'gemma-4b-it',
enableThinking: true,
temperature: 0.7,
);
// Create an embeddings model
final embeddingsModel = provider.createEmbeddingsModel(
name: 'embedding-gemma',
);
// Stream chat responses
await for (final result in chatModel.sendStream(messages)) {
// Handle result
}
Requirements #
- Dart SDK ^3.10.0
- Flutter SDK ^3.41.0 (stable)
- flutter_gemma ^0.13.2
License #
BSD 3-Clause License - see LICENSE file for details.