2023-12-20 02:48:32 +00:00
# langchain-together
2024-03-29 00:02:32 +00:00
2024-05-07 00:47:06 +00:00
This package contains the LangChain integrations for [Together AI ](https://www.together.ai/ ) through their [APIs ](https://docs.together.ai/ ).
2024-03-29 00:02:32 +00:00
2024-05-07 00:47:06 +00:00
## Installation and Setup
2024-03-29 00:02:32 +00:00
2024-05-07 00:47:06 +00:00
- Install the LangChain partner package
```bash
2024-03-29 00:02:32 +00:00
pip install -U langchain-together
```
2024-05-07 00:47:06 +00:00
- Get your Together AI api key from the [Together Dashboard ](https://api.together.ai/settings/api-keys ) and set it as an environment variable (`TOGETHER_API_KEY`)
2024-03-29 00:02:32 +00:00
2024-05-07 00:47:06 +00:00
## Chat Completions
2024-03-29 00:02:32 +00:00
2024-05-07 00:47:06 +00:00
This package contains the `ChatTogether` class, which is the recommended way to interface with Together AI chat models.
2024-03-29 00:02:32 +00:00
2024-05-07 00:47:06 +00:00
ADD USAGE EXAMPLE HERE.
Can we add this in the langchain docs?
2024-03-29 00:02:32 +00:00
2024-05-07 00:47:06 +00:00
NEED to add image endpoint + completions endpoint as well
2024-03-29 00:02:32 +00:00
2024-05-07 00:47:06 +00:00
## Embeddings
2024-03-29 00:02:32 +00:00
2024-05-07 00:47:06 +00:00
See a [usage example ](https://python.langchain.com/docs/integrations/text_embedding/together/ )
2024-03-29 00:02:32 +00:00
2024-05-07 00:47:06 +00:00
Use `togethercomputer/m2-bert-80M-8k-retrieval` as the default model for embeddings.