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
Summary
The
@huggingface/inferenceSDK provides atextToImage()method for AI-powered image generation (Stable Diffusion, FLUX, etc.), but the auto-instrumentation does not cover it. Calls totextToImage()produce no Braintrust spans, while the five other HuggingFace Inference methods —chatCompletion,chatCompletionStream,textGeneration,textGenerationStream, andfeatureExtraction— are all instrumented.What instrumentation is missing
js/src/auto-instrumentations/configs/huggingface.ts): Defines configs forchatCompletion,chatCompletionStream,textGeneration,textGenerationStream, andfeatureExtraction. No config fortextToImage.js/src/instrumentation/plugins/huggingface-channels.ts): No channel definition fortextToImage.js/src/instrumentation/plugins/huggingface-plugin.ts): No handler for image generation calls.Upstream reference
@huggingface/inferenceSDK: https://huggingface.co/docs/huggingface.js/en/inference/READMEtextToImage(params)accepts{ model, inputs, parameters }and returns a generated imageBlob.stabilityai/stable-diffusion-xl-base-1.0,black-forest-labs/FLUX.1-schnell, and other Diffusers-based models.Braintrust docs status
not_found— The Braintrust docs do not list specific HuggingFace Inference methods.textToImageis not mentioned.Precedent in this repo
Image generation instrumentation gaps are tracked for other providers:
images.generate(): BT-4495models.generateImages(): BT-4562generateImage(): BT-4468The 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— notextToImageconfig entryjs/src/instrumentation/plugins/huggingface-channels.ts— notextToImagechanneljs/src/instrumentation/plugins/huggingface-plugin.ts— no image generation handlerjs/src/vendor-sdk-types/huggingface.ts— notextToImagetypese2e/scenarios/huggingface-instrumentation/— no image generation test scenarios