skillfed

gradio-client

Python library for easily interacting with trained machine learning models

gradio-client v2.6.0 11.5M downloads/30d#1,393 on PyPI43,364
Permissive license Apache-2.0 Active released

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-client

uv

uv add gradio-client

poetry

poetry add gradio-client

Installing 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

Development Status :: 4 - BetaLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Software Development :: User Interfaces

Tags

gradio api clientcall gradio app programmaticallygradio space python clientmachine learning model api wrapperhugging face space clientgradio prediction clientremote ml model inference
api-clientml-inferencehuggingface

More Scientific/Engineering packages