Registry / web-framework / gradio

gradio

JSON →
library6.10.0pypypiunverified

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.

web-frameworkai-mlllm-agents
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
musl
glibc
py 3.10
✓ —
✓ 17.03s
py 3.11
✓ —
✓ 16.23s
py 3.12
✓ —
✓ 14.7s
py 3.13
✓ —
✓ 14.77s
py 3.9
3/5 runs
3/5 runs
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
Debug
Known footguns
breakinggr.update() was removed in Gradio 4.0. The entire pattern of returning gr.Textbox.update(value='x') or gr.update(visible=True) raises AttributeError. This is the #1 footgun from LLM-generated code using old Gradio docs.
breakingChatbot tuple format ([['user', 'assistant'], ...]) removed in Gradio 6.0. gr.Chatbot() and gr.ChatInterface() now require dict messages format: [{'role': 'user', 'content': '...'}, {'role': 'assistant', 'content': '...'}]
breakingtheme= parameter removed from gr.Blocks() in Gradio 6.0. TypeError: BlockContext.__init__() got an unexpected keyword argument 'theme'. Breaks all apps using gr.Blocks(theme=gr.themes.Soft()).
breakingconcurrency_count parameter removed in Gradio 4.0. Per-event concurrency_limit replaced it. queue=False also removed — use concurrency_limit=None instead.
breakingIn Gradio 5.0+, functions can only return files in the current working directory or temp directory. Returning absolute paths to arbitrary system files is blocked for security.
gotchaPython 3.10 is now the minimum. Running Gradio on Python 3.9 may lead to dependency conflicts, such as `ImportError: cannot import name 'HfFolder' from 'huggingface_hub'`, as newer Gradio versions and their dependencies are designed for Python 3.10+.
gotchaLLMs (including ChatGPT and Copilot) frequently generate Gradio 3.x code with gr.update() and tuple chatbot format that fails on 6.x. Always verify which Gradio version the generated code targets.
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.

Agent activity
28 hits · last 30 days
bytedance
6
claudebot
5
gptbot
4
dotbot
3
ahrefsbot
3
bingbot
1
duckduckgo
1
Resources