| name | hf-perftest |
| description | Benchmark Gradio app performance. Use when the user wants to load test a Gradio app, compare branches, profile a HF Space, or run A/B tests. |
hf-perftest — Gradio Performance Benchmarking
Installation
pip install hf-perftest
Commands
List built-in apps
hf-perftest list-apps
Built-in apps can be used by name (no file path needed): echo_text, file_heavy, image_to_image, streaming_chat, stateful_counter, llm_chat, text_to_image, audio_to_audio, video_to_video.
Local benchmark
hf-perftest run \
--app echo_text \
--tiers 1,10,100 \
--requests-per-user 10 \
--output-dir results
Key options:
--app — Built-in app name or path to a Gradio app file (required)
--tiers — Comma-separated concurrent user counts (default: 1,10,100)
--requests-per-user — Rounds per tier (default: 10)
--mode burst|wave — Simultaneous or staggered requests (default: burst)
--concurrency-limit — App concurrency limit (default: 1, "none" for unlimited)
--mixed-traffic — Add background page loads, uploads, and downloads alongside predictions
--num-workers — Number of Gradio workers via GRADIO_NUM_WORKERS (default: 1)
--port — App port (default: 7860, auto-increments if occupied)
- — Target API endpoint (auto-detected if omitted)