Skip to main content
Together AI offers an API to query 50+ leading open-source models in a couple lines of code. This guide will help you getting started with ChatTogetherAI chat models. For detailed documentation of all ChatTogetherAI features and configurations head to the API reference.

Overview

Integration details

Model features

See the links in the table headers below for guides on how to use specific features.

Setup

To access ChatTogetherAI models, create a Together account, get an API key, and install the @langchain/together-ai integration package.

Credentials

Head to api.together.ai to sign up to Together AI and generate an API key. Set the TOGETHER_AI_API_KEY environment variable:
If you want to get automated tracing of your model calls you can also set your LangSmith API key by uncommenting below:

Installation

The LangChain ChatTogetherAI integration lives in the @langchain/together-ai package:

Instantiation

Now we can instantiate our model object and generate chat completions:

Invocation


API reference

For detailed documentation of all ChatTogetherAI features and configurations head to the API reference.