gradio-app/gradio
Python-first framework for turning model callbacks into web UIs and APIs
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Gradio is a Python-first web framework, not an inference engine. The app binds a Python callable to browser components: an event supplies component values to the callable, and the return values update its declared outputs. Interface handles straightforward input/output forms, ChatInterface supplies a conversation UI, and Blocks lets authors wire layouts and multiple callbacks together.
The monorepo separates the Python implementation in gradio/ from the Svelte/Vite frontend workspace in js/ and the client code in client/. FastAPI is part of the web stack, and Hatchling builds the Python package. Named API endpoints let Python and JavaScript clients invoke app functions without operating the browser UI. When the generated UI is not a fit, gradio.Server provides a backend path for a custom frontend that retains Gradio's queue and streaming.
Key Capabilities & Differentiators
Gradio can wrap a local model, a call to an external API, or an ordinary Python function. It does not require a particular model family, provider, or serving engine. ChatInterface supplies the browser interaction layer for chat, while the application supplies the response logic. With Blocks, authors can feed one callback's outputs into another and change component properties or visibility in response to user actions.
The same application can serve browser users and expose named operations to programmatic clients. Server mode provides queueing, streaming, and MCP capabilities for teams that want to build their own frontend. This makes Gradio useful beyond chat, including multimodal demos and evaluation tools. Inference throughput, model compatibility, and accelerator needs still depend on the callable and its backend, not the UI framework.
Trade-offs & Limitations
Against building a FastAPI backend and a Svelte frontend separately, Gradio reduces the work of binding UI controls to Python callbacks and exposing those callbacks to clients. Blocks adds layout and event control without requiring a second application codebase. A separate frontend becomes more attractive when an existing design system, routing requirements, or application-wide authorization rules matter more than fast UI assembly. Server mode offers a middle ground if Gradio's backend features are still useful.
Queueing manages pending work; it does not add inference capacity. Size the host and tune concurrency around the model or upstream API, especially when interactions keep work active for long periods. Public share links are convenient for demos but should not replace a deployment with deliberate access controls and monitoring. Apache-2.0 permits commercial use, but does not grant rights to integrated models or datasets.
Hardware & Deployment Guide
Install Gradio in a Python 3.10+ environment with pip install --upgrade gradio. An app ending in demo.launch() can run with python app.py; the starter example serves at http://localhost:7860, and gradio app.py enables hot reload. Node.js 24+ and pnpm 10 are requirements for the frontend workspace, not for running a standard pip-installed app.
Local use does not require a public share link. For ongoing access, self-host the app or deploy it on Hugging Face Spaces; a share=True link exposes the running instance without moving compute off its host. Offline operation depends on models, dependencies, and assets already being available locally and on callbacks avoiding external APIs. The 6.33.0 release includes workflow responsiveness work, while @gradio/upload 0.19.2 fixes an image replacement issue during drag-and-drop.
Interface wraps callable inputs and outputs, ChatInterface builds a chatbot UI, and Blocks composes layouts and event flows.gradio_client in Python and @gradio/client in JavaScript.gradio.Server supports a custom frontend with Gradio's queue, streaming, and MCP capabilities.launch() serves locally; launch(share=True) creates a public URL while computation stays on the app host.Chat prototypes, multimodal model demos, and internal evaluation tools that need both a browser UI and programmatic access to Python callbacks.
You primarily need an inference engine or distributed serving platform, or a customer-facing product whose design system, routing, and authorization require an independently controlled frontend.
Quick Start & Installation
pip install --upgrade gradio
Comparison vs. Top Chat UI & AI Apps Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| gradio ★ | 44.2k | +81 | Python | Apache-2.0 | Python-first framework for turning model callbacks into web UIs and APIs |
| assistant-ui | 13.5k | +73 | TypeScript | MIT | Composable React chat UI with swappable runtimes for AI backends. |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/gradio-app/gradio.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about gradio
How do I expose an existing inference function to browsers and API clients?
Interface to wrap a callable with declared inputs and outputs, or ChatInterface for a chatbot. Set an endpoint name such as api_name="predict" for programmatic access via gradio_client or @gradio/client. If you want to build your own frontend but keep Gradio's queue and streaming, evaluate gradio.Server.Does Gradio require a GPU, and how should I size the host?
Can I self-host Gradio commercially?
When should I build a separate frontend and FastAPI backend instead?
Blocks for a more tailored layout without writing a separate frontend. A custom FastAPI application with an independent frontend is a better fit when an existing design system, routing model, or application-wide authorization rules need to drive the architecture.Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy