Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Environment:Togethercomputer Together python Python SDK Runtime

From Leeroopedia
Revision as of 18:32, 16 February 2026 by Admin (talk | contribs) (Auto-imported from environments/Togethercomputer_Together_python_Python_SDK_Runtime.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Infrastructure, SDK
Last Updated 2026-02-15 16:00 GMT

Overview

Python 3.10+ environment with core dependencies for the Together AI Python SDK (v1.5.35, deprecated in favor of v2.0).

Description

This environment defines the runtime requirements for the Together AI Python SDK. The SDK is an HTTP client that communicates with the Together AI platform API. It requires Python 3.10 or higher and a set of core dependencies for HTTP transport (requests, aiohttp), data validation (pydantic), CLI tooling (typer, click, rich), and data handling (numpy, pillow). PyArrow is an optional dependency required only when working with Parquet-format datasets.

Note: This SDK (v1) is deprecated. The successor is the Together Python SDK 2.0 at `together-py`. V1 remains in maintenance mode.

Usage

Use this environment for any workflow that interacts with the Together AI platform via the Python SDK, including Chat Completion, Fine-Tuning, Batch Inference, Image Generation, and Embeddings/Reranking.

System Requirements

Category Requirement Notes
OS Linux (POSIX) Classified as `Operating System :: POSIX :: Linux` in package metadata
Python >= 3.10 `python = "^3.10"` in pyproject.toml
Network HTTPS outbound to `api.together.xyz` Default base URL; configurable via `TOGETHER_BASE_URL`
Disk Minimal (SDK install ~50MB) PyArrow adds ~80MB if installed

Dependencies

System Packages

No system-level packages required beyond a standard Python installation.

Python Packages (Core)

  • `requests` ^2.31.0
  • `aiohttp` ^3.9.3
  • `pydantic` ^2.6.3
  • `typer` >=0.9,<0.20
  • `click` ^8.1.7
  • `rich` >=13.8.1,<15.0.0
  • `tqdm` ^4.66.2
  • `tabulate` ^0.9.0
  • `filelock` ^3.13.1
  • `eval-type-backport` >=0.1.3,<0.3.0
  • `numpy` >=1.23.5 (Python <3.12) or >=1.26.0 (Python >=3.12)
  • `pillow` ^11.1.0
  • `black` ^25.9.0

Python Packages (Optional)

  • `pyarrow` >=10.0.1 — Required for Parquet file support; install via `pip install together[pyarrow]`

Python Packages (Examples)

  • `datasets` >=2.18,<5.0 — For dataset loading in examples
  • `transformers` ^4.39.3 — For tokenization in examples

Credentials

See Environment:Togethercomputer_Together_python_API_Credentials for credential requirements.

Quick Install

# Install core SDK
pip install together==1.5.35

# With Parquet support
pip install "together[pyarrow]==1.5.35"

# For running examples (tokenization)
pip install datasets transformers

Code Evidence

Python version constraint from `pyproject.toml:29`:

[tool.poetry.dependencies]
python = "^3.10"

NumPy version split by Python version from `pyproject.toml:41-44`:

numpy = [
    { version = ">=1.23.5", python = "<3.12" },
    { version = ">=1.26.0", python = ">=3.12" },
]

PyArrow optional import guard from `src/together/utils/files.py:767-773`:

try:
    # Pyarrow is optional as it's large (~80MB) and isn't compatible with older systems.
    from pyarrow import ArrowInvalid, parquet
except ImportError:
    raise ImportError(
        "pyarrow is not installed and is required to use parquet files. "
        "Please install it via `pip install together[pyarrow]`"
    )

SDK deprecation banner from `src/together/__init__.py:18`:

Together V1 is now deprecated and will be maintained in maintanence mode.
All new features and development will occur in the 2.0 SDK.

Common Errors

Error Message Cause Solution
`ImportError: pyarrow is not installed and is required to use parquet files` PyArrow not installed `pip install together[pyarrow]`
`ModuleNotFoundError: No module named 'together'` SDK not installed `pip install together`
SDK 2.0 deprecation banner on import V1 is deprecated Set `TOGETHER_NO_BANNER=1` to suppress, or migrate to `together-py` v2.0

Compatibility Notes

  • Deprecated SDK: This is SDK v1, now in maintenance mode. New features are in the v2.0 SDK (`together-py`).
  • Banner Suppression: Set `TOGETHER_NO_BANNER` environment variable to suppress the deprecation banner on import.
  • NumPy Split: Python 3.12+ requires NumPy >= 1.26.0 due to C API changes.
  • PyArrow Size: PyArrow adds ~80MB and may not be compatible with older systems; it is deliberately optional.
  • Google Colab: The SDK auto-detects Google Colab and can retrieve `TOGETHER_API_KEY` from Colab notebook secrets.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment