breitburg / dart-ollama

Use Ollama's LLMs directly from Dart

Home Page:https://pub.dev/packages/ollama

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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);

About

Use Ollama's LLMs directly from Dart

https://pub.dev/packages/ollama

License:GNU General Public License v2.0


Languages

Language:Dart 100.0%