Add tiered membership budgets (free/member/supporter) + defer usage-based billing decision

This commit is contained in:
Botbot committed 2026-09-01 08:51:05 -06:00
1 parent 7f4887fa0d
commit e09e608dd1
1 file changed
+23 -9
+23 -9
View File
@@ -316,19 +316,33 @@ Open Collective is a platform for transparent funding of open projects:
### How it fits inference.coop ### How it fits inference.coop
1. Create an Open Collective for inference.coop 1. Create an Open Collective for inference.coop
2. Set up tiers: Free (limited), Member ($5-10/month), Supporter ($20+/month) 2. Set up tiers with tiered budgets (see below)
3. Connect to a fiscal host (e.g., Open Collective Foundation, or a cooperative-specific host) 3. Connect to a fiscal host (e.g., Open Collective Foundation, or a cooperative-specific host)
4. Members pay through Open Collective → funds held transparently 4. Members pay through Open Collective → funds held transparently
5. Expenses (server costs, OpenRouter API costs) paid from the collective 5. Expenses (server costs, Tinfoil API costs) paid from the collective
### Membership tiers and budgets
The cooperative uses **tiered budgets** — each membership level maps to a LiteLLM budget cap, so "excessive use" is rate-limited natively by LiteLLM (no custom billing logic). A free tier lets people try the service before committing.
| Tier | Price | LiteLLM budget cap | Purpose |
|------|-------|-------------------|---------|
| **Free / Trial** | €0 | Small (e.g. €2/month of tokens) | Quick try — enough to test the service, not enough for sustained use |
| **Member** | €10/month | Generous (e.g. €15/month of tokens) | Standard membership — day-to-day use |
| **Supporter** | €20+/month | Higher (e.g. €30/month of tokens) | Heavy users + those who want to support the co-op |
The budget cap is just a number set on each member's LiteLLM virtual key. When a member hits their cap, LiteLLM returns a clean "budget exceeded" message — no surprise bills, no proration, no reconciliation logic. The exact cap values are a governance decision (set in Loomio), not a technical constraint.
**Key design decision: defer usage-based billing.** The MVP uses flat membership with tiered budgets. There is no per-token billing, no overage charges, no proration. If members later want metered billing, that's the point where the middleware grows in complexity — but it's not built speculatively.
### Gaps and additional needs ### Gaps and additional needs
Open Collective handles **money in** (membership payments) but not: Open Collective handles **money in** (membership payments) but not:
- **Access provisioning** — automatically granting/denying API access based on payment status - **Access provisioning** — automatically granting/denying API access based on payment status
- **Usage metering** — tracking token usage per member - **Usage metering** — tracking token usage per member (LiteLLM does this)
- **Rate limiting** — enforcing per-tier limits - **Rate limiting** — enforcing per-tier limits (LiteLLM does this via budget caps)
These would need a lightweight middleware layer between Open Collective's webhook/API and Cloudron's user management. This is the main piece of custom code needed for the MVP. The only custom code needed is a lightweight middleware (webhook handler) between Open Collective and LiteLLM. LiteLLM handles metering and rate-limiting natively; the middleware just creates/enables/disables keys with the right budget.
### Alternatives ### Alternatives
@@ -342,12 +356,12 @@ These would need a lightweight middleware layer between Open Collective's webhoo
### Recommendation ### Recommendation
**Open Collective for payments + fiscal sponsorship, custom middleware for access provisioning.** The middleware is a small webhook handler that: **Open Collective for payments + fiscal sponsorship, LiteLLM for metering/rate-limiting, custom middleware for access provisioning.** The middleware is a small webhook handler that:
1. Receives Open Collective webhooks when payments are made/missed 1. Receives Open Collective webhooks when payments are made/missed
2. Enables/disables the user's Cloudron account 2. Creates/enables/disables the member's LiteLLM virtual key with the tier's budget cap
3. Optionally sets rate limits in Open WebUI based on tier 3. On payment lapse, disables the key (LiteLLM then rejects requests)
This is maybe 200-500 lines of Python — the only custom code needed for the MVP. This is maybe 200-500 lines of Python — the only custom code needed for the MVP. Rate-limiting excessive use is LiteLLM's native budget feature, not custom logic.
--- ---