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.
pip install gradioVerified import paths — ran on the pinned version, not inferred.
6.x API. Use type='messages' for gr.Chatbot. Return component instances, not gr.update().
Return a component instance directly: return gr.Textbox(value='text', visible=True). For multiple outputs, return a tuple: return gr.Textbox(value='text'), gr.Button(visible=False)
Use type='messages' in gr.Chatbot(type='messages'). Format history as: [{'role': 'user', 'content': msg}, {'role': 'assistant', 'content': response}]Pass theme at the app level instead: demo = gr.Blocks(); demo.theme = gr.themes.Soft(). Or use theme in gr.Interface(theme=...).
Replace: demo.queue(concurrency_count=5) with per-event: btn.click(fn, ..., concurrency_limit=5). For unlimited: concurrency_limit=None.
Save output files to tempfile.NamedTemporaryFile() or the current working directory. Return the path from tempfile.
Upgrade to Python 3.10+. Pin gradio<5.0 for Python 3.9 environments.
When using AI to generate Gradio code, explicitly prompt: 'Use Gradio 6.x API — no gr.update(), use messages dict format for Chatbot.'