Skip to content

[bot] Add instrumentation for Azure.AI.Inference (Azure AI Foundry model inference) #66

Description

@braintrust-bot

Summary

The Azure.AI.Inference NuGet package (v1.0.0-beta.5, ~2.4M total downloads, updated 2025-05-14) is the official Microsoft client library for performing inference against AI models deployed through Azure AI Foundry and Azure Machine Learning Studio. It is distinct from the already-instrumented Azure.AI.OpenAI package: Azure.AI.Inference targets the Azure AI Model Inference API and supports any catalog model (LLaMA, Mistral, Phi, Cohere, etc.) via Serverless API and Managed Compute endpoints — not just OpenAI models. None of its execution surfaces are instrumented in this SDK.

Execution surfaces missing instrumentation

  • Chat completions: ChatCompletionsClient.CompleteAsync — invoke any Azure AI Foundry-deployed model for chat
  • Streaming chat completions: ChatCompletionsClient.CompleteStreamingAsync — streaming responses via StreamingResponse<StreamingChatCompletionsUpdate>
  • Text embeddings: EmbeddingsClient.EmbedAsync — generate vector embeddings from text via the /embeddings route
  • Tool/function calling: ChatCompletionsOptions.Tools — function declarations and automatic function calling within Complete/CompleteAsync
  • Model info: ChatCompletionsClient.GetModelInfoAsync — retrieve deployed model metadata (name, type, provider)

Braintrust docs status

  • Status: not_found — The Braintrust Azure AI Foundry integration page describes only server-side proxy configuration and has no C#/.NET SDK-level instrumentation guidance
  • The Braintrust integrations directory lists Azure AI Foundry as an AI provider but with no Azure.AI.Inference-specific instrumentation
  • No C#-specific Azure.AI.Inference instrumentation is referenced anywhere in Braintrust docs

Upstream sources

Local repo files inspected

  • src/Braintrust.Sdk.OpenAI/ — instruments OpenAI SDK only
  • src/Braintrust.Sdk.AzureOpenAI/ — instruments Azure.AI.OpenAI only (different package and API surface)
  • src/Braintrust.Sdk.Anthropic/ — instruments Anthropic SDK only
  • src/Braintrust.Sdk.AgentFramework/ — instruments Microsoft.Extensions.AI.IChatClient middleware only
  • Grep for Azure.AI.Inference, ChatCompletionsClient, and EmbeddingsClient across the entire repo returned zero results

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions