diff --git a/inference-coop/README.md b/inference-coop/README.md index 0c46643..1c1d8a4 100644 --- a/inference-coop/README.md +++ b/inference-coop/README.md @@ -441,12 +441,35 @@ Sources: [LiteLLM](https://www.litellm.ai/), [LiteLLM + Ollama gateway guide](ht ### 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: -- 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) +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. -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 @@ -601,33 +624,36 @@ The cooperative's structural advantage is that it *can* deploy TEEs and offer ve ┌─────────────────────────────────────────────────┐ │ Member's browser │ │ Chat: https://chat.inference.coop (Open WebUI) │ -│ API: https://api.inference.coop/v1/... │ -│ Gov: https://gov.inference.coop (Loomio) │ -│ Pay: https://opencollective.com/inference-coop │ +│ Chat: https://chat.inference.coop (LobeChat) │ +│ API: https://api.inference.coop/v1/... │ +│ Gov: https://gov.inference.coop (Loomio) │ +│ 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) │ -│ │ or vLLM │ │ -│ └────┬─────┘ │ -│ │ OpenAI-compatible API │ -│ ┌────▼─────┐ │ -│ │OpenRouter│ (frontier brokered) │ -│ └──────────┘ │ -│ ┌──────────────────────┐ │ -│ │ Middleware (custom) │ │ -│ │ OC webhook → Cloudron │ │ -│ │ account enable/disable│ │ -│ └──────────────────────┘ │ +│ │ LiteLLM │ ← custom Cloudron app │ +│ │ Gateway │ (SSO, sandboxed) │ +│ └────┬─────┘ │ +│ ┌──────────┬───┴──────┬───────────┐ │ +│ │ │ │ │ │ +│ ┌──▼──┐ ┌──▼───┐ ┌──▼──┐ ┌──▼──────┐ │ +│ │Tinfoil│ │Ollama│ │Open │ │Billing │ │ +│ │(TEE) │ │(free)│ │Router│ │middleware│ │ +│ └───────┘└──────┘ └─────┘ └─────────┘ │ +│ (cloud) (Cloudron) (cloud) (custom webhook) │ └──────────────────────────────────────────────────┘ - 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)