パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.0.4

ollama

DartからOllama APIにアクセスする

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
394
いいね数
32
Pub ポイント
140

パッケージをインストール

flutter pub add ollama

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

ollama パッケージは、Dart アプリケーションが Ollama API とやり取りできるようにし、ローカルの大型言語モデル(LLM)との統合を容易にします。プロンプトの送信と応答の受信に向けたシンプルなインターフェースを提供しており、クロスプラットフォームアプリ内でのAI機能開発に最適です。このパッケージは Android、iOS、macOS、Windows、Linux といった主要プラットフォームすべてをサポートしており、モバイルおよびデスクトップアプリに適しています。Flutter pub add を使って最小限のセットアップで、ローカルホストされたモデルを使用して生成型AI機能を迅速にプロトタイピングまたは展開できます。

用途

  • ローカルLLM統合
  • AIチャットアプリケーション
  • アプリでのテキスト生成
  • コード補完ツール
  • 研究プロトタイピング

主な機能

  • クロスプラットフォーム対応
  • シンプルなAPIインターフェース
  • ローカルモデルホスティングをサポート
  • リアルタイム応答処理
  • Flutterの統合が簡単

適している対象

  • Flutter開発者
  • AI実験者
  • ローカル LLM ユーザー
  • フルスタックアプリケーションビルダー
  • プライバシー重視のアプリケーション

注意事項

  • ローカルで実行中の Ollama サーバーが必要です
  • Ollama互換モデルに限定
  • リモートアクセスに必要なネットワーク構成
  • 組み込みモデル管理なし
  • Ollama API の安定性に依存

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Ollama for Dart

A Dart client for interacting with the Ollama API. This library provides an easy-to-use interface for generating text completions, chat responses, and embeddings using Ollama inference engine.

Features

  • Generate text completions
  • Generate chat responses
  • Generate embeddings
  • Support for streaming responses
  • Customizable model parameters

Installation

Run the following command to install the package:

dart pub add ollama

Usage

Initializing the client
import 'package:ollama/ollama.dart';

final ollama = Ollama();
// Or with a custom base URL:
// final ollama = Ollama(baseUrl: Uri.parse('http://your-ollama-server:11434'));
Generating text completions
final stream = ollama.generate(
  'Tell me a joke about programming',
  model: 'llama3',
);

await for (final chunk in stream) {
  print(chunk.response);
}
Generating chat responses
final messages = [
  ChatMessage(role: 'user', content: 'Hello, how are you?'),
];

final stream = ollama.chat(
  messages,
  model: 'llama3',
);

await for (final chunk in stream) {
  print(chunk.message?.content);
}
Generating embeddings
final embeddings = await ollama.embeddings(
  'Here is an article about llamas...',
  model: 'llama3',
);

print(embeddings);

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。