npm.io
3.0.96 • Published 2d ago

@ai-sdk/deepinfra

Licence
Apache-2.0
Version
3.0.96
Deps
0
Vulns
0
Weekly
0
Stars
27.1K

AI SDK - DeepInfra Provider

The DeepInfra provider for the AI SDK contains language model support for the DeepInfra API, giving you access to models like Llama 3, Mixtral, and other state-of-the-art LLMs.

Deploying to Vercel? With Vercel's AI Gateway you can access DeepInfra (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. Get started with AI Gateway.

Setup

npm i ai @ai-sdk/deepinfra

Skill for Coding Agents

If you use coding agents such as Claude Code or Cursor, we highly recommend adding the AI SDK skill to your repository:

npx skills add vercel/ai

Usage

import { deepinfra } from '@ai-sdk/deepinfra';
import { generateText } from 'ai';

const { text } = await generateText({
  model: deepinfra('meta-llama/Llama-3.3-70B-Instruct'),
  prompt: 'Write a vegetarian lasagna recipe for 4 people.',
});

See the DeepInfra Provider documentation for more information.

Keywords