From 34d68b777af3f28b4fba5e941e2e080a3a9c579a Mon Sep 17 00:00:00 2001 From: a Date: Thu, 19 Jun 2025 21:59:00 -0400 Subject: [PATCH] docs: Add ollama configuration example --- packages/web/src/content/docs/docs/models.mdx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/web/src/content/docs/docs/models.mdx b/packages/web/src/content/docs/docs/models.mdx index 28a22dd4e8c..3b7e2cb8fac 100644 --- a/packages/web/src/content/docs/docs/models.mdx +++ b/packages/web/src/content/docs/docs/models.mdx @@ -57,6 +57,30 @@ To configure a local model, specify the npm package to use and the `baseURL`. } ``` +#### Example: Ollama + +Requirements: +- You must set-up an API key for Ollama to appear as a provider. +- The model name must include the 'variant', e.g. "latest", "7b", etc. +- The JSON value must be empty. + +```json title="opencode.json" {5,7} +{ + "$schema": "https://opencode.ai/config.json", + "provider": { + "ollama": { + "npm": "@ai-sdk/openai-compatible", + "options": { + "baseURL": "http://localhost:11434/v1" + }, + "models": { + "llama3.2:latest": {} + } + } + } +} +``` + --- ## Select a model