Deep Infra
Deep Infra is a platform that provides scalable and cost-effective infrastructure for deploying and managing machine learning models, particularly large language models (LLMs) and other AI workloads. It aims to simplify the process of serving AI models at scale by offering optimized infrastructure, reducing latency, and lowering costs compared to traditional cloud providers.
This integration provides easy access to Deep Infra's large assortment of AI models . It allows you manage your Deep Infra API tokens directly from Vercel and export them to your projects.
Start by connecting to your existing project and then run vercel link in the CLI to link to the project locally.
Run vercel env pull to make the latest environment variables available to your project locally. If you have connected the integration with the project correctly, DEEPINFRA_API_KEY should be present in your environment variables.
Each Deep Infra api token exports DEEPINFRA_API_KEY environment variable that you can connect to your Vercel projects.
import { streamText } from 'ai';import { deepinfra } from '@ai-sdk/deepinfra';
async function main() { const result = streamText({ model: deepinfra('meta-llama/Meta-Llama-3.1-70B-Instruct'), prompt: 'Write a vegetarian lasagna recipe for 4 people.', });
for await (const textPart of result.textStream) { process.stdout.write(textPart); }}
main().catch(console.error);