Skip to main content
The configuration is organized into the following main sections:
  • [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.
disable_auth defaults to true, so omitting it leaves app endpoints callable without a token. Set disable_auth = false to require the JWT token described in the REST API reference.
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
Example with UV enabled:

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_uv is false)
While UV is compatible with most packages, some edge cases may cause build failures, such as legacy packages with non-standard metadata.

Deploying with UV Lock Files

Read only if you’re using pyproject.toml and uv.lock.
Generate your lock file locally. This creates a uv.lock file with exact dependency versions.
Export your locked dependencies to requirements.txt
Include in your deployment:
  • 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/endpoint

Hardware Configuration

The [cerebrium.hardware] section defines compute resources.
Memory refers to RAM, not GPU VRAM. Ensure sufficient memory for your workload.
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.
Setting min_replicas > 0 maintains warm instances for immediate response but increases costs.
The scaling_metric options are:
  • concurrency_utilization: Maintains a percentage of your replica_concurrency across instances. For example, with replica_concurrency=200 and scaling_target=80, maintains 160 requests per instance.
  • requests_per_second: Maintains a specific request rate across all instances. For example, scaling_target=5 maintains 5 requests/s average across instances.
  • cpu_utilization: Maintains CPU usage as a percentage of cerebrium.hardware.cpu. For example, with cpu=2 and scaling_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=10 and scaling_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.

Complete Example