Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 35 additions & 45 deletions toml-reference/toml-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ The configuration is organized into the following main sections:
- **[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
- **[cerebrium.build]** Build optimizations including UV package manager support (Optional)

## Deployment Configuration

Expand All @@ -26,12 +25,45 @@ The `[cerebrium.deployment]` section defines core deployment settings.
| shell_commands | string[] | [] | Commands to run at the end of the build |
| pre_build_commands | string[] | [] | Commands to run before dependencies install |
| docker_base_image_url | string | "debian:bookworm-slim" | Base Docker image |
| use_uv | boolean | false | Use UV for faster Python package installation |

<Info>
Changes to python_version or docker_base_image_url trigger full rebuilds since
they affect the base environment.
</Info>

### UV Package Manager

UV is a fast Python package installer written in Rust that can significantly speed up deployment times. When enabled, UV will be used instead of pip for installing Python dependencies.

<Info>
UV typically installs packages 10-100x faster than pip, especially beneficial for:

- Large dependency trees
- Multiple packages
- Clean builds without cache

</Info>

**Example with UV enabled:**

```toml
[cerebrium.build]
use_uv = true
```

### 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=false`)

<Warning>
While UV is compatible with most packages, some edge cases may cause build
failures, such as legacy packages with non-standard metadata.
</Warning>

## Runtime Configuration

The `[cerebrium.runtime.custom]` section configures custom web servers and runtime behavior.
Expand Down Expand Up @@ -147,46 +179,6 @@ apt = "pkglist.txt"
conda = "conda_pkglist.txt"
```

## Build Configuration

The `[cerebrium.build]` section configures build-time optimizations and tools.

| Option | Type | Default | Description |
| ------ | ------- | ------- | --------------------------------------------- |
| use_uv | boolean | false | Use UV for faster Python package installation |

### UV Package Manager

UV is a fast Python package installer written in Rust that can significantly speed up deployment times. When enabled, UV will be used instead of pip for installing Python dependencies.

<Info>
UV typically installs packages 10-100x faster than pip, especially beneficial for:

- Large dependency trees
- Multiple packages
- Clean builds without cache

</Info>

**Example with UV enabled:**

```toml
[cerebrium.build]
use_uv = true
```

### 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=false`)

<Warning>
While UV is compatible with most packages, some edge cases may cause build
failures, such as legacy packages with non-standard metadata.
</Warning>

## Complete Example

```toml
Expand All @@ -199,6 +191,8 @@ exclude = [".*"]
shell_commands = []
pre_build_commands = []
docker_base_image_url = "debian:bookworm-slim"
use_uv = true
# Enable fast package installation with UV (omit or set to false if you want to use pip)

[cerebrium.runtime.custom]
port = 8000
Expand Down Expand Up @@ -240,8 +234,4 @@ ffmpeg = "latest"
# pip = "requirements.txt"
# apt = "pkglist.txt"
# conda = "conda_pkglist.txt"

[cerebrium.build]
use_uv = true
# Enable fast package installation with UV (ignore or set to false if you want to use pip)
```