Together AI Integration with Future AGI for LLM Tracing
Integrate Together AI with Future AGI observability. Trace inference calls to Together AI models using the traceAI-openai compatible package.
Trace Together AI calls made through the OpenAI client in Future AGI.
With traceAI-openai 0.1.11 or later, calls to https://api.together.ai/v1 are attributed to Together AI (gen_ai.provider.name=together). This guide uses the OpenAI client; it does not instrument an existing together.Together client.
1. Installation
Use Python 3.10–3.13 and install or upgrade both the traceAI OpenAI package and its tracing core. This also installs the OpenAI client. If you already use traceAI, upgrading both packages avoids retaining an incompatible older core.
pip install --upgrade "traceAI-openai>=0.1.11" "fi-instrumentation-otel>=1.2.2"
2. Set Environment Variables
Set your Together AI and Future AGI credentials.
import os
os.environ["TOGETHER_API_KEY"] = "your-together-api-key"
os.environ["FI_API_KEY"] = "your-futureagi-api-key"
os.environ["FI_SECRET_KEY"] = "your-futureagi-secret-key"
3. Initialize Trace Provider
Set up the trace provider to create a new project in FutureAGI, establish telemetry data pipelines.
from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType
trace_provider = register(
project_type=ProjectType.OBSERVE,
project_name="togetherai_project",
)
4. Instrument your Project
The OpenAI instrumentor can send request messages, responses and provider error details to Future AGI. To hide input and output values and messages, set FI_HIDE_INPUTS=true and FI_HIDE_OUTPUTS=true before initialization; see mask span attributes. These switches are not a general scrubber for custom attributes or all exception text. Keep secrets out of request data and error messages.
Instrument the OpenAI client before making Together AI calls.
from traceai_openai import OpenAIInstrumentor
OpenAIInstrumentor().instrument(tracer_provider=trace_provider)
5. Interact with Together AI
Create an OpenAI client pointed at Together AI and send a chat request.
import openai
client = openai.OpenAI(
api_key=os.environ.get("TOGETHER_API_KEY"),
base_url="https://api.together.ai/v1",
)
try:
response = client.chat.completions.create(
model="openai/gpt-oss-120b",
messages=[
{"role": "system", "content": "You are a travel agent. Be descriptive and helpful."},
{"role": "user", "content": "Tell me the top 3 things to do in San Francisco"},
],
)
print(response.choices[0].message.content)
finally:
trace_provider.shutdown()
In Future AGI, open the togetherai_project project to inspect the trace.
Troubleshooting
New traces still show openai as the provider: Upgrade both packages with the installation command above, restart your application, and check that the client uses https://api.together.ai/v1. The older api.together.xyz host is not recognized for Together attribution. Upgrading does not relabel previously exported traces.
Questions & Discussion