- [cerebrium.deployment] Core settings like app name, Python version, and file inclusion rules
- [cerebrium.runtime.custom] Custom web server settings and app startup behavior
- [cerebrium.hardware] Compute resources including CPU, memory, and GPU specifications
- [cerebrium.scaling] Auto-scaling behavior and replica management
- [cerebrium.dependencies] Package management for Python (pip), system (apt), and Conda dependencies
Deployment Configuration
The[cerebrium.deployment] section defines core deployment settings.
Changes to python_version or docker_base_image_url trigger full rebuilds since
they affect the base environment.
UV Package Manager
UV is a fast Python package installer written in Rust that significantly speeds up deployment times. When enabled, UV replaces pip for installing Python dependencies.UV typically installs packages 10-100x faster than pip, especially beneficial for:
- Large dependency trees
- Multiple packages
- Clean builds without cache
Monitoring UV Usage
Check your build logs for these indicators:- UV_PIP_INSTALL_STARTED - UV is successfully being used
- PIP_INSTALL_STARTED - Standard pip installation (when
use_uvisfalse)
Deploying with UV Lock Files
Read only if you’re using
pyproject.toml and uv.lock.- Ensure requirements.txt is in your project directory
- Deploy with UV enabled
Runtime Configuration
The[cerebrium.runtime.custom] section configures custom web servers and runtime behavior.
The port specified in entrypoint must match the port parameter. All endpoints
will be available at
https://api.cerebrium.ai/v4/p-xxxxxxxx/your-app-name/your/endpointHardware Configuration
The[cerebrium.hardware] section defines compute resources.
compute accepts a single type or a preference-ordered list, e.g. compute = ["HOPPER_H100", "AMPERE_A100_80GB"]. See GPU preference
lists. Placement is covered in
Multi-Region Deployment.Scaling Configuration
The[cerebrium.scaling] section controls auto-scaling behavior.
The
scaling_metric options are:
- concurrency_utilization: Maintains a percentage of your replica_concurrency across instances. For example, with
replica_concurrency=200andscaling_target=80, maintains 160 requests per instance. - requests_per_second: Maintains a specific request rate across all instances. For example,
scaling_target=5maintains 5 requests/s average across instances. - cpu_utilization: Maintains CPU usage as a percentage of cerebrium.hardware.cpu. For example, with
cpu=2andscaling_target=80, maintains 80% CPU utilization (1.6 CPUs) per instance. - memory_utilization: Maintains RAM usage as a percentage of cerebrium.hardware.memory. For example, with
memory=10andscaling_target=80, maintains 80% memory utilization (8GB) per instance.
The scaling_buffer option is only available with concurrency_utilization and requests_per_second metrics.
It ensures extra capacity is maintained above what the scaling metric suggests.For example, with
min_replicas=0 and scaling_buffer=3, the system will maintain 3 replicas as baseline capacity.Dependencies
Pip Dependencies
The[cerebrium.dependencies.pip] section lists Python package requirements.
APT Dependencies
The[cerebrium.dependencies.apt] section specifies system packages.
Conda Dependencies
The[cerebrium.dependencies.conda] section manages Conda packages.
Dependency Files
The[cerebrium.dependencies.paths] section allows using requirement files.