Error building first agent template No @spaces.GPU function detected during startup - cannot select free tier

#737
by avijitghosh777 - opened

runtime error
No @spaces.GPU function detected during startup
Container logs:

===== Application Startup at 2026-08-26 05:55:52 =====

[notice] A new release of pip is available: 26.1.2 -> 26.2.1
[notice] To update, run: pip install --upgrade pip

tool.py: 0%| | 0.00/635 [00:00<?, ?B/s]
tool.py: 100%|██████████| 635/635 [00:00<00:00, 4.20MB/s]

Running on local URL: http://0.0.0.0:7860, with SSR ⚡ (experimental, to disable set ssr=False in launch())
/usr/local/lib/python3.10/site-packages/gradio/blocks.py:2761: UserWarning: Setting share=True is not supported on Hugging Face Spaces
warnings.warn(
To create a public link, set share=True in launch().

Stopping Node.js server...

Any updates on the above error ? I am unable to continue the agent course.

same issue bro

Here is what is happening, with numbers, since three of you are blocked on the same thing.

The error is not caused by your code. No @spaces.GPU function detected during startup is ZeroGPU's check: a Space running on ZeroGPU hardware must contain at least one function decorated with @spaces.GPU. This template is plain CPU smolagents code and has no such function, so on ZeroGPU it cannot start. On free CPU Basic it runs fine.

This is connected to the "cannot duplicate for free" reports in #733 and #736. If CPU Basic is no longer offered when duplicating, ZeroGPU becomes the only choice, and it fails for the reason above.

Measured scale. I have a census of all 1,458,692 public Spaces, so I can isolate every copy of this template. There are 28,689 of them. Broken rate by the month the copy was made:

copy made copies in an error state
2026-04 1,184 3.7%
2026-05 1,077 4.0%
2026-06 1,104 4.1%
2026-07 477 39.0%
2026-08 281 58.7%

Of 35 recently-broken copies I sampled, 33 were on zero-a10g. Of 35 recent copies that work, 21 were on cpu-basic. So this is a hardware-selection problem, not a bug in your agent.

What you can do now

  1. In your Space, go to Settings and change hardware to CPU basic (free). If it starts, this was the cause.
  2. If CPU Basic is not selectable, the workaround another learner used in #733 is to run the agent locally instead, with Ollama or a free Gemini API key. It is not the course as written but it unblocks Unit 1.
  3. If you must stay on ZeroGPU, adding any trivially decorated function makes the startup check pass:
import spaces

@spaces.GPU
def _noop():
    return None

I have reported this upstream with the data above at https://github.com/huggingface/agents-course/issues/733

I do not work for Hugging Face. Method and code: https://github.com/ashishsinha1602/dataset-integrity-audit

Sign up or log in to comment