Build machine learning web apps — in Python
Gradio is an open-source Python package that allows you to quickly build a demo or web application for your machine learning model, API, or any arbitrary Python function. You can then share a link to your demo or web application in just a few seconds using Gradio’s built-in sharing features. No JavaScript, CSS, or web hosting experience needed.Why Gradio?
Fast development
Build and deploy ML web apps in just a few lines of Python code
Easy sharing
Share your demos instantly with a public link — no hosting required
Rich components
Choose from 30+ built-in components for ML applications
Flexible layouts
Create custom UIs with Blocks or use the simple Interface class
Key features
Quick to build
It just takes a few lines of Python to create your own demo. Here’s a complete Gradio app:Share instantly
Gradio lets you easily share your demo without hosting on a web server. Simply setshare=True in launch(), and a publicly accessible URL will be created:
https://a23dsf231adb.gradio.live that anyone can access while your app runs locally.
Three ways to build
Interface
High-level API for quick demos with inputs and outputs
Blocks
Low-level API for custom layouts and complex data flows
ChatInterface
Specialized API for building chatbot UIs quickly
Interface class
TheInterface class is designed for machine learning models that accept one or more inputs and return one or more outputs. Perfect for quick demos:
Blocks class
TheBlocks class offers a low-level approach for designing web apps with customizable layouts and data flows. You can control where components appear on the page, handle complex interactions, and update component properties dynamically:
ChatInterface class
TheChatInterface class is specifically designed to create chatbot UIs. Just provide a function and Gradio creates a fully working chatbot interface.
Rich ecosystem
Gradio is more than just a Python library — it’s an entire ecosystem:Python Client
Query any Gradio app programmatically with
gradio_clientJavaScript Client
Query any Gradio app from JavaScript with
@gradio/clientHugging Face Spaces
Host your Gradio apps for free on Hugging Face Spaces
Custom Components
Build and share your own custom Gradio components
Where to go next
Quickstart
Build your first Gradio app in minutes
Installation
Detailed installation instructions for all platforms