Skip to content
PluginStats

ollama-ai-provider-v2 weekly downloads statistics

By nordwestt · npm · AI SDKs

Use Ollama with the Vercel AI SDK, implementing the official Ollama API. This provider has minimal dependencies and is web-compatible out of the box.

View on npm Stale · Oct 18, 2026

ollama-ai-provider-v2 has 543,048 recorded weekly downloads on npm, a decrease of 35.7% over the past 30 days.

Weekly downloads
543,048
Official API · Oct 18, 2026
7-day growth
-44.2%
-429.9K weekly downloads
30-day growth
-35.7%
-301.7K weekly downloads
90-day growth
-8.9%
-53.3K weekly downloads
Rank
—
Among tracked npm listings

About ollama-ai-provider-v2

Ollama Provider V2 for Vercel AI SDK

Use Ollama with the Vercel AI SDK, implementing the official Ollama API. This provider has minimal dependencies and is web-compatible out of the box.

npm version TypeScript Node.js License: Apache-2.0

Support this project — Maintained in spare time and free to use under Apache-2.0. If you value this plugin and appreciate it, a donation is appreciated and helps keep it updated with new AI SDK releases.

Why Choose Ollama Provider V2?

  • ✅ Minimal Dependencies - Lean codebase with just 2 core dependencies
  • ✅ Universal Compatibility - Works seamlessly in Node.js, browsers, and edge environments
  • ✅ Direct Ollama Integration - Uses official Ollama API endpoints for maximum compatibility
  • ✅ Advanced Features - Tool calling, streaming, thinking mode, embeddings, and completion models
  • ✅ Type Safety - Full TypeScript support with comprehensive type definitions
  • ✅ Zero Configuration - Works out-of-the-box with sensible defaults
  • ✅ Actively Maintained - Regular updates and AI SDK v7 compatibility

Quick Start

npm install ollama-ai-provider-v2 ai
import { ollama } from 'ollama-ai-provider-v2';
import { generateText } from 'ai';

// Works everywhere - Node.js, browsers, edge environments
const { text } = await generateText({
  model: ollama('llama3.2'),
  prompt: 'Write a haiku about coding',
});

console.log(text);

Core Features

Streaming Text Generation
import { streamText } from 'ai';

const { textStream } = await streamText({
  model: ollama('llama3.2'),
  prompt: 'Tell me a story about artificial intelligence',
});

for await (const chunk of textStream) {
  process.stdout.write(chunk);
}
Tool Calling Support

AI SDK 7 defaults to a single generation step. When the model calls a tool, that step ends with empty text and populated toolCalls. Set stopWhen to allow the model to execute tools and then answer.

import { generateText, tool, stepCountIs } from 'ai';
import { z } from 'zod';

const { text, toolCalls, toolResults } = await generateText({
  model: ollama('llama3.2'),
  stopWhen: stepCountIs(5), // allow tool call + follow-up answer
  prompt: 'What is the weather like in San Francisco?',
  tools: {
    getWeather: tool({
      description: 'Get current weather for a location',
      inputSchema: z.object({
        location: z.string().describe('City name'),
        unit: z.enum(['celsius', 'fahrenheit']).optional(),
      }),
      execute: async ({ location, unit = 'celsius' }) => {
        return { temp: 18, unit, condition: 'sunny' };
      },
    }),
  },
});
Reasoning Mode (Thinking)

Unique feature for models that support chain-of-thought reasoning:

const { text } = await generateText({
  model: ollama('deepseek-r1:7b'),
  reasoning: 'high', // AI SDK 7 top-level reasoning option
  prompt: 'Solve this complex math problem step by step: 2x + 5 = 17',
});

You can also use the Ollama-specific provider option:

const { text } = await generateText({
  model: ollama('deepseek-r1:7b'),
  providerOptions: { ollama: { think: true } },
  prompt: 'Solve this complex math problem step by step: 2x + 5 = 17',
});
Advanced Ollama Options

Access Ollama's native parameters while maintaining AI SDK compatibility:

const { text } = await generateText({
  model: ollama('llama3.2'),
  providerOptions: {
    ollama: {
      options: {
        seed: 123,           // Deterministic outputs
        num_ctx: 8192,       // Context window size
        repeat_penalty: 1.1, // Control repetition
        top_k: 40,          // Advanced sampling
        min_p: 0.1,         // Minimum probability
      },
    },
  },
  prompt: 'Write a detailed analysis of Alice in Wonderland',
  temperature: 0.8, // Standard AI SDK parameters work too
});
Embeddings
import { embed } from 'ai';

// Single embedding
const { embedding } = await embed({
  model: ollama.embedding('nomic-embed-text'),
  value: 'Hello world',
});

console.log('Embedding dimensions:', embedding.length);

// Batch embeddings
const texts = ['Hello world', 'How are you?', 'AI is amazing'];
const results = await Promise.all(
  texts.map((text) =>
    embed({
      model: ollama.embedding('all-minilm'),
      value: text,
    })
  )
);
Completion Models

For use cases requiring completion-style generation:

const { text } = await generateText({
  model: ollama.completion('codellama:code'),
  prompt: 'def fibonacci(n):\n    if n <= 1:\n        return n\n    else:\n        return fibonacci(n-1) + fibonacci(n-2)\n\n# Optimize this function:\n',
});

Custom Ollama Instance

Connect to remote Ollama servers or custom configurations:

import { createOllama } from 'ollama-ai-provider-v2';

const customOllama = createOllama({
  baseURL: 'https://my-ollama-server.com/api',
  headers: {
    'Authorization': 'Bearer your-token',
  },
});

const { text } = await generateText({
  model: customOllama('llama3.2'),
  prompt: 'Hello from remote server!',
});

Supported Models

Works with any model in your Ollama installation, including:…

Description from the npm listing.

  • ai
  • vercel
  • ai-sdk
  • ai-sdk-v7
  • ollama
  • llm
  • provider
  • chat
  • streaming
  • tool-calling
  • thinking-mode
  • completion-models
  • local-ai
  • embeddings

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

ollama-ai-provider-v2 weekly downloads on npm, last 90 days: 543,048 weekly downloads as of Oct 18, 2026, -8.9% over 90 days.ollama-ai-provider-v2Weekly downloads on npm · Last 90 days543,048downloads / week-8.9% over 90 days400K500K600K700K800K900K1M1.1M1.2MJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 24, 2026 – Oct 18, 2026 · 87 observations · Updated Oc…pluginstats.com
ollama-ai-provider-v2 weekly downloads on npm, last 90 days: 543,048 weekly downloads as of Oct 18, 2026, -8.9% over 90 days.

7/30/90-day growth

ollama-ai-provider-v2 weekly downloads growth on npm: -44.2% over 7 days, -35.7% over 30 days, -8.9% over 90 days.ollama-ai-provider-v2Weekly downloads growth on npm543,048downloads / week now7-day growth-429,854 weekly downloads-44.2%30-day growth-301,702 weekly downloads-35.7%90-day growth-53,329 weekly downloads-8.9%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
ollama-ai-provider-v2 weekly downloads growth on npm: -44.2% over 7 days, -35.7% over 30 days, -8.9% over 90 days.

Ranking history

ollama-ai-provider-v2 npm ranking history: currently #264 (by weekly downloads).ollama-ai-provider-v2npm ranking · by weekly downloads · Last 90 days#264current rank#50#100#150#200#250#300Jul 23Aug 7Aug 22Sep 6Sep 21Oct 6Oct 21rankOct 17, 2026 – Oct 21, 2026 · 5 observations · Updated Oct 18, 2026pluginstats.com
ollama-ai-provider-v2 npm ranking history: currently #264 (by weekly downloads).

Listing placement

All npm2,422 listings · 122 pages · 1,213 shown · page 14, #4 (overall #264)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs270 listings · 14 pages · page 1, #7 (overall #7)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (544)
Recent weekly downloads observations for ollama-ai-provider-v2
Date (UTC)Weekly downloadsChange vs. previous
543,048+97.3K
445,705-105K
550,686-9.8K
560,504-219.3K
779,796-201.3K
981,1110
981,111+8.2K
972,902-4.6K
977,543-5.2K
982,751+4.2K
978,600+29K
949,626+24.5K
925,100-197.2K
1,122,272—

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/ollama-ai-provider-v2. First seen Oct 16, 2026; last successful collection Oct 22, 2026. See the methodology.