# Gradio — Build ML Demos & AI Apps in Python > Python library for building interactive ML demos and AI web apps. Chat interfaces, file upload, image/audio/video I/O. Share with public link. 42K+ stars. ## Install Save in your project root: ## Quick Use ```bash pip install gradio ``` ```python import gradio as gr def greet(name): return f"Hello, {name}!" gr.Interface(fn=greet, inputs="text", outputs="text").launch() ``` Open `http://localhost:7860` — shareable with a public link via `share=True`. --- ## Intro Gradio is the standard Python library for building interactive ML demos and AI web applications. Create chat interfaces, image generators, audio processors, and data tools with a few lines of Python — no frontend code needed. Used by Hugging Face, Stability AI, and thousands of ML projects. Automatically generates a web UI and optional public share link. 42,000+ GitHub stars, Apache 2.0. **Best for**: ML engineers and researchers who need a quick web interface for their models **Works with**: Any Python ML library — PyTorch, TensorFlow, Hugging Face, OpenAI, Anthropic, Ollama --- ## Key Features ### Pre-Built Components 30+ I/O components: Textbox, Chatbot, Image, Audio, Video, File, DataFrame, Plot, Code, Markdown, and more. ### Chat Interface Production-ready chat UI in 3 lines: ```python gr.ChatInterface(fn=my_llm_function).launch() ``` ### Streaming Real-time streaming for LLM responses, audio, and video. ### Blocks API Full layout control for complex multi-component apps: ```python with gr.Blocks() as demo: with gr.Row(): input = gr.Textbox() output = gr.Textbox() btn = gr.Button("Submit") btn.click(fn=process, inputs=input, outputs=output) ``` ### Sharing `demo.launch(share=True)` generates a public URL — share your app instantly without deployment. ### Hugging Face Spaces Deploy Gradio apps to Hugging Face Spaces for free permanent hosting. --- ### FAQ **Q: What is Gradio?** A: A Python library for building ML demos and AI web apps with interactive UIs. Chat, images, audio, video — no frontend code needed. 42K+ stars, used by Hugging Face. **Q: How is Gradio different from Streamlit?** A: Gradio is ML-focused with specialized components (image/audio/video I/O, model inference). Streamlit is broader for data apps. Gradio has native Hugging Face Spaces integration. --- ## Source & Thanks > Created by [Gradio](https://github.com/gradio-app). Licensed under Apache 2.0. > [gradio-app/gradio](https://github.com/gradio-app/gradio) — 42,000+ GitHub stars --- Source: https://tokrepo.com/en/workflows/b30caf4b-a9a8-4379-b1c6-bc8f5cf5cce3 Author: AI Open Source