OpenInference Together AI Instrumentation
Python auto-instrumentation library for the Together AI Python client.
Chat completion calls made with the together client (Together and AsyncTogether) are traced and exported as OpenInference LLM spans, capturing the input messages, output messages, invocation parameters, tool calls, streaming output, and token counts.
These traces are fully OpenTelemetry compatible and can be sent to an OpenTelemetry collector for viewing, such as Arize Phoenix or Arize AX.
Supported Features
- Synchronous and asynchronous chat completions (
TogetherandAsyncTogether) - Streaming (
stream=True): the span stays open until the stream is consumed, and the accumulated output, tool calls, and token counts are recorded from the streamed chunks - Tool calls, captured on both requests and responses
- Suppressing tracing via
suppress_tracing() - Context attribute propagation (
using_session,using_user,using_attributes, metadata, tags) - Sensitive-data masking via
TraceConfig(e.g.hide_inputs)
Requires together >= 2.0.0.
Installation
pip install openinference-instrumentation-together
PyPI package: openinference-instrumentation-together
Quickstart
pip install openinference-instrumentation-together together arize-phoenix opentelemetry-sdk opentelemetry-exporter-otlp
Start Phoenix as a collector (default http://localhost:6006), then:
from openinference.instrumentation.together import TogetherInstrumentor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
endpoint = "http://127.0.0.1:6006/v1/traces"
tracer_provider = TracerProvider()
tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint)))
TogetherInstrumentor().instrument(tracer_provider=tracer_provider)
Run a chat completion. Set the TOGETHER_API_KEY environment variable with your key.
from together import Together
client = Together()
response = client.chat.completions.create(
model="meta-llama/Llama-3.3-70B-Instruct-Turbo",
messages=[{"role": "user", "content": "Why is the sky blue?"}],
)
print(response.choices[0].message.content)
Streaming works the same way — the span is finished when the stream is exhausted:
stream = client.chat.completions.create(
model="meta-llama/Llama-3.3-70B-Instruct-Turbo",
messages=[{"role": "user", "content": "Write a haiku about observability."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Runnable examples — including async usage, streaming with a reasoning model, and tool calls — are in the examples/ directory.
More Info
Release files for openinference-instrumentation-together 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openinference_instrumentation_together-0.1.6.tar.gz | 13.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openinference_instrumentation_together-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.0 kB
Release files / openinference_instrumentation_together-0.1.6.tar.gz
| Download URL | openinference_instrumentation_together-0.1.6.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ecebe555011db297ad3f2c0c8ab047960d28a13f4e7d46be2ab9175a892f22d9
|
|
BLAKE2b-256 checksum How to use checksums |
ecb81eeb3f8c08f06792526a5757eee749f9ad7501534f4f28f450829b389f93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.
Transparency logRelease files / openinference_instrumentation_together-0.1.6-py3-none-any.whl
| Download URL | openinference_instrumentation_together-0.1.6-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
960666830b71f2a225f16226eb72c5f7cb6c56363dbe1a308df7991e4bb07dab
|
|
BLAKE2b-256 checksum How to use checksums |
c222c2be8a495333840fc096279ff16ddb23301d44a57af5ca7d66905efbb5ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.
Transparency log