Can't get Zero-GPU to work with Fastapi/Uvicorn

Hello everyone – I’d really like to use ZeroGPU for my project, but I just can’t get it to work for my use-case, and have been working on it for days now. Basically the issue is:

ZeroGPU only works for me when I enable SSR-mode in Gradio 5.+. If I don’t do that I’m running into all the issues about ZeroGPU not finding the account of the user, and applying the very restrictive IP-based limits, which have been discussed in this forum. That wouldn’t be a problem, but I need to server my application through FastAPI with Uvicorn, because this is the only approach that allows me to make dynamically created html-files available to the users. Unfortunately, this configuration causes the space to break on all browsers I tried, which looks like this:

If I disable SSR, Zero GPU stops working, if I enable it, the space breaks.
I’ve built a little example space to demonstrate the problem:
https://huggingface.co/spaces/m7n/zero_gpu_uvicorn_ssr_example?logs=build

I’d be really appreciative of any pointers on how to get this to work, it’s driving me crazy!

This is similar to this case, but if this is the case, it cannot be avoided by the user…

Hmm. Thank you for the pointer! I’ll take a look.

Ok, so it seems like this was fixed in the latest gradio release (5.16.1), just a few hours ago. Authentification now works again without ssr: Steveeeeeeen/Zonos · Fix ZeroGPU auth