LiteLLM Cloudron App Package
A Cloudron app package for LiteLLM — the open-source AI gateway.
What this provides
- LiteLLM proxy with OpenAI-compatible API on port 4000
- Per-user virtual API keys, usage tracking, rate limiting
- Model routing to Tinfoil (TEE), OpenRouter (frontier fallback), and Ollama (self-hosted)
- Cloudron PostgreSQL for keys/teams/spend logs
- Cloudron Redis for rate limiting/caching
- Cloudron SSO via OIDC (admin UI protected by Cloudron login)
- Automatic SSL, backups, sandboxing
- Master key and salt key auto-generated on first start (persisted in /app/data)
Files
CloudronManifest.json— Cloudron app manifest (addons, ports, metadata)Dockerfile— wraps LiteLLM's official image for Cloudron's environmentstart.sh— startup script that configures LiteLLM with Cloudron addonsconfig.yaml— default LiteLLM config with inference.coop model routing
Building and installing
# Install Cloudron CLI (on your local machine)
npm install -g cloudron-cli
# Login to your Cloudron
cloudron login
# From this directory:
cloudron build # builds the Docker image
cloudron install # installs on your Cloudron
Environment variables
Set these in Cloudron's app config (Settings → Environment Variables) after installation:
TINFOIL_API_KEY— your Tinfoil API key (get at https://tinfoil.sh/)OPENROUTER_API_KEY— your OpenRouter API key (get at https://openrouter.ai/)OLLAMA_API_BASE— if running Ollama on a different host (default: http://127.0.0.1:11434)
The following are auto-generated and should NOT be set manually:
LITELLM_MASTER_KEY— generated on first start, stored in /app/data/.master_keyLITELLM_SALT_KEY— generated on first start, stored in /app/data/.salt_keyDATABASE_URL— set from Cloudron's PostgreSQL addonREDIS_HOST,REDIS_PORT,REDIS_PASSWORD— set from Cloudron's Redis addon
After installation
- Open
https://gateway.inference.coop/ui(or whatever subdomain you chose) - Log in with username
adminand the master key as password - To find the master key:
cloudron exec cat /app/data/.master_key - Add provider API keys in the Admin UI (or set as env vars above)
- Create virtual keys for members
- Point Open WebUI / LobeChat at
https://gateway.inference.coop/v1
Connecting Open WebUI
In Open WebUI settings:
- API Base URL:
https://gateway.inference.coop/v1 - API Key: a virtual key created in LiteLLM's Admin UI
Model routing
The default config routes:
gpt-oss-120b,deepseek-v4-flash,gemma4-31b,llama3-3-70b→ Tinfoil (TEE)claude-sonnet,gpt-4o→ OpenRouter (frontier fallback)ollama-qwen→ local Ollama (if installed on same Cloudron)- Fallback: if Tinfoil is down,
gpt-oss-120bfalls back togpt-4ovia OpenRouter
OIDC / SSO
The manifest requests the postgresql, redis, and localstorage addons.
For full OIDC SSO integration (so the admin UI uses Cloudron login instead of
master key), add the "oidc": {} addon to the manifest and configure LiteLLM's
SSO hooks per https://docs.litellm.ai/docs/proxy/custom_sso.
This is a TODO for the next version — the current package uses LiteLLM's built-in admin/master-key auth, which is sufficient for the MVP.