You are currently on a page documenting the use of Together AI models as text completion models. Many popular models available on Together AI are chat completion models.You may be looking for this page instead.
TogetherAI features and configuration options, please refer to the API reference.
Overview
Integration details
| Class | Package | Local | Serializable | PY support | Downloads | Version |
|---|---|---|---|---|---|---|
TogetherAI | @langchain/community | ❌ | ✅ | ✅ |
Setup
To accessChatTogetherAI models you’ll need to create a Together account, get an API key here, and install the @langchain/community integration package.
Credentials
Head to api.together.ai to sign up to TogetherAI and generate an API key. Once you’ve done this set theTOGETHER_AI_API_KEY environment variable:
Installation
The LangChain TogetherAI integration lives in the@langchain/community package:
Instantiation
Now we can instantiate our model object and generate chat completions:Invocation
API reference
For detailed documentation of allTogetherAi features and configurations head to the API reference.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.