패키지, 저장소 및 앱 카테고리 검색

패키지 상세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 개발자
  • 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.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.