Python library for building ML demo web apps. Current version is 6.10.0 (Mar 2026). Requires Python >=3.10. Three major breaking version bumps in rapid succession (3→4→5→6). The most common LLM footgun: gr.update() was removed in 4.0 — return component instances directly. Chatbot tuple format removed in 6.0 — must use messages dict format. LLMs trained before 2024 generate 3.x patterns that fail on 6.x.
Install & Compatibility
Where this runs
tested against v6.17.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
382MB installed
● package 382MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
gr.update() was removed in Gradio 4.0. Return component instances directly: return gr.Textbox(value='text', visible=True). Chatbot messages must use dict format in 6.0+: [{'role': 'user', 'content': 'Hello'}]
import gradio as gr
# Simple Interface (gr.update() is gone — return values directly)
def greet(name, intensity):
return 'Hello, ' + name + '!' * intensity
demo = gr.Interface(
fn=greet,
inputs=[gr.Textbox(label='Name'), gr.Slider(1, 10, value=3)],
outputs=gr.Textbox(label='Greeting')
)
demo.launch()
6.x API. Use type='messages' for gr.Chatbot. Return component instances, not gr.update().
import gradio as gr
# Simple Interface
def classify_text(text):
return {'positive': 0.8, 'negative': 0.2}
gr.Interface(
fn=classify_text,
inputs=gr.Textbox(label='Input Text'),
outputs=gr.Label(label='Sentiment')
).launch()
# Blocks API (more flexible)
def chat(message, history):
# history is list of dicts: [{role, content}, ...]
response = f'Echo: {message}'
return response
with gr.Blocks() as demo:
gr.Markdown('# My Chatbot')
chatbot = gr.Chatbot(type='messages') # dict format required in 6.0
msg = gr.Textbox(label='Message')
btn = gr.Button('Send')
def respond(message, history):
history.append({'role': 'user', 'content': message})
history.append({'role': 'assistant', 'content': f'Echo: {message}'})
return '', history
btn.click(respond, [msg, chatbot], [msg, chatbot])
demo.launch(share=True)
gradio --version
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.