Skip to content

workflow: forward x-ip-token so zerogpu spaces bill the caller - #13747

Merged
hannahblair merged 5 commits into
mainfrom
workflow-quota-fix
Aug 13, 2026
Merged

workflow: forward x-ip-token so zerogpu spaces bill the caller#13747
hannahblair merged 5 commits into
mainfrom
workflow-quota-fix

Conversation

@hannahblair

Copy link
Copy Markdown
Collaborator

Description

@AK391's issue around busy zerogpu spaces was caused because the x-ip-token header wasn't reaching the target spaces, so ZeroGPU couldn't identify the caller and fell back to the workflow Space's shared IP quota, which was exhausted almost instantly.

the fix is to set LocalContext.request around the fn call in /component_server, matching what get_function_with_locals already does for normal event listeners. only /component_server was broken. every other user func dispatch already goes through get_function_with_locals.

@gradio-pr-bot

gradio-pr-bot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://huggingface.co/buckets/gradio/pypi-previews/resolve/da76169521194fc0722bdd05d0382964f3e0b92a/gradio-6.24.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@da76169521194fc0722bdd05d0382964f3e0b92a#subdirectory=client/python"

Import Gradio JS Client from this PR via CDN

import { Client } from "https://huggingface.co/buckets/gradio/npm-previews/resolve/da76169521194fc0722bdd05d0382964f3e0b92a/browser.js";

@hannahblair
hannahblair requested review from AK391 and abidlabs August 12, 2026 14:59
@gradio-pr-bot

Copy link
Copy Markdown
Collaborator

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio minor

  • workflow: forward x-ip-token so zerogpu spaces bill the caller

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

Comment thread gradio/routes.py Outdated

@abidlabs abidlabs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM @hannahblair!

@AK391 AK391 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.

Tested this on my workflow Space
(https://huggingface.co/spaces/akhaliq/workflow-test) using the PR preview
wheel, called the workflow via gradio_client both logged in (OAuth) and
logged out, and the ZeroGPU operator (Z-Image-Turbo) completed successfully
both times instead of failing with the busy/quota error. LGTM!

@hannahblair

Copy link
Copy Markdown
Collaborator Author

great, thanks for testing @AK391!

@hannahblair
hannahblair merged commit 612abdf into main Aug 13, 2026
26 checks passed
@hannahblair
hannahblair deleted the workflow-quota-fix branch August 13, 2026 16:59
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.

4 participants