Skip to main content

cerebrium.toml

One file per app, read by cerebrium deploy and cerebrium run. Two rules to internalise before editing one:
  1. 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 scale set max_replicas = 20 and the TOML you deploy has no max_replicas, the app goes back to 1. Keep every value that matters in the file.
  2. A key the CLI does not recognise is not rejected locally. A misspelled max_replica does 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.
Defaults below are what the API applies when the key is absent. Where a published table disagrees, prefer these, and set anything that matters explicitly.

[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_utilization or memory_utilization with min_replicas = 0. These metrics need a running replica to measure, so set min_replicas to at least 1.
  • scaling_buffer with either of those two metrics.

Dependencies

[cerebrium.experimental]

Turns on memory and GPU checkpointing (beta, availability varies by account). The container also has to POST to 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_version
  • docker_base_image_url
  • any [cerebrium.dependencies.apt] or [cerebrium.dependencies.conda] change
Pip-only changes and code changes are much cheaper.

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_auth is deliberate, and false if the endpoint is not meant to be public
  • max_replicas matches the traffic you expect, not the default 1
  • replica_concurrency matches the workload (1 for one-request-per-GPU inference)
  • compute uses an accepted identifier, and cpu, memory and gpu_count are inside that type’s limits and the plan’s (references/hardware.md)
  • weights load from /persistent-storage, not baked into the image or in include
  • custom runtime: the port in entrypoint equals port
  • secrets are added with cerebrium secrets add, never hardcoded