cerebrium.toml
One file per app, read bycerebrium deploy and cerebrium run.
Two rules to internalise before editing one:
- A key you leave out is set to the default, not left alone. A deploy replaces the whole app
record. If a previous deploy or
cerebrium apps scalesetmax_replicas = 20and the TOML you deploy has nomax_replicas, the app goes back to 1. Keep every value that matters in the file. - A key the CLI does not recognise is not rejected locally. A misspelled
max_replicadoes not fail the deploy in the CLI, it just does nothing there. The whole file is uploaded verbatim, so the backend sees the key too and is free to reject it. Check spelling against the tables below rather than trusting a successful deploy. A TOML that does not parse at all does fail the deploy.
[cerebrium.deployment]
cerebrium init scaffolds disable_auth = true. That is a convenience for a first curl, not a
production default. Treat flipping it to false as part of the first real deploy.
[cerebrium.runtime]
The sub-tables in the next two sections sit under the same heading and can be set alongside
container_runtime.
[cerebrium.runtime.custom]
Only for a custom web server (FastAPI, ASGI, WebSockets, custom batching) or a Dockerfile build.
Omit the section to use the default Cortex runtime.
[cerebrium.runtime.deepgram] and [cerebrium.runtime.rime]
Partner service runtimes. The table name is the partner, and an app uses one of them or neither.
Omit both unless you are deploying that partner’s image.
[cerebrium.hardware]
[cerebrium.scaling]
Two combinations the API rejects outright:
cpu_utilizationormemory_utilizationwithmin_replicas = 0. These metrics need a running replica to measure, so setmin_replicasto at least 1.scaling_bufferwith either of those two metrics.
Dependencies
[cerebrium.experimental]
http://169.254.169.253:8234/checkpoint once initialisation is done, so it is a
config change plus a code change. See references/troubleshooting.md for where it sits in the
cold-start order.
What forces a full rebuild
Batch these edits together, they are the slow ones:python_versiondocker_base_image_url- any
[cerebrium.dependencies.apt]or[cerebrium.dependencies.conda]change
Worked example
Private base images
Log in to the registry before deploying an app that pulls one:Checklist before deploying
- Every value that matters is in the file, including ones set by a previous
apps scale -
disable_authis deliberate, andfalseif the endpoint is not meant to be public -
max_replicasmatches the traffic you expect, not the default 1 -
replica_concurrencymatches the workload (1 for one-request-per-GPU inference) -
computeuses an accepted identifier, andcpu,memoryandgpu_countare inside that type’s limits and the plan’s (references/hardware.md) - weights load from
/persistent-storage, not baked into the image or ininclude - custom runtime: the port in
entrypointequalsport - secrets are added with
cerebrium secrets add, never hardcoded