ollama 1.0.2 ollama: ^1.0.2 copied to clipboard
Access Ollama API from Dart
Ollama for Dart #
Ollama is a Dart library for facilitating local execution of Large Language Models (LLMs). Users can use the library to instantiate Ollama for response generation purposes.
Features #
- Generate completions for a given prompt or messages
- Generating vector embeddings
Usage #
After importing the Ollama library,
import 'package:ollama/ollama.dart';
you can instantiate Ollama with the following code:
var ollama = Ollama();
Generate Completions #
To generate completions for a given prompt, use the generate
method:
final result = await ollama.generate(
'What is the capital of France?',
model: 'base_model',
);
print(result);