{
  "manifest_version": "1.0.0",
  "template": {
    "id": "313525a7-978d-43f9-aa2b-f61fa3f7b704",
    "slug": "litellm-llm-gateway",
    "name": "LiteLLM | Open Source OpenAI-Compatible LLM Gateway",
    "description": "OpenAI-compatible proxy for 100+ LLM providers, with keys and budgets",
    "url": "https://railway.com/deploy/litellm-llm-gateway",
    "upstream": {
      "image": "ghcr.io/berriai/litellm:main-v1.83.14-stable"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "postgres:18.6-alpine"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "http": false
    },
    {
      "name": "LiteLLM",
      "source": {
        "image": "ghcr.io/berriai/litellm:main-v1.83.14-stable"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database LiteLLM creates its tables in.",
      "secret": false,
      "strategy": "default",
      "default": "litellm"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser LiteLLM connects as. Leave as is unless you know why you are changing it.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated once at deploy. DATABASE_URL on the LiteLLM service references this value.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "LiteLLM",
      "description": "Port the proxy listens on. Change it here and the start command follows.",
      "secret": false,
      "strategy": "default",
      "default": "4000"
    },
    {
      "key": "UI_PASSWORD",
      "service": "LiteLLM",
      "description": "Password for the admin UI. Generated at deploy — copy it from the service variables.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "UI_USERNAME",
      "service": "LiteLLM",
      "description": "Username for the admin UI at /ui.",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "DATABASE_URL",
      "service": "LiteLLM",
      "description": "Connection string to the bundled Postgres over the private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "LITELLM_SALT_KEY",
      "service": "LiteLLM",
      "description": "Encrypts the provider API keys stored in Postgres. Never change it after the first deploy — every saved key would become undecryptable.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "STORE_MODEL_IN_DB",
      "service": "LiteLLM",
      "description": "Keeps models, keys, teams and budgets in Postgres so they are managed from the UI and survive redeploys. Turning this off leaves no way to add a model on Railway.",
      "secret": false,
      "strategy": "default",
      "default": "True"
    },
    {
      "key": "LITELLM_MASTER_KEY",
      "service": "LiteLLM",
      "description": "Admin key for the proxy API and the /ui login. Treat it as root — issue virtual keys for everything else.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "litellm-llm-gateway"
      }
    },
    "cli": "railway deploy --template litellm-llm-gateway",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "313525a7-978d-43f9-aa2b-f61fa3f7b704",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "2ccd62fc-a61f-4a0c-86fc-14826488fbfd": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 2
                  },
                  "source": {
                    "image": "postgres:18.6-alpine"
                  },
                  "variables": {
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database LiteLLM creates its tables in.",
                      "defaultValue": "litellm"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser LiteLLM connects as. Leave as is unless you know why you are changing it.",
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated once at deploy. DATABASE_URL on the LiteLLM service references this value.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "2ccd62fc-a61f-4a0c-86fc-14826488fbfd": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                },
                "365340f9-91f6-4cf2-9474-e110a320cdfd": {
                  "icon": "https://cdn.jsdelivr.net/gh/BerriAI/litellm@6a919aec6a2a0c54cc6a2e6f67ff7b236a3a2573/litellm/proxy/_experimental/out/_next/static/media/litellm_logo.2q-1n9v95d189.jpg",
                  "name": "LiteLLM",
                  "deploy": {
                    "startCommand": "sh -c \"litellm --host '[::]' --port ${PORT:-4000} --run_gunicorn\"",
                    "healthcheckPath": "/health/liveliness",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 2
                  },
                  "source": {
                    "image": "ghcr.io/berriai/litellm:main-v1.83.14-stable"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port the proxy listens on. Change it here and the start command follows.",
                      "defaultValue": "4000"
                    },
                    "UI_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the admin UI. Generated at deploy — copy it from the service variables.",
                      "defaultValue": "{{UI_PASSWORD}}"
                    },
                    "UI_USERNAME": {
                      "isOptional": false,
                      "description": "Username for the admin UI at /ui.",
                      "defaultValue": "admin"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Connection string to the bundled Postgres over the private network.",
                      "defaultValue": "postgresql://postgres:${{Postgres.POSTGRES_PASSWORD}}@${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/litellm"
                    },
                    "LITELLM_SALT_KEY": {
                      "isOptional": false,
                      "description": "Encrypts the provider API keys stored in Postgres. Never change it after the first deploy — every saved key would become undecryptable.",
                      "defaultValue": "{{LITELLM_SALT_KEY}}"
                    },
                    "STORE_MODEL_IN_DB": {
                      "isOptional": false,
                      "description": "Keeps models, keys, teams and budgets in Postgres so they are managed from the UI and survive redeploys. Turning this off leaves no way to add a model on Railway.",
                      "defaultValue": "True"
                    },
                    "LITELLM_MASTER_KEY": {
                      "isOptional": false,
                      "description": "Admin key for the proxy API and the /ui login. Treat it as root — issue virtual keys for everything else.",
                      "defaultValue": "{{LITELLM_MASTER_KEY}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:4000": {
                        "port": 4000
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "LiteLLM",
      "method": "GET",
      "path": "/health/liveliness",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-19T04:14:37.968Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-17T10:57:56.427Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_062324ca8c2249718906",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 164,
    "typical_build_seconds": 0,
    "typical_start_seconds": 63,
    "slowest_service": "LiteLLM"
  }
}
