Button guide

Gradio alternatives when the share link expires 5 ways to keep a script or model available to coworkers

When a share=True link dies, you can either host the Gradio app somewhere permanent like Hugging Face Spaces, put your own tunnel and login in front of it with Cloudflare, or switch to a tool built for sharing scripts with a team. If you just need colleagues to feed inputs or files into a script on your machine and get the output back, Button (https://button.bitgate.dev) gives it a stable tool page and email-based sign-in without you writing UI code. The Free plan is $0 for 1 published tool, 3 people and 100 runs per month, and individual runs can last up to 30 minutes with up to 100 MB of files.

What you are actually replacing when share=True stops working

Gradio puts web UIs around Python functions and ML models. launch(share=True) gives you a public *.gradio.live link tunneled back to your own machine. The link lasts at most about a week, can drop earlier, and only works while your computer and that Python process are running.

Access control is the other gap. launch(auth=...) takes a single username and password pair, a list of pairs, or a custom auth function, so there is no built-in way to invite someone by email. By default, each event handler processes one request at a time (default_concurrency_limit is 1), and there is no default max upload size unless you pass launch(max_file_size=...).

Here is how the five paths compare when you need the link to stay up.

Option Runs on Stable link Access control Cost Key limits
Gradio share=True Your machine No (lasts at most about a week) launch(auth=...) username/password pairs or function Free 1 request at a time per handler by default; no default max file size
Hugging Face Spaces Hugging Face cloud Yes Public, protected, or private Free (CPU Basic); $0.03/hour for CPU Upgrade Free hardware (2 vCPU, 16 GB RAM, 50 GB non-persistent disk) sleeps after 48 hours of inactivity
Self-hosted Gradio + Cloudflare Access Your machine Yes Cloudflare Access login Free up to 50 users Machine and Python process must stay on
Streamlit Community Cloud Streamlit cloud Yes Email invite (Google or emailed link) on 1 private app Free 1 private app; sleeps after 12 hours of no traffic; up to ~2.7 GB RAM; 200 MB default upload
Button Your machine Yes Email invite (Google or one-time email code) $0 Free (1 tool, 3 people, 100 runs/mo); $15/mo Pro ($144/yr) 25 MB per file, 8 files / 100 MB per run, 30 min per run, 1 run at a time per computer

1. Hugging Face Spaces

If you want to keep your Gradio code as-is and stop tying the app to your own computer, put it on Hugging Face Spaces. Spaces hosts Gradio and Streamlit apps directly, and a Space can be set to public, protected, or private.

The free CPU Basic tier gives you 2 vCPU, 16 GB RAM, and 50 GB of non-persistent disk. If nobody visits the Space for 48 hours, it goes to sleep and wakes back up on the next visit. If you need more than that, the cheapest paid hardware is CPU Upgrade (8 vCPU, 32 GB RAM) at $0.03 per hour.

Stick with Gradio on Spaces when your tool is an ML demo that needs rich inputs and outputs like images, audio, or chat, and the model and its dependencies fit on Hugging Face's hardware.

2. Self-hosted Gradio behind Cloudflare Access

When the model or data has to stay on your own hardware - maybe because of a local GPU - and you still need the Gradio interface for images, audio, or chat, you can replace Gradio's built-in tunnel with Cloudflare's.

Cloudflare Tunnel (cloudflared) is free on all plans, and Cloudflare Zero Trust (Access) is free for up to 50 users and puts a login screen in front of the tunneled app. Your computer and the Gradio Python process still have to stay on, just like with share=True, and each event handler still defaults to default_concurrency_limit of 1 unless you change it.

3. Button (run the script on your machine, skip the UI code)

A lot of internal Gradio apps aren't really ML demos; somebody just wrapped a Python script in gr.Interface because it was the fastest way to give a coworker a file upload box and a Run button. If that's what you built, Button (https://button.bitgate.dev) turns a script on your computer into a web form your colleagues can run, without keeping a Gradio server process alive or maintaining UI code. And it isn't limited to Python - Node, R, PowerShell, shell scripts, and compiled binaries all work.

Jobs run on your computer, never in Button's cloud. Button's servers relay the form values and files between the colleague's browser and your machine. Your computer has to be on and online, and the tool page shows coworkers whether your machine is Ready, Busy, or Offline.

To move a Gradio-wrapped script over to Button:

  1. Strip out the Gradio code and make the script take its inputs as command-line arguments (argparse in Python, commandArgs() in R, a param() block in PowerShell, or $1 and $2 in bash) rather than hard-coded paths or interactive prompts. Take each input file path as an argument, and write the results out as files into an output folder that is also passed in as an argument.
  2. Sign in at button.bitgate.dev and install the Button runner on your macOS, Linux, or Windows computer using the one-line command the site shows you (curl on macOS and Linux, PowerShell on Windows).
  3. Open the local setup page, pick your program, describe its inputs (text, number, yes/no, choice, or files), and publish. Button gives the tool its own page.

Here is what the argument setup looks like in Python once you take gradio out:

import argparse
import pathlib

parser = argparse.ArgumentParser()
parser.add_argument("--currency")
parser.add_argument("input_file", type=pathlib.Path)
parser.add_argument("output_dir", type=pathlib.Path)
args = parser.parse_args()

The runner only executes the exact command you approved on that computer, pinned by hash, passes every form value as its own argument with no shell, and rejects values that start with -. If you change a tool later, people have to confirm the new version before running it.

When you invite colleagues, they open the link from their invite email, sign in with Google or a one-time email code, fill in the form, press Run, and download the results. They install nothing and never pay. Every run is logged with who ran it and when, and you can revoke access or set it to expire at any time.

Be aware of the limits before you switch: files can be up to 25 MB each, up to 8 files and 100 MB total per run, 30 minutes per run, one run at a time per computer, and logs up to 1 MB per run. Inputs are deleted 24 hours after a run ends, and outputs after 7 days. Every plan allows one computer (runner) per workspace, so pairing a new computer replaces the previous one.

On pricing, Free is $0 for 1 published tool, 3 people, 100 runs and 1 GB of file transfer per month; Pro is $15/month, or $144/year, for 50 tools, 250 people, 5,000 runs and 50 GB. Your own runs count toward the monthly total, and downgrading deletes nothing.

4. Streamlit Community Cloud

If you are willing to rewrite the UI in another Python framework, Streamlit is the usual alternative for data apps. st.file_uploader accepts files up to 200 MB by default, and st.download_button returns files to the user.

Streamlit Community Cloud is free and deploys apps from GitHub. You get one private app at a time, and viewers you invite by email sign in with Google or an emailed link. Apps with no traffic for 12 hours go to sleep and wake on the next visit, and documented resources go up to about 2.7 GB of memory.

FAQ

At most about a week: current Gradio docs say launch(share=True) links expire after 1 week (an older guide says 72 hours), and a link can drop earlier. It also stops working when your computer sleeps or you stop the Python process.

Yes, you can pass a username/password pair, a list of pairs, or an auth function to launch(auth=...). There is no built-in way to invite coworkers by email, and the share link itself will still expire after at most a week.

Where do jobs run when someone uses my Button tool?

Jobs always run on your own computer, never in Button's cloud. Button's servers relay the form values and files between your colleague's browser and your computer, and inputs are deleted 24 hours after a run ends while outputs are deleted after 7 days.

When should I keep using Gradio instead of switching to Button?

Keep Gradio when you are sharing an interactive ML demo that needs rich inputs and outputs like images, audio, or a chat interface, or when you need files larger than Button's 25 MB per-file (100 MB per-run) limit. Button is built for form-in, files-out scripts that run for up to 30 minutes and return downloadable results.

Last updated

Put your script behind a form

Button turns a script on your computer into a web form. Colleagues sign in, fill it in, press Run and download the results. Free for 1 tool and 3 people.