Commercial enterprise offerings

Announcing Support for Gradio Application Hosting on Posit Connect

Written by Kelly O'Briant
2024-03-03
Gradio + Posit Connect

Get our email updates

Interested in learning more about Posit + Python tools? Join our email list.

Gradio is an open-source Python package with a thriving user community because it allows you to quickly build a demo or web application for your machine learning model, API, or any arbitrary Python function.

We added support for Gradio in Posit Connect because we want to make it easier for data scientists using popular Python and R frameworks to build and share interactive applications with others across their organization. Connect is ideal for supporting a range of use cases such as:

  • AI/ML model demos
  • AI chatbots
  • Prototyping tools for stakeholders
  • Production-ready interactive dashboards

To explore what you can build with Gradio, check out the following resources which provide sample code and inspiration:

If you’re already familiar with Gradio, you can now deploy your applications as easily as you would deploy Shiny, Streamlit, or Dash apps. The Posit Connect User Guide provides documentation for Gradio support. This functionality requires upgrading to the Posit Connect 2024.12.0 release or newer.

Deploying Gradio Apps

🎉There’s a brand new way to publish your work from VS Code and Positron

Skip all the steps below and try out the Posit Publisher extension to deploy your Gradio apps with the push of a button.

Step 1: Upgrade the rsconnect-python CLI

Ensure your CLI is up to date with the following command:

pip install --upgrade rsconnect-python

Step 2: Deploy Your Gradio App

Once the CLI is upgraded, navigate to your Gradio app’s directory and ensure that you specify the correct entrypoint for the application you are deploying. For example, if your app script is named app.py, and the application object is named demo, the entrypoint for your application would be app:demo, so you should use the following command:

rsconnect deploy gradio -n <saved server name> --entrypoint app:demo

Replace:

  • <saved server name> with your server nickname.
  • app:demo with your application entrypoint.

The CLI will package and deploy your Gradio app to the hosting environment.

If you are creating a manifest.json file for later deployment, you can use:

rsconnect write-manifest gradio --entrypoint app:demo

Additional documentation for using the rsconnect-python package to deploy can be found in the Posit Connect User Guide.

Step 3: Access Your Application

After deployment, you’ll receive a URL where your app is hosted. You can add viewers and collaborators to the access list and share the access link with others.

Feedback and Support

This functionality requires Posit Connect 2024.12.0 or newer. The 2024.12.0 release was published on December 18, 2024 and will be supported through June 30, 2026.

If you encounter any issues with upgrading or have questions about deploying Gradio apps on Connect, please reach out to our support team or consult our documentation.