venice-ai-sdk-provider
v1.1.17
Published
Venice AI provider for the Vercel AI SDK
Maintainers
Readme
Venice Provider for Vercel AI SDK
The Venice provider for the Vercel AI SDK gives access to uncensored, private AI models on the Venice API. Venice offers OpenAI-compatible endpoints with zero data retention and access to models like DeepSeek R1, Llama 3.1, Qwen, and more.
Setup
# For pnpm
pnpm add venice-ai-sdk-provider
# For npm
npm install venice-ai-sdk-provider
# For yarn
yarn add venice-ai-sdk-providerProvider Instance
You can import the default provider instance venice from venice-ai-sdk-provider if you have set VENICE_API_KEY environment variable:
import { venice } from 'venice-ai-sdk-provider';
const model = venice("venice-uncensored");Or instance it manually:
import { createVenice } from 'venice-ai-sdk-provider';
const venice = createVenice({ apiKey: "your-api-key" });
const model = venice("venice-uncensored");Example
import { venice } from 'venice-ai-sdk-provider';
import { generateText } from 'ai';
const { text } = await generateText({
model: venice('venice-uncensored'),
prompt: 'Write a vegetarian lasagna recipe for 4 people.',
});Supported models
This list is not definitive. Venice regularly adds new models to their system. You can find the latest list of models here.
Venice-Specific Features
Web Search
Enable real-time web search with citations on all Venice text models:
import { venice } from 'venice-ai-sdk-provider';
import { generateText } from 'ai';
const { text } = await generateText({
model: venice('venice-uncensored'),
prompt: 'What are the latest developments in AI?',
providerOptions: {
venice: {
veniceParameters: {
enableWebSearch: 'auto',
},
},
},
});Reasoning Mode
Enable advanced step-by-step reasoning with visible thinking process:
import { venice } from 'venice-ai-sdk-provider';
import { generateText } from 'ai';
const { text } = await generateText({
model: venice('qwen3-235b-a22b-thinking-2507'),
prompt: 'Solve: If x + 2y = 10 and 3x - y = 5, what are x and y?',
providerOptions: {
venice: {
veniceParameters: {
stripThinkingResponse: false,
},
},
},
});Reasoning Effort
Control the depth of reasoning for models that support it:
import { venice } from 'venice-ai-sdk-provider';
import { generateText } from 'ai';
const { text } = await generateText({
model: venice('gemini-3-pro-preview'),
prompt: 'Prove that there are infinitely many primes',
providerOptions: {
venice: {
reasoningEffort: 'high',
},
},
});Options: low (fast, minimal thinking), medium (default, balanced), high (deep thinking, best for complex problems).
Tool Calling
Venice supports function calling on compatible models:
import { venice } from 'venice-ai-sdk-provider';
import { generateText } from 'ai';
const { text } = await generateText({
model: venice('qwen3-next-80b),
tools: {
get_weather: {
description: 'Get current weather for a location',
parameters: z.object({
location: z.string().describe('City name'),
}),
execute: async ({ location }) => {
return { temperature: 72, condition: 'sunny' };
},
},
},
prompt: 'What is the weather like in New York?',
});Vision
Process images with vision-compatible models. Venice supports two ways to provide images:
Option 1: Using image URL
import { venice } from 'venice-ai-sdk-provider';
import { generateText } from 'ai';
const { text } = await generateText({
model: venice('mistral-31-24b'),
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'What do you see in this image?' },
{
type: 'image_url',
image_url: { url: 'https://example.com/image.jpg' },
},
],
},
],
});Option 2: Using image data (base64)
import { venice } from 'venice-ai-sdk-provider';
import { generateText } from 'ai';
import { readFile } from 'fs/promises';
const imageBuffer = await readFile('path/to/image.jpg');
const imageBase64 = imageBuffer.toString('base64');
const { text } = await generateText({
model: venice('mistral-31-24b'),
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'What do you see in this image?' },
{
type: 'image_url',
image_url: { url: `data:image/jpeg;base64,${imageBase64}` },
},
],
},
],
});Note: Use vision-capable models like mistral-31-24b for image analysis.
Embeddings
Venice supports embedding models for semantic search and RAG pipelines:
import { embed } from 'ai';
import { venice } from 'venice-ai-sdk-provider';
const { embedding } = await embed({
model: venice.textEmbeddingModel('text-embedding-bge-m3'),
value: 'sunny day at the beach',
});
console.log(embedding);API Key Configuration
Set your Venice API key as an environment variable:
export VENICE_API_KEY=your-api-key-hereOr pass it directly when creating a provider instance:
import { createVenice } from 'venice-ai-sdk-provider';
const venice = createVenice({ apiKey: 'your-api-key' });