ollama-ai-provider
Advanced tools
Comparing version 1.0.0 to 1.1.0
import { ProviderV1, LanguageModelV1, EmbeddingModelV1 } from '@ai-sdk/provider'; | ||
type OllamaChatModelId = 'athene-v2' | 'athene-v2:72b' | 'aya-expanse' | 'aya-expanse:8b' | 'aya-expanse:32b' | 'codegemma' | 'codegemma:2b' | 'codegemma:7b' | 'codellama' | 'codellama:7b' | 'codellama:13b' | 'codellama:34b' | 'codellama:70b' | 'codellama:code' | 'codellama:python' | 'command-r' | 'command-r:35b' | 'command-r-plus' | 'command-r-plus:104b' | 'deepseek-coder-v2' | 'deepseek-coder-v2:16b' | 'deepseek-coder-v2:236b' | 'falcon2' | 'falcon2:11b' | 'firefunction-v2' | 'firefunction-v2:70b' | 'gemma' | 'gemma:2b' | 'gemma:7b' | 'gemma2' | 'gemma2:2b' | 'gemma2:9b' | 'gemma2:27b' | 'granite3-dense' | 'granite3-dense:2b' | 'granite3-dense:8b' | 'granite3-guardian' | 'granite3-guardian:2b' | 'granite3-guardian:8b' | 'granite3-moe' | 'granite3-moe:1b' | 'granite3-moe:3b' | 'llama2' | 'llama2:7b' | 'llama2:13b' | 'llama2:70b' | 'llama3' | 'llama3:8b' | 'llama3:70b' | 'llama3-chatqa' | 'llama3-chatqa:8b' | 'llama3-chatqa:70b' | 'llama3-gradient' | 'llama3-gradient:8b' | 'llama3-gradient:70b' | 'llama3.1' | 'llama3.1:8b' | 'llama3.1:70b' | 'llama3.1:405b' | 'llama3.2' | 'llama3.2:1b' | 'llama3.2:3b' | 'llama3.2-vision' | 'llama3.2-vision:11b' | 'llama3.2-vision:90b' | 'llama-guard3' | 'llama-guard3:1b' | 'llama-guard3:8b' | 'llava' | 'llava:7b' | 'llava:13b' | 'llava:34b' | 'llava-llama3' | 'llava-llama3:8b' | 'llava-phi3' | 'llava-phi3:3.8b' | 'mistral' | 'mistral:7b' | 'mistral-large' | 'mistral-large:123b' | 'mistral-nemo' | 'mistral-nemo:12b' | 'mistral-small' | 'mistral-small:22b' | 'mixtral' | 'mixtral:8x7b' | 'mixtral:8x22b' | 'moondream' | 'moondream:1.8b' | 'openhermes' | 'openhermes:v2.5' | 'nemotron' | 'nemotron:70b' | 'nemotron-mini' | 'nemotron-mini:4b' | 'opencoder' | 'opencoder:1.5b' | 'opencoder:8b' | 'phi3' | 'phi3:3.8b' | 'phi3:14b' | 'phi3.5' | 'phi3.5:3.8b' | 'qwen' | 'qwen:7b' | 'qwen:14b' | 'qwen:32b' | 'qwen:72b' | 'qwen:110b' | 'qwen2' | 'qwen2:0.5b' | 'qwen2:1.5b' | 'qwen2:7b' | 'qwen2:72b' | 'qwen2.5' | 'qwen2.5:0.5b' | 'qwen2.5:1.5b' | 'qwen2.5:3b' | 'qwen2.5:7b' | 'qwen2.5:14b' | 'qwen2.5:32b' | 'qwen2.5:72b' | 'qwen2.5-coder' | 'qwen2.5-coder:0.5b' | 'qwen2.5-coder:1.5b' | 'qwen2.5-coder:3b' | 'qwen2.5-coder:7b' | 'qwen2.5-coder:14b' | 'qwen2.5-coder:32b' | 'shieldgemma' | 'shieldgemma:2b' | 'shieldgemma:9b' | 'shieldgemma:27b' | 'smollm' | 'smollm:135m' | 'smollm:360m' | 'smollm:1.7b' | 'tulu3' | 'tulu3:8b' | 'tulu3:70b' | (string & NonNullable<unknown>); | ||
type OllamaChatModelId = 'athene-v2' | 'athene-v2:72b' | 'aya-expanse' | 'aya-expanse:8b' | 'aya-expanse:32b' | 'codegemma' | 'codegemma:2b' | 'codegemma:7b' | 'codellama' | 'codellama:7b' | 'codellama:13b' | 'codellama:34b' | 'codellama:70b' | 'codellama:code' | 'codellama:python' | 'command-r' | 'command-r:35b' | 'command-r-plus' | 'command-r-plus:104b' | 'deepseek-coder-v2' | 'deepseek-coder-v2:16b' | 'deepseek-coder-v2:236b' | 'falcon2' | 'falcon2:11b' | 'firefunction-v2' | 'firefunction-v2:70b' | 'gemma' | 'gemma:2b' | 'gemma:7b' | 'gemma2' | 'gemma2:2b' | 'gemma2:9b' | 'gemma2:27b' | 'granite3-dense' | 'granite3-dense:2b' | 'granite3-dense:8b' | 'granite3-guardian' | 'granite3-guardian:2b' | 'granite3-guardian:8b' | 'granite3-moe' | 'granite3-moe:1b' | 'granite3-moe:3b' | 'llama2' | 'llama2:7b' | 'llama2:13b' | 'llama2:70b' | 'llama3' | 'llama3:8b' | 'llama3:70b' | 'llama3-chatqa' | 'llama3-chatqa:8b' | 'llama3-chatqa:70b' | 'llama3-gradient' | 'llama3-gradient:8b' | 'llama3-gradient:70b' | 'llama3.1' | 'llama3.1:8b' | 'llama3.1:70b' | 'llama3.1:405b' | 'llama3.2' | 'llama3.2:1b' | 'llama3.2:3b' | 'llama3.2-vision' | 'llama3.2-vision:11b' | 'llama3.2-vision:90b' | 'llama3.3' | 'llama3.3:70b' | 'llama-guard3' | 'llama-guard3:1b' | 'llama-guard3:8b' | 'llava' | 'llava:7b' | 'llava:13b' | 'llava:34b' | 'llava-llama3' | 'llava-llama3:8b' | 'llava-phi3' | 'llava-phi3:3.8b' | 'marco-o1' | 'marco-o1:7b' | 'mistral' | 'mistral:7b' | 'mistral-large' | 'mistral-large:123b' | 'mistral-nemo' | 'mistral-nemo:12b' | 'mistral-small' | 'mistral-small:22b' | 'mixtral' | 'mixtral:8x7b' | 'mixtral:8x22b' | 'moondream' | 'moondream:1.8b' | 'openhermes' | 'openhermes:v2.5' | 'nemotron' | 'nemotron:70b' | 'nemotron-mini' | 'nemotron-mini:4b' | 'opencoder' | 'opencoder:1.5b' | 'opencoder:8b' | 'phi3' | 'phi3:3.8b' | 'phi3:14b' | 'phi3.5' | 'phi3.5:3.8b' | 'qwen' | 'qwen:7b' | 'qwen:14b' | 'qwen:32b' | 'qwen:72b' | 'qwen:110b' | 'qwen2' | 'qwen2:0.5b' | 'qwen2:1.5b' | 'qwen2:7b' | 'qwen2:72b' | 'qwen2.5' | 'qwen2.5:0.5b' | 'qwen2.5:1.5b' | 'qwen2.5:3b' | 'qwen2.5:7b' | 'qwen2.5:14b' | 'qwen2.5:32b' | 'qwen2.5:72b' | 'qwen2.5-coder' | 'qwen2.5-coder:0.5b' | 'qwen2.5-coder:1.5b' | 'qwen2.5-coder:3b' | 'qwen2.5-coder:7b' | 'qwen2.5-coder:14b' | 'qwen2.5-coder:32b' | 'qwq' | 'qwq:32b' | 'sailor2' | 'sailor2:1b' | 'sailor2:8b' | 'sailor2:20b' | 'shieldgemma' | 'shieldgemma:2b' | 'shieldgemma:9b' | 'shieldgemma:27b' | 'smollm' | 'smollm:135m' | 'smollm:360m' | 'smollm:1.7b' | 'tinyllama' | 'tinyllama:1.1b' | 'tulu3' | 'tulu3:8b' | 'tulu3:70b' | (string & NonNullable<unknown>); | ||
interface OllamaChatSettings { | ||
@@ -82,2 +82,8 @@ /** | ||
/** | ||
* Whether to use structured outputs. Defaults to false. | ||
* | ||
* When enabled, tool calls and object generation will be strict and follow the provided schema. | ||
*/ | ||
structuredOutputs?: boolean; | ||
/** | ||
* Tail free sampling is used to reduce the impact of less probable tokens from the output. A higher value (e.g., 2.0) | ||
@@ -105,3 +111,3 @@ * will reduce the impact more, while a value of 1.0 disables this setting. (default: 1) | ||
type OllamaEmbeddingModelId = 'all-minilm' | 'all-minilm:22m' | 'all-minilm:33m' | 'bge-large' | 'bge-m3' | 'mxbai-embed-large' | 'nomic-embed-text' | 'paraphrase-multilingual' | 'snowflake-arctic-embed' | 'snowflake-arctic-embed:110m' | 'snowflake-arctic-embed:137m' | 'snowflake-arctic-embed:22m' | 'snowflake-arctic-embed:335m' | 'snowflake-arctic-embed:33m' | OllamaChatModelId | (string & NonNullable<unknown>); | ||
type OllamaEmbeddingModelId = 'all-minilm' | 'all-minilm:22m' | 'all-minilm:33m' | 'bge-large' | 'bge-m3' | 'mxbai-embed-large' | 'nomic-embed-text' | 'paraphrase-multilingual' | 'snowflake-arctic-embed' | 'snowflake-arctic-embed:110m' | 'snowflake-arctic-embed:137m' | 'snowflake-arctic-embed:22m' | 'snowflake-arctic-embed:335m' | 'snowflake-arctic-embed:33m' | 'snowflake-arctic-embed2' | 'snowflake-arctic-embed2:568m' | OllamaChatModelId | (string & NonNullable<unknown>); | ||
interface OllamaEmbeddingSettings { | ||
@@ -108,0 +114,0 @@ maxEmbeddingsPerCall?: number; |
@@ -376,2 +376,6 @@ "use strict"; | ||
} | ||
get supportsStructuredOutputs() { | ||
var _a; | ||
return (_a = this.settings.structuredOutputs) != null ? _a : false; | ||
} | ||
get provider() { | ||
@@ -395,5 +399,5 @@ return this.config.provider; | ||
const warnings = []; | ||
if (responseFormat !== void 0 && responseFormat.type === "json" && responseFormat.schema !== void 0) { | ||
if (responseFormat !== void 0 && responseFormat.type === "json" && responseFormat.schema !== void 0 && !this.supportsStructuredOutputs) { | ||
warnings.push({ | ||
details: "JSON response format schema is not supported", | ||
details: "JSON response format schema is only supported with structuredOutputs", | ||
setting: "responseFormat", | ||
@@ -457,3 +461,3 @@ type: "unsupported-setting" | ||
...baseArguments, | ||
format: "json", | ||
format: this.supportsStructuredOutputs && mode.schema !== void 0 ? mode.schema : "json", | ||
messages: convertToOllamaChatMessages(prompt) | ||
@@ -460,0 +464,0 @@ }, |
{ | ||
"name": "ollama-ai-provider", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Vercel AI Provider for running LLMs locally using Ollama", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -6,2 +6,6 @@ # Ollama Provider for the Vercel AI SDK | ||
## Requirements | ||
This provider requires Ollama >= 0.5.0 | ||
## Setup | ||
@@ -8,0 +12,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152015
1629
41