Finalize architecture: LiteLLM as custom Cloudron app, updated diagram with all components

This commit is contained in:
Botbot committed 2026-08-27 21:37:28 -06:00
1 parent 82e532b40b
commit 1b70128f5a
1 file changed
+46 -20
+46 -20
View File
@@ -441,12 +441,35 @@ Sources: [LiteLLM](https://www.litellm.ai/), [LiteLLM + Ollama gateway guide](ht
### Is LiteLLM in Cloudron? ### Is LiteLLM in Cloudron?
LiteLLM is not currently in the Cloudron app store. It would need to be deployed as a custom Docker container — either: LiteLLM is not in the Cloudron app store, but it can be **packaged as a custom Cloudron app**. This is the planned approach — it gives LiteLLM the full Cloudron treatment: SSO, sandboxing, SSL, backups, and access control, without a separate Docker container or reverse proxy.
- Via Cloudron's [custom app/LAMP stack](https://docs.cloudron.io/apps/lamp/) option
- As a standalone Docker container on the same VPS (with a reverse proxy for SSL)
- Via Coolify alongside Cloudron (if using Coolify instead)
This is the one piece of the MVP that doesn't fit neatly into Cloudron's one-click model. It's also the only piece of custom infrastructure (beyond the billing middleware) that the cooperative needs to build and maintain. **How custom Cloudron apps work:**
1. Create a `CloudronManifest.json` (app ID, port, OIDC/LDAP addons, health check)
2. Write a `Dockerfile` wrapping LiteLLM's image with Cloudron-specific configuration (read-only rootfs, `/app/data` for persistent DB, OIDC integration)
3. `cloudron build && cloudron install` — deploys to Cloudron as a one-click app
4. LiteLLM appears in the Cloudron dashboard with SSO, SSL, sandboxing, and backups
**Manifest (planned):**
```json
{
"id": "ai.coop.litellm",
"title": "LiteLLM Gateway",
"httpPort": 4000,
"addons": {
"oidc": {},
"ldap": {},
"localstorage": {}
}
}
```
The `oidc` addon gives LiteLLM access to Cloudron's SSO. The `ldap` addon lets it query the user directory. `localstorage` provides `/app/data` for the LiteLLM database.
**Result:** Members log in once via Cloudron SSO → access Open WebUI (chat), Loomio (governance), and LiteLLM admin dashboard (if admin) — all same credentials. API access uses per-member virtual keys managed by LiteLLM.
**Build task:** Package LiteLLM as a Cloudron app (~1 day). See [Cloudron packaging tutorial](https://docs.cloudron.io/packaging/tutorial/). Could also publish to the Cloudron community app store for others.
Sources: [Cloudron packaging docs](https://docs.cloudron.io/packaging/), [Cloudron manifest docs](https://docs.cloudron.io/packaging/manifest/), [Cloudron user directory (OIDC)](https://docs.cloudron.io/user-directory/)
### Alternatives to LiteLLM ### Alternatives to LiteLLM
@@ -601,33 +624,36 @@ The cooperative's structural advantage is that it *can* deploy TEEs and offer ve
┌─────────────────────────────────────────────────┐ ┌─────────────────────────────────────────────────┐
│ Member's browser │ │ Member's browser │
│ Chat: https://chat.inference.coop (Open WebUI) │ │ Chat: https://chat.inference.coop (Open WebUI) │
│ Chat: https://chat.inference.coop (LobeChat) │
│ API: https://api.inference.coop/v1/... │ │ API: https://api.inference.coop/v1/... │
│ Gov: https://gov.inference.coop (Loomio) │ │ Gov: https://gov.inference.coop (Loomio) │
│ Pay: https://opencollective.com/inference-coop│ │ Pay: https://opencollective.com/inference-coop│
└──────────────────────┬──────────────────────────┘ └──────────────────────┬──────────────────────────┘
│ HTTPS + SSO │ HTTPS + Cloudron SSO (OIDC)
┌──────────────────────▼──────────────────────────┐ ┌──────────────────────▼──────────────────────────┐
│ Cloudron (VPS) │ │ Cloudron (VPS, green energy) │
│ ┌─────────┐ ┌──────────┐ ┌─────────────────┐ │ │ ┌─────────┐ ┌──────────┐ ┌─────────────────┐ │
│ │ SSO/LDAP│ │ Open WebUI│ │ Loomio │ │ │ │ SSO/OIDC│ │ Open WebUI│ │ Loomio │ │
│ └─────────┘ └────┬─────┘ └─────────────────┘ │ │ └─────────┘ └────┬─────┘ └─────────────────┘ │
│ ┌────▼─────┐ │ │ ┌────▼─────┐ │
│ │ Ollama │ (lightweight models) │ │ │ LiteLLM │ ← custom Cloudron app │
│ │ or vLLM │ │ │ │ Gateway │ (SSO, sandboxed) │
│ └────┬─────┘ │ │ └────┬─────┘ │
│ │ OpenAI-compatible API │ │ ┌──────────┬───┴──────┬───────────┐ │
│ ┌────▼─────┐ │ │ │ │ │ │ │
│ │OpenRouter│ (frontier brokered) │ │ ┌──▼──┐ ┌──▼───┐ ┌──▼──┐ ┌──▼──────┐ │
│ └──────────┘ │ │ │Tinfoil│ │Ollama│ │Open │ │Billing │ │
│ ┌──────────────────────┐ │ │ │(TEE) │ │(free)│ │Router│ │middleware│ │
│ │ Middleware (custom) │ │ │ └───────┘└──────┘ └─────┘ └─────────┘ │
│ │ OC webhook → Cloudron │ │ │ (cloud) (Cloudron) (cloud) (custom webhook) │
│ │ account enable/disable│ │
│ └──────────────────────┘ │
└──────────────────────────────────────────────────┘ └──────────────────────────────────────────────────┘
Hosted on: Scaleway DC5 (renewable) or Hetzner
``` ```
**Green hosting:** Hetzner (100% hydropower) or Scaleway DC5 (100% renewable)
**Privacy:** Tinfoil TEE for inference; LobeChat browser-local for chat history
**SSO:** Cloudron OIDC — one login for chat, governance, API admin
**Billing:** Open Collective → webhook middleware → LiteLLM key enable/disable
--- ---
## Cost comparison: self-hosting vs cloud inference (10 users, ~12M tokens/month) ## Cost comparison: self-hosting vs cloud inference (10 users, ~12M tokens/month)