> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/gradio-app/gradio/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Build machine learning web apps in Python — no JavaScript, CSS, or web hosting experience needed

# 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?

<CardGroup cols={2}>
  <Card title="Fast development" icon="rocket">
    Build and deploy ML web apps in just a few lines of Python code
  </Card>

  <Card title="Easy sharing" icon="share-nodes">
    Share your demos instantly with a public link — no hosting required
  </Card>

  <Card title="Rich components" icon="grid">
    Choose from 30+ built-in components for ML applications
  </Card>

  <Card title="Flexible layouts" icon="puzzle-piece">
    Create custom UIs with Blocks or use the simple Interface class
  </Card>
</CardGroup>

## Key features

### Quick to build

It just takes a few lines of Python to create your own demo. Here's a complete Gradio app:

```python theme={null}
import gradio as gr

def greet(name, intensity):
    return "Hello, " + name + "!" * int(intensity)

demo = gr.Interface(
    fn=greet,
    inputs=["text", "slider"],
    outputs=["text"],
)

demo.launch()
```

This creates a web interface that opens in your browser at [http://localhost:7860](http://localhost:7860).

### Share instantly

Gradio lets you easily share your demo without hosting on a web server. Simply set `share=True` in `launch()`, and a publicly accessible URL will be created:

```python theme={null}
demo.launch(share=True)  # Creates a public URL
```

You'll get a link like `https://a23dsf231adb.gradio.live` that anyone can access while your app runs locally.

### Three ways to build

<CardGroup cols={3}>
  <Card title="Interface" icon="window">
    High-level API for quick demos with inputs and outputs
  </Card>

  <Card title="Blocks" icon="cubes">
    Low-level API for custom layouts and complex data flows
  </Card>

  <Card title="ChatInterface" icon="comments">
    Specialized API for building chatbot UIs quickly
  </Card>
</CardGroup>

#### Interface class

The `Interface` class is designed for machine learning models that accept one or more inputs and return one or more outputs. Perfect for quick demos:

```python theme={null}
import gradio as gr

demo = gr.Interface(
    fn=greet,
    inputs=["text", "slider"],
    outputs=["text"],
)
```

#### Blocks class

The `Blocks` 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:

```python theme={null}
import gradio as gr

def welcome(name):
    return f"Welcome to Gradio, {name}!"

with gr.Blocks() as demo:
    gr.Markdown("# Hello World!")
    inp = gr.Textbox(placeholder="What is your name?")
    out = gr.Textbox()
    inp.change(welcome, inp, out)
```

Complex applications like the popular [Automatic1111 Web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) are built using Gradio Blocks.

#### ChatInterface class

The `ChatInterface` 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:

<CardGroup cols={2}>
  <Card title="Python Client" icon="python">
    Query any Gradio app programmatically with `gradio_client`
  </Card>

  <Card title="JavaScript Client" icon="js">
    Query any Gradio app from JavaScript with `@gradio/client`
  </Card>

  <Card title="Hugging Face Spaces" icon="rocket">
    Host your Gradio apps for free on Hugging Face Spaces
  </Card>

  <Card title="Custom Components" icon="puzzle-piece">
    Build and share your own custom Gradio components
  </Card>
</CardGroup>

## Where to go next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="play" href="/quickstart">
    Build your first Gradio app in minutes
  </Card>

  <Card title="Installation" icon="download" href="/installation">
    Detailed installation instructions for all platforms
  </Card>
</CardGroup>

<Tip>
  Gradio requires Python 3.10 or higher. You can run it in your favorite code editor, Jupyter notebook, Google Colab, or anywhere else you write Python.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.