Skip to content

[bot] Add instrumentation for Together AI Go SDK (togethercomputer/together-go) #142

@braintrust-bot

Description

@braintrust-bot

Summary

The Braintrust Go SDK instruments OpenAI, Anthropic, Google GenAI, sashabaranov/go-openai, LangChainGo, Firebase Genkit, Google ADK, CloudWeGo Eino, and AWS Bedrock — but does not instrument the Together AI Go SDK (github.com/togethercomputer/together-go). Together AI is a major AI provider explicitly listed in Braintrust's tracing documentation as a supported provider, yet it has no SDK-level instrumentation wrapper in any Braintrust SDK.

What is missing

A trace/contrib/togethercomputer/together/ integration module that wraps execution calls on the Together AI Go client. The key execution surfaces are:

  • client.Chat.Completions.New() / client.Chat.Completions.NewStreaming() — conversational model inference (streaming and non-streaming), token usage returned in ChatCompletionUsage
  • client.Completions.New() — text completion (non-chat)
  • client.Embeddings.New() — vector embedding generation

The together-go SDK is generated with the same Stainless toolchain as openai-go and anthropic-sdk-go. It exposes option.WithMiddleware() for HTTP middleware injection, making it directly instrumentable with the same internal.Middleware(router, logger) pattern already used by the OpenAI and Anthropic integrations.

Braintrust docs status

supported — Braintrust explicitly lists Together AI as a supported provider for tracing:

"OpenAI, Anthropic, Gemini, AWS Bedrock, Azure, Mistral, Together, Groq, and many more"

Source: https://www.braintrust.dev/docs/guides/tracing and https://www.braintrust.dev/docs/instrument

However, there is no SDK-level tracing wrapper for the Together AI Go client in this repository.

Upstream sources

Braintrust docs sources

Local repo files inspected

  • go.mod — no togethercomputer/together-go dependency
  • trace/contrib/ — no togethercomputer/ or together/ directory exists
  • trace/contrib/all/all.go — no Together AI import
  • examples/ — no Together AI example
  • trace/contrib/openai/traceopenai.go — reference pattern: internal.Middleware(router, logger) with option.WithMiddleware() injection; same pattern applies to together-go
  • trace/contrib/anthropic/traceanthropic.go — reference pattern for Stainless-generated SDK middleware instrumentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions