Together and AsyncTogether chat completions clients can be instrumented using the openinference-instrumentation-together package, which traces calls as OpenInference LLM spans.
This integration requires
together >= 2.0.0.Install
Setup
Set theTOGETHER_API_KEY environment variable to authenticate calls made using the SDK.
register function:
auto_instrument=True picks up the installed openinference-instrumentation-together package automatically. To instrument explicitly instead, call TogetherInstrumentor().instrument(tracer_provider=tracer_provider).
Run Together AI
A simple chat completion that is now instrumented:Streaming
Whenstream=True, the span stays open until the stream is fully consumed, then records the accumulated output, tool calls, and token counts from the chunks.
Tool calls
Tools passed on the request (llm.tools.*) and any tool calls returned on the response (message.tool_calls.*) are captured on the span.

