Skip to main content
The Vercel AI SDK is a powerful Typescript library designed to help developers build AI-powered applications. Using Together AI and the Vercel AI SDK, you can easily integrate AI into your TypeScript, React, or Next.js project. In this tutorial, we’ll look into how easy it is to use Together AI’s models and the Vercel AI SDK.

QuickStart: 15 lines of code

  1. Install both the Vercel AI SDK and OpenAI’s Vercel package.
  1. Instantiate the Together client and call the generateText function with Llama 3.1 8B to generate some text.
TypeScript

Output

Streaming with the Vercel AI SDK

To stream from Together AI models using the Vercel AI SDK, simply use streamText as seen below.
TypeScript

Output