Skip provider/task combos with no @huggingface/inference snippet helper#2527
Merged
Merged
Conversation
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>
b840cfe to
ba108d6
Compare
Wauplin
approved these changes
Jun 4, 2026
Wauplin
left a comment
Contributor
There was a problem hiding this comment.
Makes perfect sense, thanks for fixing!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The inference-providers doc build prerenders an
<InferenceSnippet>for every(provider, task)section. The doc-builder generates those snippets via@huggingface/inference'sgetProviderHelper(provider, task), which throws anInferenceClientInputErrorwhen the provider has no helper for that task. The uncaught error surfaces as a SvelteKit500and fails the whole build:This happens whenever a provider's partner API (
/api/partners/<provider>/models) advertises a live model for a task that@huggingface/inferencedoesn'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(modelnvidia/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 onmainevery day since 2026-05-29 — and on every PR (e.g. #2526) since.Fix
Guard
generate.tsso it never emits a section the doc-builder can't render. We mirror the doc-builder's exact lookup — resolving conversationaltext-generation/image-text-to-textto the"conversational"task — and skip any(provider, task)combogetProviderHelperrejects, logging each skip so the bot's CI output stays transparent.The check lives at the single chokepoint
fetchWarmModels(), through which allperProviderWarmModels(and therefore both provider pages and task pages) flow.Verification
Ran
npm run generatelocally — exits 0, and the guard skips exactly the unsupported combos:The regenerated
together.mdno longer contains the ASR section. (hf-inference+ non-conversationalimage-text-to-textis 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/inferencecannot render as snippets, using the samegetProviderHelperlookup the doc-builder uses at prerender time.In
fetchWarmModels()(the chokepoint for all warm-model / snippet sections), each provider is checked via a newisSnippetSupported()helper before any Hub API fetch. Unsupported combos are skipped with a console warning. For conversational flows, the helper task isconversational, matching how doc-builder treatstext-generationandimage-text-to-textchat snippets.This stops generated pages from including
<InferenceSnippet>sections that would throwInferenceClientInputErrorand break the inference-providers build (e.g.together+ automatic speech recognition).Reviewed by Cursor Bugbot for commit b840cfe. Configure here.