Skip to main content
The LiteLLM proxy runs on Sevalla as an application that gives your other applications one OpenAI-compatible API for every model: models on your own Ollama server and hosted models from Anthropic and OpenAI. Each application gets its own virtual key with its own budget, and LiteLLM records the tokens and cost of every request in a Sevalla PostgreSQL database. The provider API keys stay in LiteLLM, never in your applications. The official image has no models configured, and Sevalla doesn’t mount files into containers, so this guide deploys a two-file repository: a Dockerfile that starts from the official image and adds your config.yaml. Model changes then go through Git and deploy on every push.

At a glance

Environment variables

Before you begin

  • A Sevalla company with a payment method, and a GitHub, GitLab or Bitbucket account for the repository. See Git providers.
  • An Ollama application in the same location, with lfm3:1.7b and embeddinggemma-2:270m pulled. To use hosted models only, skip the Ollama entries in config.yaml.
  • For hosted models, an Anthropic API key and an OpenAI API key, with spending limits set on both provider accounts.

How LiteLLM runs on Sevalla

Create the project

Create a folder for the repository:
Add the models. Each model_name is the name your applications send in the model field:
config.yaml
Add the Dockerfile:
Dockerfile
Keep Git history and local secrets out of the build:
.dockerignore
Commit the files and push them to your Git provider:

Deploy to Sevalla

These steps build from your Dockerfile. The repository has no application code, so Ingot stops with Ingot couldn't tell what kind of application this is: switch the build strategy before the first deployment.
1

Create the database

In the sidebar, click Databases, then click Create database. Click PostgreSQL and choose the latest version. Enter the Display name litellm-db, choose the Data center where Ollama runs, choose the Size, and click Create database. This guide was tested on DB1; spend logs grow with every request, so watch the storage. See Create a database.
2

Create the application

Click Applications, then click Create > Application. Under Source, click Private repository, then choose the Git provider, the Repository and the Branch. Enter the Name litellm, choose the same Data center, choose the Size S2, then click Create application. Don’t deploy yet.
3

Choose the Dockerfile build strategy

On the Settings tab, in the Build strategy section, click Update build strategy. Click Dockerfile, keep the Dockerfile path Dockerfile and the Docker context ., then click Update build strategy.
4

Connect the database

Click the Networking tab. Under Connected services, click Add internal connection and choose litellm-db as the Service. Turn on Add environment variables to the application, clear Available during build, change the key DB_URL to DATABASE_URL, and click Add internal connection.
5

Connect Ollama

Click Add internal connection again, choose ollama as the Service, and click Add internal connection.
6

Add the environment variables

Click the Environment variables tab, then click Add environment variables. Add the three variables from the table after these steps. Under Availability, clear Available during buildtime, then click Add environment variables.
7

Add a readiness probe

Click the Processes tab, click ⋯ on the web process, then click Update process. Under Health checks, turn on Readiness probe, enter the Path /health/liveliness and the Initial delay 10, then click Update process. New instances then take requests only once LiteLLM answers: 27 requests during a deployment all succeeded.
8

Turn HTTP traffic off

Click the Networking tab. In Expose HTTP traffic, click Disable, then click Disable HTTP. To reach LiteLLM from the internet instead, see Make LiteLLM public.
9

Deploy

Click the Overview tab, then click Deploy now under Recent deployments. Check the Branch and click Deploy.
Both keys are runtime only: a build-time variable becomes a build argument of the image build.

Verify the deployment

  1. On the Deployments tab, click the deployment. Its Build log shows 📦 Building and pushing docker image using Dockerfile..., and its Dockerfile tab shows your Dockerfile.
  2. When the deployment is Deployed, open the application’s runtime logs. The first start applies the database migrations (Applying migration lines, then No pending migrations to apply. on later starts) and lists the models:
  3. In the application’s web terminal, check that the proxy answers:
  4. With HTTP traffic off, the application’s domain returns 404:

Create a key for each application

Give every application its own virtual key: its spend is tracked separately, it can have a budget, and you can delete it without touching the others. Create keys with LiteLLM’s lite command in the application’s web terminal, which calls the proxy inside the same container with the master key:
The answer is the new key’s settings, with "key_alias": "open-webui", "max_budget": 10.0 and the key itself in "key", which starts with sk-. LiteLLM stores only a hash of the key, so copy it now. Once the key’s spend passes its max_budget, in US dollars, LiteLLM rejects its requests. Set the budget with max_budget as shown: the --spend option of lite keys generate sets what the key has already spent, not a limit. To delete a key, run the same lite command with keys delete --key-aliases open-webui.

Call LiteLLM from an application

On the calling application’s Networking tab, add an internal connection to litellm. Then add two variables on its Environment variables tab and deploy it: The official OpenAI SDKs read both variables, so code that uses them needs no change. From the application’s web terminal:
Streaming works the same way: with "stream": true, LiteLLM sends Server-Sent Events as the model writes them. To connect a chat interface, see Deploy Open WebUI.

Add Anthropic and OpenAI models

Hosted models go in the same config.yaml, with their API keys in environment variables of the litellm application only.
1

Add the models

Add the models to model_list in config.yaml:
config.yaml
These are low-cost current models, a sensible default for chat. To use another model, change the part after anthropic/ or openai/ to a name from Anthropic’s or OpenAI’s model list, and model_name to the name your applications send.
2

Add the provider keys

On the litellm application’s Environment variables tab, add ANTHROPIC_API_KEY and OPENAI_API_KEY. Clear Available during buildtime, then click Add environment variables.
3

Deploy

Commit and push config.yaml. With Auto-deploy on, the push starts the deployment; otherwise, click Deploy now.
The runtime logs now list four models. Keys created without models can call them too. LiteLLM prices each request from its built-in price list and adds it to the key’s spend. To see it, run in the web terminal:
After one chat each with claude-haiku-5-5 and gpt-6-luna from Open WebUI, with the titles and suggestions Open WebUI generated for them, the Spend column read 0.001983075, in US dollars. Requests to Ollama models cost 0. To reach models from many providers with one key, add OpenRouter models to the same config.yaml: see OpenRouter in LiteLLM.

Make LiteLLM public

Keep LiteLLM private when only your own applications on Sevalla call it. Make it public when applications or people outside Sevalla need it, for example a laptop running an AI coding tool:
  1. On the application’s Networking tab, in Expose HTTP traffic, click Enable, then click Expose HTTP.
  2. Call it on its domain, for example https://litellm-q9w3e.sevalla.app/v1, with a virtual key.
Every model and admin endpoint then needs a key; only the health checks and the Admin UI’s sign-in page answer without one:
The Admin UI is at /ui: sign in with the username admin and the master key as the password. Anyone with the master key controls the proxy and every provider key in it, so keep it in the litellm application’s variables only, hand out virtual keys with budgets, and limit who can reach the domain with IP restrictions where you can. Streams reach the client unbuffered through Sevalla’s proxy: in a test over the public domain, the first of 82 events arrived after 0.89 s and the last after 6.63 s.

Update LiteLLM

1

Back up the database

Create a backup of litellm-db on its Backups tab. LiteLLM changes the schema when a new version starts, and a backup is the way back. See Backups.
2

Change the version

In the Dockerfile, change the tag in FROM to the new release, for example from LiteLLM’s releases. Use a release without -rc or -dev in its name.
3

Deploy

Commit and push. The runtime logs show the migrations the new version applies, then the models.

Deploy changes

Edit config.yaml to add, rename or remove models, then push. With Auto-deploy on, every push to the branch starts a deployment; otherwise, click Deploy now. See Deployments.

Troubleshoot

Deploy with the API

The same deployment as the dashboard steps, as API calls an agent can run in order. It needs:
  • An API key that can create applications and databases, in SEVALLA_API_KEY.
  • The repository on a Git provider connected to the company. The API has no call that lists connected accounts: Create application checks access itself and answers 400 with Cannot access repository <url>: Repository not found or you don't have access. when Sevalla can’t read the repository.
  • The ID of the Ollama application, in OLLAMA_APP_ID.
  • curl, jq and openssl.
Each step names the API operation, the CLI command (@sevalla/cli 2.1.0) and the tool of the Sevalla MCP server.
1

Set the variables

2

Find the location

List clusters (listClustersV3):
Replace eu-frankfurt-1 with the region ID of your location from Locations, and pick by region ID, not by display name. CLI: sevalla resources clusters. MCP: get_platform_options.
3

Look up the sizes and the PostgreSQL version

List process resource types (listProcessResourceTypesV3), list database resource types (listDatabaseResourceTypesV3) and list database versions (listDatabaseVersionsV3):
CLI: sevalla resources process-types, sevalla resources db-types and sevalla resources db-versions --cluster $CLUSTER_ID --type postgresql. MCP: get_platform_options.
4

Create the database

Create database (createDatabaseV3), then get database (getDatabaseV3) until its status is ready. Keep DB_PASSWORD: the API never returns it:
CLI: sevalla databases create --name litellm-db --type postgresql --db-version $PG_VERSION --cluster $CLUSTER_ID --resource-type $DB_SIZE_ID --db-name litellm --db-password $DB_PASSWORD. MCP: create_database, which generates the password itself and never returns it; with connect_to_application_id set to the application and env_var_name DATABASE_URL, it connects the database and stores a postgresql:// URL, which LiteLLM accepts. Create the application first in that case.
5

Create the application

Create application (createApplicationV3). It doesn’t deploy, and it creates the web process at S1:
CLI: sevalla apps create --name litellm --cluster $CLUSTER_ID --source privateGit --git-type github --repository $REPO_URL --branch $BRANCH. MCP: create_application with "deploy": false.
6

Choose the Dockerfile build strategy

Update application (updateApplicationV3):
CLI: sevalla apps update $APP_ID --data '{"build_type": "dockerfile", "dockerfile_path": "Dockerfile", "docker_context": "."}'. MCP: sevalla_api_update with updateApplicationV3.
7

Set the size, the readiness probe and HTTP traffic

List processes (listProcessesV3), then update process (updateProcessV3). Send timeoutSeconds: a probe set through the API without it waits 120 seconds, not the dashboard’s 1:
CLI: sevalla apps processes update $WEB_ID --app-id $APP_ID --resource-type $SIZE_ID sets the size; the CLI can’t set probes or turn HTTP traffic off. MCP: sevalla_api_update with updateProcessV3 and the same body.
8

Connect the database and Ollama

Create internal connection (createApplicationInternalConnectionV3), once for each:
CLI: sevalla apps internal-connections create $APP_ID --target-id $DB_ID --target-type database. MCP: sevalla_api_create with createApplicationInternalConnectionV3.
9

Add the environment variables

The API connection adds no variables, so build DATABASE_URL in the dashboard’s format, postgres://<user>:<password>@<host>:<port>/<database>, from get database, and OLLAMA_API_BASE from Ollama’s web process. Then create environment variable (createEnvironmentVariableV3) for each, runtime only:
Keep LITELLM_MASTER_KEY for the next steps. List environment variables (listEnvironmentVariablesV3) returns the values later too; the MCP server withholds them. When config.yaml lists hosted models, also run add_var ANTHROPIC_API_KEY "$ANTHROPIC_API_KEY" and add_var OPENAI_API_KEY "$OPENAI_API_KEY". CLI: sevalla apps env-vars create $APP_ID --key LITELLM_MASTER_KEY --value "$LITELLM_MASTER_KEY", which makes the variable available during build and runtime. MCP: set_environment_variables with runtime: true and buildtime: false.
10

Deploy

Trigger deployment (triggerDeploymentV3), then get deployment (getDeploymentV3) until status is success or failed, for at most 30 minutes:
CLI: sevalla apps deployments trigger $APP_ID, then sevalla apps deployments get $DEPLOYMENT_ID --app-id $APP_ID. MCP: trigger_deployment, then get_deployment.
11

Check the build and the start

Get application deployment logs (getApplicationDeploymentLogsV3) and get application runtime logs (getApplicationRuntimeLogsV3):
The first prints 📦 Building and pushing docker image using Dockerfile..., the second LiteLLM: Proxy initialized with Config, Set models:. CLI: sevalla apps deployments logs $DEPLOYMENT_ID --app-id $APP_ID and sevalla apps logs runtime $APP_ID --search "Proxy initialized". MCP: get_deployment_logs and search_runtime_logs.
12

Create a key and list the models

Run a command in a process (execProcessCommandV3) runs lite without a shell, so pass the master key as a value, not as $LITELLM_MASTER_KEY:
With the hosted models in config.yaml, the second command prints:
VIRTUAL_KEY is Open WebUI’s key. CLI: sevalla apps processes exec $WEB_ID --app-id $APP_ID --timeout 60 -- lite --base-url http://localhost:8080 --api-key <master key> http request GET /health/liveliness. MCP: sevalla_api_update with execProcessCommandV3.