gradio-client
Python library for easily interacting with trained machine learning models
What it is and what it does
gradio_client is a lightweight Python library that wraps any Gradio app—whether running on Hugging Face Spaces or a custom server—as a callable Python API. It handles connection setup, parameter marshalling, file uploads, and response parsing, letting you invoke trained ML models or interactive tools with a simple `.predict()` call. The library manages authentication (including private Spaces via HF tokens) and provides introspection via `.view_api()` to discover available endpoints and their signatures.
Typical use is calling public Spaces or duplicating them for private, unlimited access. It depends on fsspec for file handling, httpx for HTTP requests, huggingface-hub for Space discovery and authentication, packaging for version handling, and typing-extensions for runtime type hints. Maintenance is active, the API surface is minimal, and there are no known security vulnerabilities.
Use it for:
- Call a Hugging Face Space audio transcription model to process audio files in a batch pipeline.
- Integrate a public Gradio chatbot or image generator into a web service without hosting your own inference.
- Duplicate a Space to create a private copy and make unlimited API calls without rate limiting.
- Inspect and call multiple named endpoints in a single Gradio app from Python.
- Build a CLI tool that wraps a remote ML model by connecting to its Gradio interface.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Calls any Gradio app as a Python API with a simple Client interface, handling authentication, file uploads, and response parsing automatically.
Yes. Low install friction, active maintenance, no vulnerabilities, and a permissive license make this a safe choice. Install if you need to call any Gradio app as an API—the three-line usage pattern is genuine and the library handles the boilerplate. Only caveat: requires Python 3.10+, and public Spaces may rate-limit heavy usage (though duplication solves that).
Install
gradio-client on PyPI
pip
pip install gradio-clientuv
uv add gradio-clientpoetry
poetry add gradio-clientInstalling gradio-client
Before you install
Low friction: pure Python wheel with five lightweight runtime dependencies (fsspec, httpx, huggingface-hub, packaging, typing-extensions). Active maintenance—last commit 2026-08-14, released 2026-07-29, no known vulnerabilities.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for proprietary applications.
Quickstart
from gradio_client import Client
client = Client("abidlabs/whisper")
result = client.predict("audio_sample.wav")
print(result)
Requires Python 3.10 or higher.
Verify before relying
- Whether rate limiting on public Spaces is a practical concern for typical workloads.
- Performance characteristics when calling endpoints with large file uploads or long-running predictions.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — fsspec, httpx, huggingface-hub, packaging, typing-extensions |
| Maintenance | actively maintained — 16 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,463,168/month — #1,393 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gradio_client-2.6.0-py3-none-any.whl
Keywords: API, client, machine learning
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
gradioGradio builds web interfaces for machine…
permissive · top 5,000 on PyPI
hf-gradioA CLI tool for discovering endpoints and…
permissive · top 5,000 on PyPI
gradio-pdfProvides a PDF display component for Gradio…
permissive · top 15,000 on PyPI
spacesProvides utilities for working with Hugging…
permissive · top 15,000 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
gradio-imagesliderA Gradio component that displays two images…
permissive · top 15,000 on PyPI
groovyTranspiles Python functions to JavaScript,…
permissive · top 5,000 on PyPI
hfA command-line interface for interacting with…
permissive · top 15,000 on PyPI
graphqlclientA lightweight GraphQL client that sends queries…
permissive · top 15,000 on PyPI
fal-clientA Python client library for calling ML models…
unclear · top 5,000 on PyPI