{"id":238,"library":"gradio","title":"Gradio","description":"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.","status":"active","version":"6.10.0","language":"python","source_language":"en","source_url":"https://www.gradio.app/changelog","tags":["ml-demo","web-ui","machine-learning","nlp","computer-vision","hugging-face","chatbot"],"install":[{"cmd":"pip install gradio","lang":"bash","label":"Standard"}],"dependencies":[{"reason":"Required. Web server backend. Installed automatically.","package":"fastapi","optional":false},{"reason":"Required. Installed automatically.","package":"pydantic>=2.0","optional":false},{"reason":"Required. Installed automatically.","package":"httpx","optional":false}],"imports":[{"note":"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'}]","wrong":"# gr.update() removed in 4.0 — AttributeError in 4.x+:\ndef update_textbox(text):\n    return gr.update(value=text, visible=True)  # AttributeError\n\n# Also wrong — old tuple chatbot format removed in 6.0:\nchatbot = gr.Chatbot(value=[['Hello', 'Hi there!']])  # breaks in 6.0","symbol":"gr.Interface","correct":"import gradio as gr\n\n# Simple Interface (gr.update() is gone — return values directly)\ndef greet(name, intensity):\n    return 'Hello, ' + name + '!' * intensity\n\ndemo = gr.Interface(\n    fn=greet,\n    inputs=[gr.Textbox(label='Name'), gr.Slider(1, 10, value=3)],\n    outputs=gr.Textbox(label='Greeting')\n)\ndemo.launch()"}],"quickstart":{"code":"import gradio as gr\n\n# Simple Interface\ndef classify_text(text):\n    return {'positive': 0.8, 'negative': 0.2}\n\ngr.Interface(\n    fn=classify_text,\n    inputs=gr.Textbox(label='Input Text'),\n    outputs=gr.Label(label='Sentiment')\n).launch()\n\n\n# Blocks API (more flexible)\ndef chat(message, history):\n    # history is list of dicts: [{role, content}, ...]\n    response = f'Echo: {message}'\n    return response\n\nwith gr.Blocks() as demo:\n    gr.Markdown('# My Chatbot')\n    chatbot = gr.Chatbot(type='messages')  # dict format required in 6.0\n    msg = gr.Textbox(label='Message')\n    btn = gr.Button('Send')\n    \n    def respond(message, history):\n        history.append({'role': 'user', 'content': message})\n        history.append({'role': 'assistant', 'content': f'Echo: {message}'})\n        return '', history\n    \n    btn.click(respond, [msg, chatbot], [msg, chatbot])\n\ndemo.launch(share=True)","lang":"python","description":"6.x API. Use type='messages' for gr.Chatbot. Return component instances, not gr.update()."},"warnings":[{"fix":"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)","message":"gr.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.","severity":"breaking","affected_versions":">= 4.0"},{"fix":"Use type='messages' in gr.Chatbot(type='messages'). Format history as: [{'role': 'user', 'content': msg}, {'role': 'assistant', 'content': response}]","message":"Chatbot 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': '...'}]","severity":"breaking","affected_versions":">= 6.0"},{"fix":"Pass theme at the app level instead: demo = gr.Blocks(); demo.theme = gr.themes.Soft(). Or use theme in gr.Interface(theme=...).","message":"theme= 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()).","severity":"breaking","affected_versions":">= 6.0"},{"fix":"Replace: demo.queue(concurrency_count=5) with per-event: btn.click(fn, ..., concurrency_limit=5). For unlimited: concurrency_limit=None.","message":"concurrency_count parameter removed in Gradio 4.0. Per-event concurrency_limit replaced it. queue=False also removed — use concurrency_limit=None instead.","severity":"breaking","affected_versions":">= 4.0"},{"fix":"Save output files to tempfile.NamedTemporaryFile() or the current working directory. Return the path from tempfile.","message":"In 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.","severity":"breaking","affected_versions":">= 5.0"},{"fix":"Upgrade to Python 3.10+. Pin gradio<5.0 for Python 3.9 environments.","message":"Python 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+.","severity":"gotcha","affected_versions":">= 5.0"},{"fix":"When using AI to generate Gradio code, explicitly prompt: 'Use Gradio 6.x API — no gr.update(), use messages dict format for Chatbot.'","message":"LLMs (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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2024':59 '2026':15 '3':27,61 '3.10':18 '4':28 '4.0':40 '5':29 '6':30,67 '6.0':50 '6.10.0':13 'app':9 'break':21 'build':5 'bump':23 'chatbot':45,85 'common':33 'compon':42 'comput':80 'computer-vis':79 'current':10 'demo':7,71 'dict':54 'direct':44 'face':84 'fail':65 'footgun':35 'format':47,55 'generat':60 'gr.update':36 'gradio':1 'hug':83 'hugging-fac':82 'instanc':43 'learn':77 'librari':3 'llm':34 'llms':56 'machin':76 'machine-learn':75 'major':20 'mar':14 'messag':53 'ml':6,70 'ml-demo':69 'must':51 'nlp':78 'pattern':63 'python':2,17 'rapid':25 'remov':38,48 'requir':16 'return':41 'success':26 'three':19 'train':57 'tupl':46 'ui':74 'use':52 'version':11,22 'vision':81 'web':8,73 'web-ui':72 'x':62,68","created_at":"2026-03-27T05:10:07.087286+00:00","updated_at":"2026-04-16T15:26:52.067823+00:00","problems":{"verify_error":"import timed out after 15s"},"ecosystem":"pypi","meta_description":null,"install_score":75,"quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"6.26.0","cli_name":"gradio","cli_version":"Usage: gradio [OPTIONS] DEMO_PATH","type":"library","homepage":"https://www.gradio.app","github":"https://github.com/gradio-app/gradio","docs":null,"changelog":null,"pypi":"https://pypi.org/project/gradio/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","ai-ml","llm-agents"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-27","next_check":"2026-07-05","install_tag":"reviewed"}}