Skip to content

[bot] HuggingFace Inference textToImage() not instrumented #1877

@braintrust-bot

Description

@braintrust-bot

Summary

The @huggingface/inference SDK provides a textToImage() method for AI-powered image generation (Stable Diffusion, FLUX, etc.), but the auto-instrumentation does not cover it. Calls to textToImage() produce no Braintrust spans, while the five other HuggingFace Inference methods — chatCompletion, chatCompletionStream, textGeneration, textGenerationStream, and featureExtraction — are all instrumented.

What instrumentation is missing

  • Auto-instrumentation config (js/src/auto-instrumentations/configs/huggingface.ts): Defines configs for chatCompletion, chatCompletionStream, textGeneration, textGenerationStream, and featureExtraction. No config for textToImage.
  • Channels (js/src/instrumentation/plugins/huggingface-channels.ts): No channel definition for textToImage.
  • Plugin (js/src/instrumentation/plugins/huggingface-plugin.ts): No handler for image generation calls.

Upstream reference

Braintrust docs status

not_found — The Braintrust docs do not list specific HuggingFace Inference methods. textToImage is not mentioned.

Precedent in this repo

Image generation instrumentation gaps are tracked for other providers:

  • OpenAI images.generate(): BT-4495
  • Google GenAI models.generateImages(): BT-4562
  • Vercel AI SDK generateImage(): BT-4468

The five other HuggingFace Inference execution methods are all instrumented, making textToImage() the only uninstrumented generative method in the HuggingFace plugin.

Local files inspected

  • js/src/auto-instrumentations/configs/huggingface.ts — no textToImage config entry
  • js/src/instrumentation/plugins/huggingface-channels.ts — no textToImage channel
  • js/src/instrumentation/plugins/huggingface-plugin.ts — no image generation handler
  • js/src/vendor-sdk-types/huggingface.ts — no textToImage types
  • e2e/scenarios/huggingface-instrumentation/ — no image generation test scenarios

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