Skip to content

fix(hf-space): run on CPU basic; disable Gradio SSR (Node sidecar) - #21

Merged
picaultj merged 1 commit into
mainfrom
fix/hf-space-runtime
Jul 20, 2026
Merged

fix(hf-space): run on CPU basic; disable Gradio SSR (Node sidecar)#21
picaultj merged 1 commit into
mainfrom
fix/hf-space-runtime

Conversation

@picaultj

Copy link
Copy Markdown
Owner

Problem

The Space at picault/conflens shows a runtime error:

No @spaces.GPU function detected during startup
* Running on local URL:  http://0.0.0.0:7860, with SSR ⚡ (Node proxy -> Python :7861)
Stopping Node.js server...
  • No @spaces.GPU function detected is only raised on ZeroGPU hardware, which requires a @spaces.GPU-decorated function. ConfLens is CPU-only (LLM calls go out over HTTP; no local GPU work), so on ZeroGPU HF refuses to start it. The app itself booted fine (Running on local URL …).

Fix

Two parts:

  1. Hardware = CPU basic (the actual fix; maintainer action on HF). Set the Space's Settings → Hardware to CPU basic (free). Documented in the README ("pick … CPU basic …") and hinted via suggested_hardware: cpu-basic in the Space metadata.
  2. Disable Gradio SSR (code hardening). Gradio 6 defaults to SSR, which runs a Node sidecar (Node proxy -> Python). This CPU app doesn't need it, so space_app.py now sets GRADIO_SSR_MODE=false and passes ssr_mode=False — plain server-rendered Python, fewer moving parts on free CPU.

Testing

  • Booted space_app.py locally with SSR disabled → HTTP 200, and the log now shows a plain Running on local URL with no Node/SSR proxy line.
  • ruff clean.

What you need to do on HF

  • Set picault/conflens hardware to CPU basic.
  • Ensure the Space SDK is Gradio (not Docker) — the repo ships sdk: gradio / space_app.py / requirements.txt.
  • Confirm HF_TOKEN (repo secret) belongs to picault with write access, and add your LLM key(s) as Space secrets.

After merging, the sync workflow (with the picault owner fix from #20) will push and the Space should come up on CPU.


Generated by Claude Code

The Space showed a runtime error — "No @spaces.GPU function detected during
startup" — which HF only raises on ZeroGPU hardware; this app is CPU-only, so it
must run on CPU basic. Document that (README + suggested_hardware: cpu-basic) and
disable Gradio's SSR (GRADIO_SSR_MODE=false + ssr_mode=False) so the Space is
plain server-rendered Python with no Node sidecar — leaner on free CPU.
@picaultj
picaultj merged commit 7846677 into main Jul 20, 2026
3 of 4 checks passed
@picaultj
picaultj deleted the fix/hf-space-runtime branch July 20, 2026 14:12

Copy link
Copy Markdown
Owner Author

Closing: the Hugging Face deployment is being removed in #22 (Gradio Spaces are no longer free), so this runtime fix is moot.


Generated by Claude Code

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.

1 participant