Skip to content

Skip provider/task combos with no @huggingface/inference snippet helper#2527

Merged
hanouticelina merged 1 commit into
mainfrom
guard-unsupported-provider-task-snippets
Jun 4, 2026
Merged

Skip provider/task combos with no @huggingface/inference snippet helper#2527
hanouticelina merged 1 commit into
mainfrom
guard-unsupported-provider-task-snippets

Conversation

@hanouticelina

@hanouticelina hanouticelina commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Problem

The inference-providers doc build prerenders an <InferenceSnippet> for every (provider, task) section. The doc-builder generates those snippets via @huggingface/inference's getProviderHelper(provider, task), which throws an InferenceClientInputError when the provider has no helper for that task. The uncaught error surfaces as a SvelteKit 500 and fails the whole build:

Failed to get provider helper for together (automatic-speech-recognition)
  InferenceClientInputError: Task 'automatic-speech-recognition' not supported for provider 'together'.
  Available tasks: text-to-image, conversational, text-generation
TypeError: Cannot read properties of undefined (reading 'length')
Error: 500 /docs/inference-providers/.../providers/together

This happens whenever a provider's partner API (/api/partners/<provider>/models) advertises a live model for a task that @huggingface/inference doesn't (yet) expose as a snippet. The generator happily emits the section, and the build crashes on it.

Concretely, the Automatic Speech Recognition section for together (model nvidia/parakeet-tdt-0.6b-v3) was added by the automated generator in #2507 (2026-05-28), and the Build Inference Providers Documentation workflow has been red on main every day since 2026-05-29 — and on every PR (e.g. #2526) since.

Fix

Guard generate.ts so it never emits a section the doc-builder can't render. We mirror the doc-builder's exact lookup — resolving conversational text-generation / image-text-to-text to the "conversational" task — and skip any (provider, task) combo getProviderHelper rejects, logging each skip so the bot's CI output stays transparent.

The check lives at the single chokepoint fetchWarmModels(), through which all perProviderWarmModels (and therefore both provider pages and task pages) flow.

Verification

Ran npm run generate locally — exits 0, and the guard skips exactly the unsupported combos:

⏭️  Skipping together for automatic-speech-recognition: ...
⏭️  Skipping together for feature-extraction / image-to-image / text-to-video: ...
⏭️  Skipping hyperbolic for image-text-to-text: ...
⏭️  Skipping hf-inference for text-to-video / image-text-to-text: ...

The regenerated together.md no longer contains the ASR section. (hf-inference + non-conversational image-text-to-text is dropped harmlessly — that snippet variant is never rendered; the task page uses the conversational one.)

Note

This PR is code-only. The committed provider/task docs are owned by the automated Update Inference Providers documentation job — once this guard lands, the next regeneration will drop the broken sections and turn the build green. (A one-off regeneration could be committed to unblock immediately if desired.)

Split out of #2526, which is unaffected by its own changes but inherits this pre-existing breakage.

🤖 Generated with Claude Code


Note

Low Risk
Build-time generator guard only; no runtime product, auth, or data-path changes.

Overview
The inference-providers doc generator now filters out (provider, task) pairs that @huggingface/inference cannot render as snippets, using the same getProviderHelper lookup the doc-builder uses at prerender time.

In fetchWarmModels() (the chokepoint for all warm-model / snippet sections), each provider is checked via a new isSnippetSupported() helper before any Hub API fetch. Unsupported combos are skipped with a console warning. For conversational flows, the helper task is conversational, matching how doc-builder treats text-generation and image-text-to-text chat snippets.

This stops generated pages from including <InferenceSnippet> sections that would throw InferenceClientInputError and break the inference-providers build (e.g. together + automatic speech recognition).

Reviewed by Cursor Bugbot for commit b840cfe. Configure here.

@hanouticelina hanouticelina marked this pull request as ready for review June 3, 2026 16:48
The inference-providers doc build prerenders an <InferenceSnippet> for every
(provider, task) section. The doc-builder generates those snippets via
@huggingface/inference's getProviderHelper(provider, task), which throws an
InferenceClientInputError when the provider has no helper for that task. The
uncaught error surfaces as a SvelteKit 500 and fails the whole build.

This happens whenever a provider's partner API advertises a live model for a
task that @huggingface/inference doesn't (yet) support as a snippet, e.g.
`together` + `automatic-speech-recognition` (added in #2507), which has been
breaking the inference-providers doc build on main since 2026-05-29.

Guard generate.ts so it never emits such a section: mirror the doc-builder's
helper lookup (resolving conversational text-generation / image-text-to-text to
the "conversational" task) and skip any combo getProviderHelper can't handle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hanouticelina hanouticelina force-pushed the guard-unsupported-provider-task-snippets branch from b840cfe to ba108d6 Compare June 3, 2026 16:59
@hanouticelina hanouticelina requested a review from Wauplin June 3, 2026 17:09

@Wauplin Wauplin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes perfect sense, thanks for fixing!

@hanouticelina hanouticelina merged commit a438b8d into main Jun 4, 2026
1 check passed
@hanouticelina hanouticelina deleted the guard-unsupported-provider-task-snippets branch June 4, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants