Documentation Index
Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
Use this file to discover all available pages before exploring further.
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.
Together AI offers an API to query 50+ leading open-source models in a couple lines of code.
This will help you get started with Together AI text completion models (LLMs) using LangChain. For detailed documentation on TogetherAI features and configuration options, please refer to the API reference.
Overview
Integration details
| Class | Package | Local | Serializable | PY support | Downloads | Version |
|---|
TogetherAI | @langchain/together-ai | ❌ | ✅ | ✅ |  |  |
Setup
To access the legacy TogetherAI completions class, create a Together account, get an API key, and install the @langchain/together-ai integration package. For chat and instruct models, prefer ChatTogetherAI.
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:
export TOGETHER_AI_API_KEY="your-api-key"
If you want to get automated tracing of your model calls you can also set your LangSmith API key by uncommenting below:
# export LANGSMITH_TRACING="true"
# export LANGSMITH_API_KEY="your-api-key"
Installation
The LangChain TogetherAI integration lives in the @langchain/together-ai package:
npm install @langchain/together-ai @langchain/core
Instantiation
Instantiate the completions model:
import { TogetherAI } from "@langchain/together-ai";
const llm = new TogetherAI({
model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
maxTokens: 256,
});
Invocation
const inputText = "Together is an AI company that "
const completion = await llm.invoke(inputText)
completion
offers a range of AI-powered solutions to help businesses and organizations improve their customer service, sales, and marketing efforts. Their platform uses natural language processing (NLP) and machine learning algorithms to analyze customer interactions and provide insights and recommendations to help businesses improve their customer experience.
Together's solutions include:
1. Customer Service: Together's customer service solution uses AI to analyze customer interactions and provide insights and recommendations to help businesses improve their customer experience. This includes analyzing customer feedback, sentiment analysis, and predictive analytics to identify areas for improvement.
2. Sales: Together's sales solution uses AI to analyze customer interactions and provide insights and recommendations to help businesses improve their sales efforts. This includes analyzing customer behavior, sentiment analysis, and predictive analytics to identify opportunities for upselling and cross-selling.
3. Marketing: Together's marketing solution uses AI to analyze customer interactions and provide insights and recommendations to help businesses improve their marketing efforts. This includes analyzing customer behavior, sentiment analysis, and predictive analytics to identify areas for improvement.
Together's platform is designed to be easy to use and integrates with a range of popular CRM and marketing automation tools. Their solutions are available as a cloud-based subscription service, making it easy for businesses to get started with AI-powered customer service, sales, and marketing.
Overall,
API reference
For detailed documentation of all TogetherAI features and configurations head to the API reference.