ai-sdk-ollama weekly downloads statistics
Vercel AI SDK Provider for Ollama using official ollama-js library
ai-sdk-ollama has 47,569 recorded weekly downloads on npm, a decrease of 32.2% over the past 30 days, ranking #603 of 2,322 tracked listings.
About ai-sdk-ollama
AI SDK Ollama Provider
A Vercel AI SDK provider for Ollama, built on the official ollama package. Type-safe, cross-provider compatible, with access to native Ollama features.
Version compatibility
Each
ai-sdk-ollamamajor targets one AI SDK major. Every line stays published on npm, so pick the one that matches youraiversion:
ai-sdk-ollamaai(peer)Status 4.x(@latest)ai@^7Active. New features land here. 3.xai@^6Maintenance. Critical fixes only. 2.xai@^5Unmaintained. AI SDK v7 is stable, so v4 installs from
latest. The v3 line still works for AI SDK v6.
Quick Start
# AI SDK v7 (stable)
npm install ai-sdk-ollama ai
# AI SDK v6
npm install ai-sdk-ollama@^3 ai@^6
import { ollama } from 'ai-sdk-ollama';
import { generateText } from 'ai';
// Works in both Node.js and browsers
const { text } = await generateText({
model: ollama('llama3.2'),
prompt: 'Write a haiku about coding',
temperature: 0.8,
});
console.log(text);
Why Choose AI SDK Ollama?
- Reliable tool calling - Response synthesis adds text after tool execution, so you don't get empty replies
- Wrapper functions -
generateTextandstreamTextreturn complete responses - Built-in reliability - Reliability features run by default
- Automatic JSON repair - Cascade repair runs jsonrepair first, then an Ollama-specific fallback for trailing commas, comments, URLs, and Python constants
- Web search and fetch - Built-in tools powered by Ollama's web search API for current information
- Type-safe - Full TypeScript support with strict typing
- Cross-environment - Runs in Node.js and browsers automatically
- Native Ollama options - Use
mirostat,repeat_penalty,num_ctx, and more - Production-ready - Handles the tool-call and JSON edge cases that otherwise need manual workarounds
Enhanced Tool Calling
The problem this solves: Standard Ollama providers can execute a tool and then return empty text. These wrapper functions synthesize a response so you get complete output.
import { ollama, generateText, streamText } from 'ai-sdk-ollama';
// Enhanced generateText - returns complete responses after tool calls
const { text } = await generateText({
model: ollama('llama3.2'),
tools: {
/* your tools */
},
prompt: 'Use the tools and explain the results',
});
// Enhanced streaming - tool-aware streaming
const { textStream } = await streamText({
model: ollama('llama3.2'),
tools: {
/* your tools */
},
prompt: 'Stream with tools',
});
Web Search Tools
Web search and fetch: Built-in tools powered by Ollama's web search API for current information.
import { generateText } from 'ai';
import { ollama } from 'ai-sdk-ollama';
// 🔍 Web search for current information
const { text } = await generateText({
model: ollama('deepseek-v4.1-flash:cloud'), // Cloud models recommended for web search
prompt: 'What are the latest developments in AI this week?',
tools: {
webSearch: ollama.tools.webSearch({ maxResults: 5 }),
},
});
// 📄 Fetch specific web content
const { text: summary } = await generateText({
model: ollama('gpt-oss:120b-cloud'),
prompt: 'Summarize this article: https://example.com/article',
tools: {
webFetch: ollama.tools.webFetch({ maxContentLength: 5000 }),
},
});
// 🔄 Combine search and fetch for comprehensive research
const { text: research } = await generateText({
model: ollama('gpt-oss:120b-cloud'),
prompt: 'Research recent TypeScript updates and provide a detailed analysis',
tools: {
webSearch: ollama.tools.webSearch({ maxResults: 3 }),
webFetch: ollama.tools.webFetch(),
},
});
Web Search Prerequisites
- Ollama API Key: Set
OLLAMA_API_KEYenvironment variable - Cloud Models: Use cloud models for optimal web search performance:
deepseek-v4.1-flash:cloud- Best for general web searchgpt-oss:120b-cloud- Best for complex reasoning with web data
# Set your API key
export OLLAMA_API_KEY="your_api_key_here"
# Get your API key from: https://ollama.com/account
Contents…
Description from the npm listing.
- ai
- vercel-ai
- ollama
- ai-sdk
- llm
- language-model
- embedding
- chat
- local-ai
- provider
- typescript
- embeddings
- tool-calling
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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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 (122)Similar npm AI SDKs plugins
All 20 ai-sdk-ollama alternativesData 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/ai-sdk-ollama. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.