1 min read

Vercel Replicate IntegrationMarketplace

Learn how to integrate Replicate with Vercel.
Table of Contents

Replicate provides a platform for accessing and deploying a wide range of open-source artificial intelligence models. These models span various AI applications such as image and video processing, natural language processing, and audio synthesis. With the Vercel Replicate integration, you can incorporate these AI capabilities into your applications, enabling advanced functionalities and enhancing user experiences.

You can use the Vercel and Replicate integration to power a variety of AI applications, including:

  • Content generation: Use Replicate for generating text, images, and audio content in creative and marketing applications
  • Image and video processing: Use Replicate in applications for image enhancement, style transfer, or object detection
  • NLP and chat-bots: Use Replicate's language processing models in chat-bots and natural language interfaces

Replicate models cover a broad spectrum of AI applications ranging from image and video processing to natural language processing and audio synthesis.

Incredibly Fast Whisper

Type: Audio

whisper-large-v3, incredibly fast, powered by Hugging Face Transformers


Type: Chat

BAAI's bge-en-large-v1.5 for embedding text sequences


Type: Image

A large language model that answers questions about images


Type: Image

Practical face restoration algorithm for old photos or AI-generated faces

Insanely Fast Whisper

Type: Audio

whisper-large-v3, insanely fast, powered by Hugging Face Transformers


Type: Chat

A 70 billion parameter language model from Meta, fine tuned for chat completions

LLaVA v1.5: Large Language and Vision Assistant

Type: Image

Visual instruction tuning towards large language and vision models with GPT-4 level capabilities


Type: Chat

A pretrained generative Sparse Mixture of Experts tuned to be a helpful assistant.


Type: Audio

Generate music from a prompt or melody


Type: Audio

Coqui XTTS-v2: Multilingual Text To Speech Voice Cloning


Type: Image

A text-to-image generative AI model that creates beautiful images

The Vercel Replicate integration can be accessed through the AI tab on your Vercel dashboard.

To follow this guide, you'll need the following:

  1. Navigate to the AI tab in your Vercel dashboard
  2. Select Replicate from the list of providers, and press Add
  3. Review the provider information, and press Add Provider
  4. You can now select which projects the provider will have access to. You can choose from All Projects or Specific Projects
    • If you select Specific Projects, you'll be prompted to select the projects you want to connect to the provider. The list will display projects associated with your scoped team
    • Multiple projects can be selected during this step
  5. Select the Connect to Project button
  6. You'll be redirected to the provider's website to complete the connection process
  7. Once the connection is complete, you'll be redirected back to the Vercel dashboard, and the provider integration dashboard page. From here you can manage your provider settings, view usage, and more
  8. Pull the environment variables into your project using Vercel CLI
    vercel env pull .env.development.local
  9. Install the providers package
    pnpm i replicate ai
  10. Connect your project using the code below:
    Next.js (/app)
    Next.js (/pages)
    Other frameworks
    // app/api/chat/route.ts
    import { ReplicateStream, StreamingTextResponse } from 'ai';
    import Replicate from 'replicate';
    import { experimental_buildLlama2Prompt } from 'ai/prompts';
    const replicate = new Replicate({
    auth: process.env.REPLICATE_API_KEY || '',
    export const runtime = 'edge';
    export async function POST(req: Request) {
    const { messages } = await req.json();
    const response = await replicate.predictions.create({
    stream: true,
    version: '2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1',
    input: {
    prompt: experimental_buildLlama2Prompt(messages),
    const stream = await ReplicateStream(response);
    return new StreamingTextResponse(stream);
  1. Add the provider to your page using the code below:
    Next.js (/app)
    Next.js (/pages)
    // app/chat/page.tsx
    'use client';
    import { useChat } from 'ai/react';
    export default function Chat() {
    const { messages, input, handleInputChange, handleSubmit } = useChat();
    return (
    { => (
    <div key={}>
    {m.role === 'user' ? 'User: ' : 'AI: '}
    <form onSubmit={handleSubmit}>
    placeholder="Say something..."

You can deploy a template to Vercel that uses a pre-trained model from Replicate:

Last updated on February 22, 2024