Summary
The HuggingFace Hub InferenceClient.text_to_video() (and its async counterpart) is not instrumented. Calls to this method produce zero Braintrust tracing. This is a stable generative video API on the same InferenceClient class that the integration already instruments for chat, text generation, and embeddings.
This gap is adjacent to but distinct from #487 (text_to_image, image_to_text, text_to_speech) and #506 (automatic_speech_recognition). text_to_video is not included in either existing issue.
What is missing
| InferenceClient method |
Task type |
Instrumented? |
chat_completion() |
Chat generation |
Yes |
text_generation() |
Text generation |
Yes |
feature_extraction() |
Embeddings |
Yes |
sentence_similarity() |
Semantic similarity |
Yes |
text_to_image() |
Image generation |
No (tracked in #487) |
image_to_text() |
Vision captioning |
No (tracked in #487) |
text_to_speech() |
Audio synthesis |
No (tracked in #487) |
automatic_speech_recognition() |
Audio transcription |
No (tracked in #506) |
text_to_video() |
Video generation |
No — not tracked |
AsyncInferenceClient.text_to_video() |
Video generation (async) |
No — not tracked |
API details
- Method:
InferenceClient.text_to_video(text: str, *, model: str | None = None, **kwargs) -> bytes
- Returns: raw video bytes (the caller writes to file or streams)
- Async counterpart:
AsyncInferenceClient.text_to_video(...) with identical signature
- Availability: present in huggingface-hub ≥ 0.19.0 — both matrix pins (floor
0.32.0 and latest 1.19.0) include it
- The method is in
huggingface_hub.inference._client.InferenceClient (sync) and huggingface_hub.inference._generated._async_client.AsyncInferenceClient (async), matching the pattern used by all existing patchers
Minimum instrumentation
Both sync and async text_to_video() should create spans capturing:
| Span field |
Content |
| input |
Text prompt |
| output |
Video byte length or content-type metadata (raw bytes are large; a summary is preferable) |
| metadata |
provider: "huggingface_hub", model (from model parameter), task-specific generation params |
| metrics |
Latency |
The pattern should follow the existing _text_generation_wrapper / _async_text_generation_wrapper structure in py/src/braintrust/integrations/huggingface_hub/tracing.py, with a new composite patcher in patchers.py.
Braintrust docs status
not_found — The Braintrust HuggingFace Hub integration docs describe tracing for chat_completion, text_generation, and embeddings. No mention of video generation.
Upstream sources
huggingface_hub.inference._client.InferenceClient.text_to_video — sync surface
huggingface_hub.inference._generated._async_client.AsyncInferenceClient.text_to_video — async surface
- HuggingFace Hub inference API docs: https://huggingface.co/docs/huggingface_hub/package_reference/inference_client
- huggingface-hub current matrix:
latest = "huggingface-hub==1.19.0", floor "0.32.0" = "huggingface-hub==0.32.0"
Local files inspected
py/src/braintrust/integrations/huggingface_hub/patchers.py — defines 8 patchers (4 sync + 4 async) for chat_completion, text_generation, feature_extraction, sentence_similarity only; zero references to text_to_video
py/src/braintrust/integrations/huggingface_hub/tracing.py — wrapper implementations for the 4 covered tasks; no text_to_video wrapper
py/src/braintrust/integrations/huggingface_hub/integration.py — registers the 4 patchers; no video patcher
py/src/braintrust/integrations/huggingface_hub/test_huggingface_hub.py — no text_to_video test cases
py/pyproject.toml — [tool.braintrust.matrix.huggingface-hub] pins both latest = "huggingface-hub==1.19.0" and "0.32.0" = "huggingface-hub==0.32.0"
Relationship to existing issues
Summary
The HuggingFace Hub
InferenceClient.text_to_video()(and its async counterpart) is not instrumented. Calls to this method produce zero Braintrust tracing. This is a stable generative video API on the sameInferenceClientclass that the integration already instruments for chat, text generation, and embeddings.This gap is adjacent to but distinct from #487 (
text_to_image,image_to_text,text_to_speech) and #506 (automatic_speech_recognition).text_to_videois not included in either existing issue.What is missing
chat_completion()text_generation()feature_extraction()sentence_similarity()text_to_image()image_to_text()text_to_speech()automatic_speech_recognition()text_to_video()AsyncInferenceClient.text_to_video()API details
InferenceClient.text_to_video(text: str, *, model: str | None = None, **kwargs) -> bytesAsyncInferenceClient.text_to_video(...)with identical signature0.32.0and latest1.19.0) include ithuggingface_hub.inference._client.InferenceClient(sync) andhuggingface_hub.inference._generated._async_client.AsyncInferenceClient(async), matching the pattern used by all existing patchersMinimum instrumentation
Both sync and async
text_to_video()should create spans capturing:provider: "huggingface_hub",model(frommodelparameter), task-specific generation paramsThe pattern should follow the existing
_text_generation_wrapper/_async_text_generation_wrapperstructure inpy/src/braintrust/integrations/huggingface_hub/tracing.py, with a new composite patcher inpatchers.py.Braintrust docs status
not_found — The Braintrust HuggingFace Hub integration docs describe tracing for
chat_completion,text_generation, and embeddings. No mention of video generation.Upstream sources
huggingface_hub.inference._client.InferenceClient.text_to_video— sync surfacehuggingface_hub.inference._generated._async_client.AsyncInferenceClient.text_to_video— async surfacelatest = "huggingface-hub==1.19.0", floor"0.32.0" = "huggingface-hub==0.32.0"Local files inspected
py/src/braintrust/integrations/huggingface_hub/patchers.py— defines 8 patchers (4 sync + 4 async) forchat_completion,text_generation,feature_extraction,sentence_similarityonly; zero references totext_to_videopy/src/braintrust/integrations/huggingface_hub/tracing.py— wrapper implementations for the 4 covered tasks; notext_to_videowrapperpy/src/braintrust/integrations/huggingface_hub/integration.py— registers the 4 patchers; no video patcherpy/src/braintrust/integrations/huggingface_hub/test_huggingface_hub.py— notext_to_videotest casespy/pyproject.toml—[tool.braintrust.matrix.huggingface-hub]pins bothlatest = "huggingface-hub==1.19.0"and"0.32.0" = "huggingface-hub==0.32.0"Relationship to existing issues
text_to_image,image_to_text,text_to_speech— a related set of generative media tasks, but does not includetext_to_videoInferenceClient.automatic_speech_recognition()not instrumented #506 tracksautomatic_speech_recognition— a different modality (audio-to-text)text_to_videois the remaining generative video surface onInferenceClientnot covered by either existing issue