Skip to content

Commit 12c7493

Browse files
authored
docs: update ai-sdk-ollama to alternative providers for Ollama (vercel#8086)
## Background The current Ollama provider documentation contains Alternative Providers section, this PR updates the content. ## Summary This PR updates documentation for `ai-sdk-ollama` as an alternative provider in the Ollama documentation. This provider uses the official `ollama` npm package instead of direct HTTP calls, providing automatic environment detection, built-in error handling, and full TypeScript support for Ollama-specific options. ## Related Issues Related to vercel#6924 - Provides additional provider options for Ollama users
1 parent a84b07a commit 12c7493

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

content/providers/03-community-providers/03-ollama.mdx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ console.log(
104104

105105
## Alternative Providers
106106

107-
There is an alternative provider package called [`ai-sdk-ollama` by jagreehal](https://github.com/jagreehal/ai-sdk-ollama), which is fundamentally different from this provider. Instead of using the HTTP API directly, it leverages the [`ollama`](https://www.npmjs.com/package/ollama) package for communication.
107+
There is an alternative provider package called [`ai-sdk-ollama` by jagreehal](https://github.com/jagreehal/ai-sdk-ollama), which uses the official
108+
[`Ollama`](https://www.npmjs.com/package/ollama) JavaScript client library instead of direct HTTP API calls.
108109

109-
This approach may have different tradeoffs in terms of performance, compatibility, and features. It may be better or worse for your use case, so you may want to review both options to decide which fits your needs best.
110+
Key differences:
111+
112+
- Uses the official `ollama` npm package for communication
113+
- Provides automatic environment detection (Node.js vs browser)
114+
- Includes built-in error handling and retries via the official client
115+
- Supports both CommonJS and ESM module formats
116+
- Full TypeScript support with type-safe Ollama-specific options via `providerOptions.ollama`
117+
118+
This approach leverages Ollama's official client library, which may provide better compatibility with
119+
Ollama updates and additional features like model management. Both providers implement the AI SDK
120+
specification, so you can choose based on your specific requirements and preferences.

0 commit comments

Comments
 (0)