Gradio 5 will launch in October with improvements across security, performance, SEO, design, and user experience, making Gradio a mature framework for web-based ML applications.

This document covers the major features in Gradio 5 as well as tips for migrating from Gradio 4 to 5, including a list of the breaking changes and soft deprecations. Gradio 5 is currently in beta.

Major Features

⚡ Performance: Whenever possible (and particularly on Spaces), Gradio 5 is now served via server-side rendering (SSR). Gradio apps served via SSR load much faster and have better SEO.

Screen Recording 2024-09-20 at 11.29.39 PM.mov

🎨 UI Refresh: We have redesigned many components in Gradio 5.0 to have a modern UI, with particular focus being on the following components: Button, Tab, Slider , JSON as well as on the high-level ChatInterface class for chatbot UIs. We’ve adjusted borders, shading, fonts, and dark-mode colors globally to provide a crisper and more modern look.

Screenshot 2024-09-02 at 23.56.41.png

Screenshot 2024-09-03 at 00.25.57.png

Screenshot 2024-09-02 at 23.59.01.png

Screenshot 2024-09-03 at 00.26.27.png

🎤 Streaming Media: Streaming audio, images, and video as input and output are now fully supported in Gradio. We have switched to using the HTTP Live Streaming protocol for streaming media, which provides a much better UX for streaming audio and video to end users. We’ve also provided more control to developers for streaming in media with intuitive parameters that let developers control the frequency of streams and how users should queue for streaming demos. Please see this guide for more details on output streaming and this guide for input streaming.

🔒 Security: The Gradio team partnered with Trail-of-Bits (ToB) to conduct a security review of Gradio. ToB found 27 security issues of varying severity, including some high-severity issues that compromised files on any computer or Space that shared a Gradio application publicly (final report, internal link). All of these issues have been fixed in Gradio 5, with the exception of one SSRF-related issue that we are currently fixing, as confirmed by ToB.

🪄 AI Playground (Experimental): Gradio now includes an AI-assisted playground that allows you to generate Gradio apps from a prompt and view the results immediately in your browser. This AI playground is a great way to generate simple Gradio apps or make modifications to your Gradio application. Link is here: https://5-0-dev.gradio-website.pages.dev/playground (Only available on desktop). The AI Playground is still a work in progress and may sometimes output code that is incorrect or use libraries that are unsupported by Gradio Lite. We will continue to make it better over time.

Migrating to Gradio 5

Installing Gradio 5

Gradio 5 depends on Python 3.10 or higher, so if you are running Gradio locally, please ensure that you have Python 3.10 or higher, or download it here: https://www.python.org/downloads/

We have released a beta version of Gradio 5.0, which you can run locally or on Spaces:

In most cases, that’s all you have to do to run Gradio 5.0. If you start your Gradio application, you should see your Gradio app running, with a fresh new UI. However, if you want to also get performance and SEO gains, read on…

(Optional) Server-Side Rendering