Label Studio applies timeouts to every request it makes to a connected ML backend. If your backend is slow to respond, or you're seeing timeout-related errors, this article covers what each timeout controls and how to adjust them.
Request types and what they control
- Health — checks ML backend health status when you add a new ML backend.
- Setup — initializes the ML backend/model.
- Predict — requests predictions from the ML backend.
- Train — requests training on the ML backend.
- Duplicate model — duplicates a model on the ML backend.
- Delete — sends a delete request to the ML backend.
- Train job status — requests the status of a training job.
Self-hosted / on-prem: adjusting timeouts
If you self-host Label Studio, you can override each timeout with an environment variable (values in seconds):
| Environment variable | Default | Controls |
|---|---|---|
ML_CONNECTION_TIMEOUT |
1 | Initial connection to the ML backend |
ML_TIMEOUT_DEFAULT |
100 | Fallback for any request type not set explicitly |
ML_TIMEOUT_TRAIN |
30 | Train requests |
ML_TIMEOUT_PREDICT |
100 | Predict requests |
ML_TIMEOUT_HEALTH |
1 | Health check requests |
ML_TIMEOUT_SETUP |
3 | Setup requests |
ML_TIMEOUT_DUPLICATE_MODEL |
1 | Duplicate model requests |
ML_TIMEOUT_DELETE |
1 | Delete requests |
ML_TIMEOUT_TRAIN_JOB_STATUS |
1 | Train job status requests |
These are defined in ml/api_connector.py in the Label Studio source.
Starter Cloud / SaaS: fixed defaults
On Label Studio Starter Cloud and other hosted plans, these timeouts are fixed and not user-configurable, since you don't have access to the underlying server environment. The current defaults are the same as the self-hosted defaults above (Predict and default requests: 100s, Train: 30s, Setup: 3s, Health/Duplicate model/Delete/Train job status: 1s).
If your ML backend legitimately needs longer than these limits (for example, a slow model on first load), consider having your backend respond to the health/setup check quickly and perform slower work asynchronously, rather than relying on a longer timeout.
Related articles
- Troubleshooting ML backend connection & startup issues
Consolidates "Label Studio default timeout settings for ML server requests" and "ML backend timeouts in SaaS cloud" into one article, and fixes a stale GitHub link (old heartexlabs org). Once published, the two source articles can be deleted.