Repository navigation
fix(workflow-operator): route HF text generation via router - #9729
dragonknightk wants to merge 1 commit into
Conversation
### What changes were proposed in this PR?
The Hub now returns an empty provider mapping for models that are still served, and the operator's fallback for that case, `hf-inference`, no longer serves any text-generation model.
This PR changes only that fallback, and only for the `text-generation` task:
| Case | Before | After |
| --- | --- | --- |
| Text generation, lookup fails or is empty | `router.huggingface.co/hf-inference/models/{id}/v1/chat/completions` | `router.huggingface.co/v1/chat/completions`, model = Hub ID |
| Text generation, Hub lists live providers | provider route, `providerId` | unchanged |
| Any other task, lookup fails or is empty | `hf-inference` | unchanged |
The router's generic chat route picks a live provider for the Hub model ID by itself, so the operator no longer needs the Hub mapping to reach one. `image-text-to-text` shares the chat branch but keeps the `hf-inference` fallback, because the issue only covers text generation.
### Any related issues, documentation, discussions?
Closes issue 9723
### How was this PR tested?
Added `HuggingFaceProviderRouteBehaviorSpec`. Like the existing parse behavior spec, it runs the generated provider lookup and request loop with only `requests` stubbed, so nothing reaches the network. It covers:
- an empty Hub mapping (the reply quoted in the issue), a Hub error status and an unreachable Hub: text generation posts to the router's generic chat route with the Hub model ID. These cases fail on the old code, which posts to the `hf-inference` route.
- a live provider in the Hub mapping: text generation still posts to that provider's route with its own model name.
- `image-text-to-text` and a pipeline task with an empty mapping: both still post to `hf-inference`.
`AMBER_TEST_FILTER=skip-integration sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.huggingFace.*"`
### Was this PR authored or co-authored using generative AI tooling?
Signed-off-by: dragonknightk <37928252+dragonknightk@users.noreply.github.com>
|
👋 Thanks for your first contribution to Texera, @dragonknightk! If you're looking for a good place to start, browse issues labeled You can drive common housekeeping yourself by commenting one of these commands on its own line:
Each command must match exactly: |
Backport auto-label reportThis
|
Automated Reviewer SuggestionsBased on the
|
What changes were proposed in this PR?
The Hub now returns an empty provider mapping for models that are still served, and the operator's fallback for that case,
hf-inference, no longer serves any text-generation model.This PR changes only that fallback, and only for the
text-generationtask:router.huggingface.co/hf-inference/models/{id}/v1/chat/completionsrouter.huggingface.co/v1/chat/completions, model = Hub IDproviderIdhf-inferenceThe router's generic chat route picks a live provider for the Hub model ID by itself, so the operator no longer needs the Hub mapping to reach one.
image-text-to-textshares the chat branch but keeps thehf-inferencefallback, because the issue only covers text generation.Any related issues, documentation, discussions?
Closes #9723
How was this PR tested?
Added
HuggingFaceProviderRouteBehaviorSpec. Like the existing parse behavior spec, it runs the generated provider lookup and request loop with onlyrequestsstubbed, so nothing reaches the network. It covers:hf-inferenceroute.image-text-to-textand a pipeline task with an empty mapping: both still post tohf-inference.AMBER_TEST_FILTER=skip-integration sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.huggingFace.*"Was this PR authored or co-authored using generative AI tooling?
Generated-by: Grok Bot. Human-led contribution; all code, tests, and description were reviewed by dragonknightk before submission.