Skip to content

nordwestt/ollama-ai-provider

Repository files navigation

AI SDK - Ollama Provider

The Ollama provider for the AI SDK contains language model support for the Ollama chat and completion APIs and embedding model support for the Ollama embeddings API.

Setup

The Ollama provider is available in the @ai-sdk/ollama module. You can install it with

npm i @ai-sdk/ollama

Provider Instance

You can import the default provider instance ollama from @ai-sdk/ollama:

import { ollama } from '@ai-sdk/ollama';

Example

import { ollama } from '@ai-sdk/ollama';
import { generateText } from 'ai';

const { text } = await generateText({
  model: ollama('gpt-4-turbo'),
  prompt: 'Write a vegetarian lasagna recipe for 4 people.',
});

Documentation

Please check out the Ollama provider documentation for more information.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published