NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1520 most downloaded on PyPI
Python library for easily interacting with trained machine learning models
Last release 11 days ago
18 Sep 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 57 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
4 years old
121 releases · first in 2023
One column per quarter.
### Fixes - #8247 `8f46556` - Fix api recorder. Thanks @abidlabs!
### Features - #8264 `a9e1a8a` - Make exceptions in the Client more specific. Thanks @abidlabs! ### Fixes - #8276 `0bf3d1a` - Fix bug where client cou
### Fixes - #8245 `c562a3d` - Cancel server progress from the python client. Thanks @freddyaboulton!
It is now possible to load a demo with a custom component with gr.load.
72039be)It is now possible to load a demo with a custom component with gr.load.
The custom component must be installed in your system and imported in your python session.
import gradio as gr
import gradio_pdf
demo = gr.load("freddyaboulton/gradiopdf", src="spaces")
if __name__ == "__main__":
demo.launch()
<img width="1284" alt="image" src="https://github.com/gradio-app/gradio/assets/41651716/9c3e846b-f3f2-4c1c-8cb6-53a6d186aaa0">
Thanks @freddyaboulton!
### Features - #13329 `7ac583a` - Make builds go zoom zoom. Thanks @pngwn! ### Dependency updates - @gradio/client@2.4.0 - @gradio/utils@0.14.0 - @gra
2afca65)We have added a max_file_size size parameter to launch() that limits to size of files uploaded to the server. This limit applies to each individual file. This parameter can be specified as a string or an integer (corresponding to the size in bytes).
The following code snippet sets a max file size of 5 megabytes.
import gradio as gr
demo = gr.Interface(lambda x: x, "image", "image")
demo.launch(max_file_size="5mb")
# or
demo.launch(max_file_size=5 * gr.FileSize.MB)
When a component encounters an error, the error state shown in the UI can now be cleared by clicking on the x icon in the top right of the component. This applies to all types of errors, whether it's raised in the UI or the server.
Thanks @freddyaboulton!
### Dependency updates - @gradio/icons@0.16.0 - @gradio/atoms@0.26.0
Features #13805 265680d - Load large Dropdown choices progressively on scroll. Thanks @abidlabs ! Dependency updates @gradio/atoms@0.26.2 @gradio/util
6a4bf7a)Gradio now automatically deletes gr.State variables stored in the server's RAM when users close their browser tab.
The deletion will happen 60 minutes after the server detected a disconnect from the user's browser.
If the user connects again in that timeframe, their state will not be deleted.
Additionally, Gradio now includes a Blocks.unload() event, allowing you to run arbitrary cleanup functions when users disconnect (this does not have a 60 minute delay).
You can think of the unload event as the opposite of the load event.
with gr.Blocks() as demo:
gr.Markdown(
"""# State Cleanup Demo
🖼️ Images are saved in a user-specific directory and deleted when the users closes the page via demo.unload.
""")
with gr.Row():
with gr.Column(scale=1):
with gr.Row():
img = gr.Image(label="Generated Image", height=300, width=300)
with gr.Row():
gen = gr.Button(value="Generate")
with gr.Row():
history = gr.Gallery(label="Previous Generations", height=500, columns=10)
state = gr.State(value=[], delete_callback=lambda v: print("STATE DELETED"))
demo.load(generate_random_img, [state], [img, state, history])
gen.click(generate_random_img, [state], [img, state, history])
demo.unload(delete_directory)
demo.launch(auth=lambda user,pwd: True,
auth_message="Enter any username and password to continue")
Thanks @freddyaboulton!
### Features - #13526 `53cb4ca` - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs! ### Dependency updates - @gradio/atoms@0.25.0 - @gradio/sta
53cb4ca - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs!a11c728 - Re-translate i18n choices display names when the language is switched at runtime. Thanks @hysts!9d83502 - Make dropdowns accessible to screen readers (combobox ARIA pattern). Thanks @hysts!0ee5cc8 - Preserve browser-visible proxy origins for frontend assets and API requests, and retain app-level FastAPI root paths. Thanks @abidlabs!7ac583a - Make builds go zoom zoom. Thanks @pngwn!### Features - #13526 `53cb4ca` - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs! ### Dependency updates - @gradio/atoms@0.25.0 - @gradio/sta
53cb4ca - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs!a11c728 - Re-translate i18n choices display names when the language is switched at runtime. Thanks @hysts!### Features - #13526 `53cb4ca` - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs! - #13534 `a11c728` - Re-translate i18n choices display name
e5ec1ca - Fix fullscreen button not working in ImageSlider, interactive Image, native plots, and AnnotatedImage. Thanks @hysts!aab9fcf - workflow: add styling to input nodes. Thanks @hannahblair!abf6825 - workflow: add pending node UI. Thanks @hannahblair!5ab610f - workflow: add getting started templates. Thanks @hannahblair!### Features - #13516 `8ec4cbc` - Translate i18n choices display names in choice-based components. Thanks @hysts!
429faeb - Ensure every component dispatches a change event when its value changes. Thanks @abidlabs!7e83999 - add server-side run history in HF Hub buckets. Thanks @hannahblair!f881a04 - workflow: move delete button. Thanks @hannahblair!b7ce915 - workflow: ensure text outputs stream. Thanks @hannahblair!44f8712 - wf: delete button v2. Thanks @hannahblair!40dbb52 - workflow: improve mobile experience. Thanks @hannahblair!1e9b643 - workflow: node value meta + a markdown node type. Thanks @abidlabs!e7fd8f4 - workflow: inference hardcoded endpoint improvements. Thanks @hannahblair!d37d528 - workflow: improve handling of Any output type. Thanks @hannahblair!375bfd2 - Fix server_messages.py to use the patched BaseModel class for Wasm env. Thanks @aliabid94!Features #13770 2cb02c0 - Upgrade vulnerable frontend dependencies. Thanks @abidlabs ! Dependency updates @gradio/sanitize@0.4.2
### Features - #13526 `53cb4ca` - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs! ### Dependency updates - @gradio/atoms@0.25.0 - @gradio/sta
429faeb - Ensure every component dispatches a change event when its value changes. Thanks @abidlabs!5824703 - workflows: allow save as copy. Thanks @hannahblair!375335e - Keep workflow canvas layout per-viewer, and add undo/redo. Thanks @abidlabs!49d9c48 - [WIP] Refactor file normalization to be in the backend and remove it from the frontend of each component. Thanks @abidlabs!6dfd40f - Make set_documentation_group a no-op. Thanks @freddyaboulton!b95d0d0 - Allow setting custom headers in Python Client. Thanks @abidlabs!### Features - #13526 `53cb4ca` - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs! ### Dependency updates - @gradio/atoms@0.25.0 - @gradio/sta
a79d94a - workflow: fix oauth logic check. Thanks @hannahblair!b7ed7cf - workflow: fix checkbox visibility. Thanks @hannahblair!e9dabaa - Allow saving Workflow to the Space itself. Thanks @hannahblair!0fddd0f - Determine documentation group automatically. Thanks @akx!68a54a7 - Improve chatbot streaming performance with diffs. Thanks @aliabid94!/n Note that this PR changes the API format for generator functions, which would be a breaking change for any clients reading the EventStream directly3c8c4ac - Document the gr.ParamViewer component, and fix component preprocessing/postprocessing docstrings. Thanks @abidlabs!05d8a3c - Update ruff to 0.1.13, enable more rules, fix issues. Thanks @akx!### Dependency updates - @gradio/image@0.28.0 - @gradio/client@2.3.1 - @gradio/upload@0.18.1
e0f0790 - Workflow: only inline app-owned files, and keep opened HTML off the app origin. Thanks @abidlabs!1fc8a94 - fix lint. Thanks @freddyaboulton!64c65d8 - Add encoding to open/writing files on the deploy_discord function. Thanks @WilliamHarer!### Features - #13526 `53cb4ca` - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs! ### Dependency updates - @gradio/atoms@0.25.0 - @gradio/sta
3353446 - Expose live camera and slider position to event handlers. Thanks @abidlabs!/n camera_position on gr.Model3D and slider_position on gr.ImageSlider now follow the user, so a function whose parameter is annotated with the component reads the view that is actually on screen. Both can still be set from the backend to move the camera or the divider./n Also fixes, in the same area:/n - camera_position is applied on load for display_mode="point_cloud" and display_mode="wireframe", not only for "solid"./n - camera_position is applied to interactive (uploadable) gr.Model3D, and slider_position to interactive gr.ImageSlider; both previously ignored it./n - pan_speed is passed through to the gr.Model3D viewer; it was silently stuck at its default./n - A Model3D camera observer was added on every camera update without ever being removed; exactly one is now registered, and it is cleaned up with the component.### Fixes - #6693 `34f9431` - Python client properly handles hearbeat and log messages. Also handles responses longer than 65k. Thanks @freddyaboulton
34f9431 - Python client properly handles hearbeat and log messages. Also handles responses longer than 65k. Thanks @freddyaboulton!### Dependency updates - @gradio/utils@0.14.0 - @gradio/atoms@0.26.1 - @gradio/statustracker@0.15.2
7cbf96e - Issue 5245: consolidate usage of requests and httpx. Thanks @cswamy!24e0481 - Hotfix: update huggingface_hub dependency version. Thanks @abidlabs!8a70e83 - switch from black to ruff formatter. Thanks @DarhkVoyd!d76bcaa - Fix api event drops. Thanks @aliabid94!### Dependency updates - @gradio/client@2.4.0 - @gradio/utils@0.14.0 - @gradio/atoms@0.26.1 - @gradio/statustracker@0.15.2 - @gradio/upload@0.18.2
### Features - #13526 `53cb4ca` - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs! ### Dependency updates - @gradio/atoms@0.25.0 - @gradio/sta
429faeb - Ensure every component dispatches a change event when its value changes. Thanks @abidlabs!2e9eb51 - Restore select-all checkbox in boolean column headers of gr.Dataframe. Thanks @pngwn!6302098 - gr.Workflow: auto-create input/output nodes for model nodes (as already happens for Space nodes), replace the "Input"/"Output" buttons with a single "Component" button whose direction is derived from wiring, rename "Data" to "Dataset", let node error messages be copied, and document the oauth_token parameter in the View API panel. Thanks @abidlabs!321361f - Workflow: resizable nodes, full-screen image view, and webcam/mic capture. Thanks @abidlabs!### Features - #6094 `c476bd5a5` - Image v4. Thanks @pngwn! - #6069 `bf127e124` - Swap websockets for SSE. Thanks @aliabid94!
### Features - #5498 `85ba6de13` - Simplify how files are handled in components in 4.0. Thanks @pngwn! - #5498 `85ba6de13` - Rename gradio_component t
### Dependency updates - @gradio/statustracker@0.15.1 - @gradio/atoms@0.26.0
1d5b15a2d - Assert refactor in external.py. Thanks @harry-urek!### Features - #13526 `53cb4ca` - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs! ### Fixes - #13533 `e5ec1ca` - Fix fullscreen button not wo
429faeb - Ensure every component dispatches a change event when its value changes. Thanks @abidlabs!d07af9d - workflow: add model endpoint integration. Thanks @hannahblair!2f6d04a - workflow: improve canvas authoring and examples. Thanks @abidlabs!3473879 - workflow: add html modality. Thanks @hannahblair!d3c70fa - workflow: various UX improvements, including opening the write-access link in a browser tab automatically when a gr.Workflow is launched locally, and calling vision-language models through chat completions so image-text-to-text model nodes work. Thanks @abidlabs!d5ef897 - workflow: fix error banner and textarea visibility. Thanks @hannahblair!a2ddecf - workflow: ensure we handle trailing null values. Thanks @hannahblair!0286f2c - workflow: use anyio.to_thread to send sync server functions to thread pool. Thanks @hannahblair!FileExplorer component (#5672 e4a307ed6)Thanks to a new capability that allows components to communicate directly with the server without passing data via the value, we have created a new FileExplorer component.
This component allows you to populate the explorer by passing a glob, but only provides the selected file(s) in your prediction function.
Users can then navigate the virtual filesystem and select files which will be accessible in your predict function. This component will allow developers to build more complex spaces, with more flexible input options.
For more information check the FileExplorer documentation.
Thanks @aliabid94!
Nothing published for this version
Nothing published for this version
Nothing published for this version
### Features - #5721 `84e03fe50` - Adds copy buttons to website, and better descriptions to API Docs. Thanks @aliabd!
### Dependency updates - @gradio/utils@0.14.0 - @gradio/atoms@0.26.1 - @gradio/statustracker@0.15.2
### Dependency updates - @gradio/utils@0.13.0 - @gradio/client@2.3.0 - @gradio/button@0.8.0
52f783175 - refactor: Use package.json for version management. Thanks @DarhkVoyd!### Features - #13502 `429faeb` - Ensure every component dispatches a change event when its value changes. Thanks @abidlabs!
429faeb - Ensure every component dispatches a change event when its value changes. Thanks @abidlabs!784eb53 - workflow: show downstream output on subgraph run. Thanks @hannahblair!59968e8 - workflow: update input change handling. Thanks @hannahblair!55241c8 - workflow: auto add node on port click. Thanks @hannahblair!53cb4ca - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs!a11c728 - Re-translate i18n choices display names when the language is switched at runtime. Thanks @hysts!390624d8)The gradio_client now supports streaming file outputs 🌊
No new syntax! Connect to a gradio demo that supports streaming file outputs and call predict or submit as you normally would.
import gradio_client as grc
client = grc.Client("gradio/stream_audio_out")
# Get the entire generated audio as a local file
client.predict("/Users/freddy/Pictures/bark_demo.mp4", api_name="/predict")
job = client.submit("/Users/freddy/Pictures/bark_demo.mp4", api_name="/predict")
# Get the entire generated audio as a local file
job.result()
# Each individual chunk
job.outputs()
Thanks @freddyaboulton!
7b8fa8aa - Allow caching examples with streamed output. Thanks @aliabid94!### Features - #13526 `53cb4ca` - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs! ### Dependency updates - @gradio/atoms@0.25.0 - @gradio/uti
53cb4ca - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs!d4d340d - Run gr.Workflow subgraphs via the Gradio API — each subgraph is exposed as a named endpoint (returning all of its outputs) reusing /info, /call, and /api, with a "View API" panel in the canvas. Thanks @abidlabs!35856f8b)Previously, Client.predict would only return the first output of an endpoint that streamed results. This was causing confusion for developers that wanted to call these streaming demos via the client.
We realize that developers using the client don't know the internals of whether a demo streams or not, so we're changing the behavior of predict to match developer expectations.
Using Client.predict will now return the final output of a streaming endpoint. This will make it even easier to use gradio apps via the client.
Thanks @freddyaboulton!
2745075a - Add deploy_discord to docs. Thanks @freddyaboulton!### Features - #13526 `53cb4ca` - Run pnpm lint and pnpm ts:check on CI. Thanks @abidlabs! ### Dependency updates - @gradio/atoms@0.25.0 - @gradio/sta
e547392 - workflow: update pipeline UX around pro accounts. Thanks @hannahblair!100eaf2 - workflow: implement drag selection. Thanks @hannahblair!429faeb - Ensure every component dispatches a change event when its value changes. Thanks @abidlabs!9362fd9 - Use local HF token in Workflow, gated behind a write-token auth model. Thanks @abidlabs!87f42b9 - workflow: preserve dropdown, radio and checkbox inputs. Thanks @hannahblair!965a36c - workflow: dont render nodes for optional params on spawn. Thanks @hannahblair!46e4ef67)We're excited to announce that Gradio can now automatically create a discord bot from any gr.ChatInterface app.
It's as easy as importing gradio_client, connecting to the app, and calling deploy_discord!
🦙 Turning Llama 2 70b into a discord bot 🦙
import gradio_client as grc
grc.Client("ysharma/Explore_llamav2_with_TGI").deploy_discord(to_id="llama2-70b-discord-bot")
<img src="https://gradio-builds.s3.amazonaws.com/demo-files/discordbots/guide/llama_chat.gif">
To help get you started, we have created an organization on Hugging Face called gradio-discord-bots with template spaces you can use to turn state of the art LLMs powered by Gradio to discord bots.
Currently we have template spaces for:
But once again, you can deploy ANY gr.ChatInterface app exposed on the internet! So don't hesitate to try it on your own Chatbots.
❗️ Additional Note ❗️: Technically, any gradio app that exposes an api route that takes in a single string and outputs a single string can be deployed to discord. But gr.ChatInterface apps naturally lend themselves to discord's chat functionality so we suggest you start with those.
Thanks @freddyaboulton!
submit and view_api methods. Output layout components are not returned by the API but all other components are (excluding gr.State). By @freddyaboulton in PR 4871No changes to highlight
No changes to highlight.
No changes to highlight.
No changes to highlight
api_name=False by @freddyboulton in PR 4886No changes to highlight.
gradio_client due to changes in downstream dependencies by @abidlabs in PR 4885No changes to highlight.
No changes to highlight.
output_dir parameter in Client by @abidlabs in PR 4501No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
serialize=False by @abidlabs in PR 4230No changes to highlight.
No changes to highlight.
Barplot, Lineplot, Scatterplot, AnnotatedImage, Interpretation by @abidlabs in PR 4167No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
gr.File(file_count='multiple') output components by @freddyaboulton in PR 4153No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
/info route if demo version is above 3.28.3 by @freddyaboulton in PR 4109No changes to highlight.
No changes to highlight.
Removes extraneous State component info from the Client.view_api() method by @abidlabs in PR 4107
No changes to highlight.
Separates flaky tests from non-flaky tests by @abidlabs in PR 4107
No changes to highlight.
No changes to highlight.
No changes to highlight.
gr.Progress() can be accessed via job.status().progress_data by @freddyaboulton](https://github.com/freddyaboulton) in PR 3924api_name instead of fn_index in view_api by @freddyaboulton in PR 3972No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
Video components in latest gradio were not able to be deserialized by @freddyaboulton in PR 3860No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
No changes to highlight.
First public release of the Gradio Client library! The gradio_client Python library that makes it very easy to use any Gradio app as an API.
As an example, consider this Hugging Face Space that transcribes audio files that are recorded from the microphone.
Using the gradio_client library, we can easily use the Gradio as an API to transcribe audio files programmatically.
Here's the entire code to do it:
from gradio_client import Client
client = Client("abidlabs/whisper")
client.predict("audio_sample.wav")
>> "This is a test of the whisper speech recognition model."
Read more about how to use the gradio_client library here: https://gradio.app/getting-started-with-the-python-client/
### Dependency updates - @gradio/statustracker@0.15.1 - @gradio/atoms@0.26.0
### Dependency updates - @gradio/atoms@0.25.0 - @gradio/statustracker@0.15.0 - @gradio/utils@0.13.0 - @gradio/column@0.4.0
### Dependency updates - @gradio/atoms@0.24.0 - @gradio/statustracker@0.14.1
Nothing published for this version
Nothing published for this version
### Dependency updates - @gradio/utils@0.14.0
### Dependency updates - @gradio/utils@0.13.0
Nothing published for this version
### Features - #13497 `c26e797` - fix workflow canvas repo.url. Thanks @pngwn!
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →