Skip to content

Commit 8ccad15

Browse files
committed
add deprecation notices
1 parent e465a0e commit 8ccad15

3 files changed

Lines changed: 74 additions & 2 deletions

File tree

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,21 @@
44
</a>
55
</div>
66

7-
# Together Python API library
7+
> [!CAUTION]
8+
> ## ⚠️ DEPRECATION NOTICE
9+
>
10+
> **This package (`together`) is deprecated and will no longer be maintained after January 2026.**
11+
>
12+
> Please migrate to the new SDK: **[together-ai](https://github.com/togethercomputer/together-py)**
13+
>
14+
> 📖 **Migration Guide:** [https://docs.together.ai/docs/pythonv2-migration-guide](https://docs.together.ai/docs/pythonv2-migration-guide)
15+
>
16+
> ```bash
17+
> pip uninstall together
18+
> pip install together-ai
19+
> ```
20+
21+
# Together Python API library (DEPRECATED)
822
923
[![PyPI version](https://img.shields.io/pypi/v/together.svg)](https://pypi.org/project/together/)
1024
[![Discord](https://dcbadge.limes.pink/api/server/https://discord.gg/9Rk6sSeWEG?style=flat&theme=discord-inverted)](https://discord.com/invite/9Rk6sSeWEG)

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ build-backend = "poetry.masonry.api"
1414
name = "together"
1515
version = "1.5.31"
1616
authors = ["Together AI <support@together.ai>"]
17-
description = "Python client for Together's Cloud Platform!"
17+
description = "[DEPRECATED - Use together-py instead] Python client for Together's Cloud Platform. See https://github.com/togethercomputer/together-py for the new SDK."
1818
readme = "README.md"
1919
license = "Apache-2.0"
2020
classifiers = [
21+
"Development Status :: 7 - Inactive",
2122
"Programming Language :: Python :: 3",
2223
"License :: OSI Approved :: Apache Software License",
2324
"Operating System :: POSIX :: Linux",

src/together/__init__.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
11
from __future__ import annotations
22

3+
import os
4+
import sys
5+
import warnings
6+
7+
# =============================================================================
8+
# DEPRECATION NOTICE
9+
# =============================================================================
10+
_DEPRECATION_MESSAGE = """
11+
================================================================================
12+
DEPRECATION WARNING: The 'together' package is deprecated and will no longer
13+
be maintained after January 2026.
14+
15+
Please migrate to the new SDK: https://github.com/togethercomputer/together-py
16+
17+
Migration guide: https://docs.together.ai/docs/pythonv2-migration-guide
18+
================================================================================
19+
"""
20+
21+
# Show deprecation warning (visible to developers with warnings enabled)
22+
warnings.warn(
23+
"The 'together' package is deprecated and will no longer be maintained after "
24+
"January 2026. Please migrate to the new SDK: "
25+
"https://github.com/togethercomputer/together-py "
26+
"Migration guide: https://docs.together.ai/docs/pythonv2-migration-guide",
27+
DeprecationWarning,
28+
stacklevel=2,
29+
)
30+
31+
# Also print a visible notice to stderr (unless suppressed)
32+
if not os.environ.get("TOGETHER_SUPPRESS_DEPRECATION_WARNING"):
33+
try:
34+
from rich.console import Console
35+
from rich.panel import Panel
36+
37+
console = Console(stderr=True)
38+
console.print(
39+
Panel(
40+
"[bold yellow]DEPRECATION WARNING[/bold yellow]\n\n"
41+
"The [cyan]together[/cyan] package is deprecated and will no longer "
42+
"be maintained after [bold]January 2026[/bold].\n\n"
43+
"Please migrate to the new SDK:\n"
44+
"[link=https://github.com/togethercomputer/together-py]"
45+
"https://github.com/togethercomputer/together-py[/link]\n\n"
46+
"Migration guide:\n"
47+
"[link=https://docs.together.ai/docs/pythonv2-migration-guide]"
48+
"https://docs.together.ai/docs/pythonv2-migration-guide[/link]\n\n"
49+
"[dim]Set TOGETHER_SUPPRESS_DEPRECATION_WARNING=1 to hide this message.[/dim]",
50+
title="⚠️ Deprecation Notice",
51+
border_style="yellow",
52+
)
53+
)
54+
except ImportError:
55+
# Fallback if rich is not available
56+
print(_DEPRECATION_MESSAGE, file=sys.stderr)
57+
58+
# =============================================================================
59+
360
from contextvars import ContextVar
461
from typing import TYPE_CHECKING, Callable
562

0 commit comments

Comments
 (0)