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.7bandembeddinggemma-2:270mpulled. To use hosted models only, skip the Ollama entries inconfig.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:model_name is the name your applications send in the model field:
Dockerfile:
Deploy to Sevalla
These steps build from yourDockerfile. 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.
Create the database
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.Create the application
litellm, choose the same Data center, choose the Size S2, then click Create application. Don’t deploy yet.Choose the Dockerfile build strategy
Dockerfile and the Docker context ., then click Update build strategy.Connect the database
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.Connect Ollama
ollama as the Service, and click Add internal connection.Add the environment variables
Add a readiness probe
/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.Turn HTTP traffic off
Deploy
Verify the deployment
-
On the Deployments tab, click the deployment. Its Build log shows
📦 Building and pushing docker image using Dockerfile..., and its Dockerfile tab shows yourDockerfile. -
When the deployment is Deployed, open the application’s runtime logs. The first start applies the database migrations (
Applying migrationlines, thenNo pending migrations to apply.on later starts) and lists the models: -
In the application’s web terminal, check that the proxy answers:
-
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’slite command in the application’s web terminal, which calls the proxy inside the same container with the master key:
"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.
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 tolitellm. Then add two variables on its Environment variables tab and deploy it:
"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 sameconfig.yaml, with their API keys in environment variables of the litellm application only.
Add the models
model_list in config.yaml:anthropic/ or openai/ to a name from Anthropic’s or OpenAI’s model list, and model_name to the name your applications send.Add the provider keys
litellm application’s Environment variables tab, add ANTHROPIC_API_KEY and OPENAI_API_KEY. Clear Available during buildtime, then click Add environment variables.Deploy
config.yaml. With Auto-deploy on, the push starts the deployment; otherwise, click Deploy now.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:
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:- On the application’s Networking tab, in Expose HTTP traffic, click Enable, then click Expose HTTP.
- Call it on its domain, for example
https://litellm-q9w3e.sevalla.app/v1, with a virtual key.
/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
Back up the database
litellm-db on its Backups tab. LiteLLM changes the schema when a new version starts, and a backup is the way back. See Backups.Change the version
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.Deploy
Deploy changes
Editconfig.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
400withCannot 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,jqandopenssl.
@sevalla/cli 2.1.0) and the tool of the Sevalla MCP server.
Set the variables
Find the location
listClustersV3):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.Look up the sizes and the PostgreSQL version
listProcessResourceTypesV3), list database resource types (listDatabaseResourceTypesV3) and list database versions (listDatabaseVersionsV3):sevalla resources process-types, sevalla resources db-types and sevalla resources db-versions --cluster $CLUSTER_ID --type postgresql. MCP: get_platform_options.Create the database
createDatabaseV3), then get database (getDatabaseV3) until its status is ready. Keep DB_PASSWORD: the API never returns it: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.Create the application
createApplicationV3). It doesn’t deploy, and it creates the web process at S1:sevalla apps create --name litellm --cluster $CLUSTER_ID --source privateGit --git-type github --repository $REPO_URL --branch $BRANCH. MCP: create_application with "deploy": false.Choose the Dockerfile build strategy
updateApplicationV3):sevalla apps update $APP_ID --data '{"build_type": "dockerfile", "dockerfile_path": "Dockerfile", "docker_context": "."}'. MCP: sevalla_api_update with updateApplicationV3.Set the size, the readiness probe and HTTP traffic
listProcessesV3), then update process (updateProcessV3). Send timeoutSeconds: a probe set through the API without it waits 120 seconds, not the dashboard’s 1: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.Connect the database and Ollama
createApplicationInternalConnectionV3), once for each:sevalla apps internal-connections create $APP_ID --target-id $DB_ID --target-type database. MCP: sevalla_api_create with createApplicationInternalConnectionV3.Add the environment variables
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: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.Deploy
triggerDeploymentV3), then get deployment (getDeploymentV3) until status is success or failed, for at most 30 minutes:sevalla apps deployments trigger $APP_ID, then sevalla apps deployments get $DEPLOYMENT_ID --app-id $APP_ID. MCP: trigger_deployment, then get_deployment.Check the build and the start
getApplicationDeploymentLogsV3) and get application runtime logs (getApplicationRuntimeLogsV3):📦 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.Create a key and list the models
execProcessCommandV3) runs lite without a shell, so pass the master key as a value, not as $LITELLM_MASTER_KEY: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.