ollama 1.0.2 copy "ollama: ^1.0.2" to clipboard
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);
20
likes
0
pub points
77%
popularity

Publisher

unverified uploader

Access Ollama API from Dart

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on ollama