skillfed

langchain-together

An integration package connecting Together AI and LangChain

langchain-together v0.4.0 96.0K downloads/30d#13,241 on PyPI5
Permissive license MIT Active released

What it is and what it does

langchain-together is a LangChain integration package that exposes Together AI's language models and embeddings through LangChain's standard interfaces. It provides ChatTogether for chat-based interactions and TogetherEmbeddings for vector representations, supporting models like Qwen/Qwen2.5-7B-Instruct-Turbo and multilingual-e5-large-instruct.

The package enables structured outputs via Pydantic models, JSON schemas, and function calling—allowing you to extract reliable, typed responses from Together AI models within LangChain workflows. It handles authentication via environment variable or constructor parameter and supports configuration options like temperature, max_tokens, timeout, and retry behavior.

Use it for:

  • Build LangChain agents and chains that call Together AI models instead of OpenAI or other providers.
  • Extract structured data (e.g., parsed JSON, function calls) from Together AI models using Pydantic schemas.
  • Generate embeddings for semantic search or similarity tasks using Together's multilingual embedding models.
  • Prototype or deploy cost-effective LLM applications by swapping Together AI as the backend provider.
  • Combine Together AI models with LangChain's tools, memory, and retrieval systems in a single application.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Connects LangChain applications to Together AI's language models and embeddings via a unified integration layer.

Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and integrates seamlessly with LangChain's ecosystem. It is worth installing if you need Together AI as your LLM provider and want to work within LangChain's abstractions. No known security vulnerabilities as of 2026-08-14.

Install

langchain-together on PyPI

pip

pip install langchain-together

uv

uv add langchain-together

poetry

poetry add langchain-together

Installing langchain-together

Before you install

Low friction installation with a wheel distribution. Actively maintained as of 2026-08-05 with recent releases. Depends on established packages (langchain-core, langchain-openai, requests, aiohttp) that are widely used.

License in practice

MIT license permits commercial and private use with minimal restrictions; you must retain the license notice in distributions.

Quickstart

pip install langchain-together

from langchain_together import ChatTogether
import os

os.environ["TOGETHER_API_KEY"] = "your-key"
llm = ChatTogether(model="Qwen/Qwen2.5-7B-Instruct-Turbo")
response = llm.invoke("Hello")

Requires a valid Together AI API key set in the TOGETHER_API_KEY environment variable or passed to the constructor.

Verify before relying

  • Whether all Together AI model variants listed in their docs are supported by this integration version.
  • Performance characteristics and rate-limit behavior when used with high-volume LangChain chains.
  • Compatibility guarantees with specific langchain-core versions beyond the stated Python version range.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 7 — aiohttp, h11, langchain-core, langchain-openai, langsmith, requests, urllib3
Maintenance actively maintained — 143 days since the last release
Last repo commit
First released
Downloads 95,965/month — #13,241 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: langchain_together-0.4.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13

Tags

langchain together ai integrationtogether ai llm providerlangchain chat modelsstructured output llmtogether embeddings langchainfunction calling llmjson mode language model
llm-integrationlangchain-pluginstructured-output

More Artificial Intelligence packages

Further reading