Skip to content

[BOT ISSUE] Cohere TypeScript SDK (cohere-ai) not instrumented — no tracing for direct Cohere chat, embed, or rerank calls #1740

@braintrust-bot

Description

@braintrust-bot

Summary

The Cohere TypeScript SDK (cohere-ai) provides execution APIs for chat completions, embeddings, and reranking with a unique, non-OpenAI-compatible interface. This repository has zero instrumentation for any Cohere SDK surface — no wrapper, no channels, no plugin, no auto-instrumentation config. Users who call the Cohere SDK directly get no Braintrust spans.

What instrumentation is missing

The cohere-ai npm package (~270K–370K weekly downloads) exposes these execution surfaces, none of which are instrumented:

SDK Method Description
client.chat() Text generation / chat completions
client.chatStream() Streaming chat completions
client.embed() Text and image embeddings
client.rerank() Reranking documents by relevance

The Cohere API is not OpenAI-compatible — it has its own request/response schemas, tool-calling format, citation/grounding system, and streaming protocol. Users cannot use wrapOpenAI() with a Cohere base URL.

No coverage in any instrumentation layer:

  • No wrapper function (e.g. wrapCohere())
  • No diagnostics channels for Cohere methods
  • No plugin handler in js/src/instrumentation/plugins/
  • No auto-instrumentation config in js/src/auto-instrumentations/configs/
  • No vendor SDK types in js/src/vendor-sdk-types/
  • No e2e test scenarios

A grep for cohere (case-insensitive) across js/src/ returns zero matches. The only references in the repo are @ai-sdk/cohere in an example project's package.json, which is a Vercel AI SDK provider adapter — not direct Cohere SDK instrumentation.

Indirect coverage exists but is limited:

Users can access Cohere models through the Vercel AI SDK (@ai-sdk/cohere) or LangChain (@langchain/cohere), both of which are instrumented. However, users who use the official cohere-ai SDK directly — which is the primary SDK documented by Cohere — get no tracing.

Context

This repo instruments 7 other AI provider SDKs directly: OpenAI, Anthropic, Google GenAI, Mistral, OpenRouter, Vercel AI SDK, and Claude Agent SDK. Cohere is a comparable provider with a stable, actively maintained official TypeScript SDK and a unique API surface.

Braintrust docs status

not_found — Cohere is not mentioned on the Braintrust tracing docs at https://www.braintrust.dev/docs/guides/tracing or the wrap-providers page at https://www.braintrust.dev/docs/instrument/wrap-providers.

Upstream references

Local files inspected

  • js/src/wrappers/ — no Cohere wrapper
  • js/src/instrumentation/plugins/ — no Cohere channels or plugin
  • js/src/auto-instrumentations/configs/ — no Cohere config
  • js/src/vendor-sdk-types/ — no Cohere types
  • e2e/scenarios/ — no Cohere test scenarios
  • js/examples/ai-sdk/next-openai-app/package.json — only reference is @ai-sdk/cohere (AI SDK adapter, not direct SDK)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions