359 lines
20 KiB
Markdown
359 lines
20 KiB
Markdown
---
|
|
type: research-project
|
|
function: inference
|
|
region: global
|
|
maturity: planned
|
|
ownership: cooperative
|
|
---
|
|
|
|
# inference.coop — Minimum Viable Cooperative Inference Utility
|
|
|
|
**Status:** Design/planning phase
|
|
**Category:** Cooperative AI infrastructure — proof of concept
|
|
**Goal:** A working, membership-based inference cooperative providing API and chatbot access to open models, hosted on renewable energy, with unified account management and cooperative governance.
|
|
|
|
## Design goals
|
|
|
|
1. **Leverage existing open-source software** for the full stack — no custom infrastructure to build
|
|
2. **Renewable energy hosting** — inference on providers powered by renewables
|
|
3. **Unified account management** across services (chat, API, billing, governance)
|
|
4. **Membership-based payment** through a service that supports recurring payments and cooperative governance
|
|
5. **Small scale first** — viable for a handful of user-testers, then scale
|
|
|
|
---
|
|
|
|
## Component 1: Inference engine
|
|
|
|
The backend that loads and serves open models via an OpenAI-compatible API.
|
|
|
|
### Options
|
|
|
|
| Engine | Throughput | Key features | Best for |
|
|
|--------|-----------|-------------|----------|
|
|
| **vLLM** | Highest (PagedAttention, continuous batching) | OpenAI-compatible API, multi-LoRA, production-grade multi-tenant | Production serving, many concurrent users |
|
|
| **Ollama** | Lower (single-user optimized) | One-command setup, model library, extreme ease of use | MVP/prototyping, small deployments |
|
|
| **SGLang** | ~30% faster than vLLM on some workloads | RadixAttention, structured outputs | Latency-sensitive workloads |
|
|
| **TGI (HuggingFace)** | Competitive | HF ecosystem integration | HF-centric workflows |
|
|
|
|
### Recommendation
|
|
|
|
**Start with Ollama, migrate to vLLM at scale.** Ollama is available as a Cloudron app (one-click install), handles model management, and exposes an OpenAI-compatible API. For <10 concurrent users, Ollama is sufficient. When usage grows, swap the backend to vLLM behind the same Open WebUI frontend — the API contract is identical.
|
|
|
|
**The Ollama → vLLM migration is straightforward:**
|
|
1. Both expose the same OpenAI-compatible `/v1/chat/completions` endpoint
|
|
2. Open WebUI just needs the base URL changed from the Ollama endpoint to the vLLM endpoint
|
|
3. No data migration needed — models are stateless, conversation history lives in Open WebUI's database
|
|
4. The only real work is deploying vLLM (Docker container with GPU config) and updating one config value in Open WebUI
|
|
|
|
**Why not start with vLLM directly?** vLLM is not in the Cloudron app store, so it would need to be run as a standalone Docker container outside Cloudron's management — losing SSO integration, automatic updates, and the security sandboxing that Cloudron provides. For the MVP with 5-10 user-testers, Ollama's throughput is sufficient and the Cloudron integration is worth more than multi-tenant performance you won't use yet.
|
|
|
|
**When to migrate:** When concurrent users exceed ~10-15 or when you need to serve larger models (70B+) where Ollama's throughput becomes a bottleneck. At that point, deploy vLLM as a Docker container (either on the same server or a dedicated GPU instance) and point Open WebUI at it.
|
|
|
|
- vLLM: [https://vllm.ai/](https://vllm.ai/) — "The High-Throughput and Memory-Efficient inference and serving engine for LLMs"
|
|
- Ollama: [https://ollama.com/](https://ollama.com/)
|
|
- vLLM production deployment guide: [Spheron (2026)](https://www.spheron.network/blog/vllm-production-deployment-2026/)
|
|
- vLLM vs Ollama comparison: [Codersera (2026)](https://codersera.com/blog/vllm-vs-ollama-vs-lm-studio-production-2026/)
|
|
|
|
### Model selection
|
|
|
|
Start with 2-3 models covering capability tiers:
|
|
- **Lightweight:** Qwen 3.5 7B or Llama 4 Scout 13B — fast, cheap, handles 80% of queries
|
|
- **Mid-range:** DeepSeek V4 Lite or Qwen 3.5 32B — research assistance, complex reasoning
|
|
- **Frontier (brokered):** Access via OpenRouter API for models too large to self-host
|
|
|
|
### Recommendation: use OpenRouter for frontier access
|
|
|
|
OpenRouter provides a single API to 300+ models from 60+ providers with pay-as-you-go pricing. For the MVP, self-host lightweight/mid-range models and broker frontier access through OpenRouter. This avoids the cost of renting H100 GPUs for frontier models while still offering full model coverage.
|
|
- [OpenRouter](https://openrouter.ai/)
|
|
|
|
---
|
|
|
|
## Component 2: Chat frontend
|
|
|
|
The user-facing web interface for chatting with models.
|
|
|
|
### Options
|
|
|
|
| Frontend | Stars | Key features | Cloudron app? |
|
|
|----------|-------|-------------|--------------|
|
|
| **Open WebUI** | 141K+ | ChatGPT-style, multi-user, RAG, model switching, document upload, pipelines, Python extensibility | ✅ Yes |
|
|
| **LibreChat** | — | ChatGPT-like with model switching, multi-user | ✅ Yes |
|
|
| **Lobster** | — | Clean chat interface | ❌ |
|
|
|
|
### Recommendation: Open WebUI
|
|
|
|
Open WebUI is the leading self-hosted chat interface (141K+ GitHub stars). It's available as a **one-click Cloudron app**, supports multi-user accounts with role-based access, model switching, document upload for RAG, and connects to both Ollama and any OpenAI-compatible API (including vLLM and OpenRouter). It also has a Python pipeline system for extensibility.
|
|
|
|
- [Open WebUI](https://openwebui.com/)
|
|
- [Open WebUI on GitHub](https://github.com/open-webui/open-webui)
|
|
- [Open WebUI on Cloudron App Store](https://www.cloudron.io/store/index.html) (listed as "Open WebUI — ChatGPT-Style WebUI for LLMs")
|
|
- Open WebUI + vLLM integration guide: [Markaicode (2026)](https://markaicode.com/integrate/open-webui-with-vllm/)
|
|
- Self-hosted AI stack guide (Ollama + Open WebUI): [DEV Community (May 2026)](https://dev.to/jovan_chan_9500711396d4e6a/self-hosted-ai-privacy-stack-2026-49n8)
|
|
|
|
---
|
|
|
|
## Component 3: Hosting (renewable energy)
|
|
|
|
### Options
|
|
|
|
| Provider | Renewable claim | GPU types | Location | Notes |
|
|
|----------|----------------|-----------|----------|-------|
|
|
| **Scaleway** | 100% renewable (wind + hydro, GO certified) at DC5 (Paris) | L4, L40S | Paris, Amsterdam, Warsaw | EU data residency, GDPR. No H100. Best for lightweight models. |
|
|
| **Hetzner** | Certified data centers in Germany/Finland (mixed energy) | GPU dedicated servers | Germany, Finland | Best value CPU/GPU servers, but not 100% renewable |
|
|
| **IREN** | 100% renewable-powered data centers | H100, H200, B200 | Global (AU, US, CA) | For GPU-heavy workloads |
|
|
| **Lambda Labs** | Not renewable-specific | H100, A100 | US | Best price/reliability for GPU rental |
|
|
| **GreenPT** (backend) | 100% renewable (uses Scaleway infra) | Not disclosed | Netherlands | Could white-label, but €17.50/seat/month is expensive |
|
|
|
|
### Recommendation
|
|
|
|
**Two-tier approach:**
|
|
1. **Chat/lightweight models:** Hetzner or Scaleway VPS with Cloudron + Ollama running small models on CPU or modest GPU. Scaleway DC5 for 100% renewable. ~€15-30/month for the VPS + Cloudron license.
|
|
2. **Frontier/heavy models:** Broker via OpenRouter (no GPU hosting needed). When self-hosting frontier becomes necessary, move to IREN or Lambda Labs with renewable energy credits.
|
|
|
|
For the MVP, a single Scaleway or Hetzner server running Cloudron + Ollama + Open WebUI can serve 5-10 user-testers with lightweight models. Add OpenRouter API access for frontier model needs.
|
|
|
|
- [Scaleway GPU instances](https://www.scaleway.com/en/gpu-instances/)
|
|
- [Hetzner GPU servers](https://www.hetzner.com/dedicated-rootserver/matrix-gpu/)
|
|
- Scaleway vs Hetzner comparison: [VPSBenchmarks (2026)](https://www.vpsbenchmarks.com/compare/hetzner_vs_scaleway)
|
|
|
|
---
|
|
|
|
## Component 4: Unified account management (Cloudron)
|
|
|
|
### What Cloudron provides
|
|
|
|
Cloudron is a self-hosting platform that runs on your VPS and provides:
|
|
- **One-click app installation** from an app store (100+ apps)
|
|
- **Single Sign-On (SSO)** — users log in once, access all apps
|
|
- **Centralized user management** — LDAP-based directory, admin/user roles
|
|
- **Automatic SSL, DNS, backups, updates**
|
|
- **Access control** — restrict which users can access which apps
|
|
|
|
- [Cloudron](https://www.cloudron.io/)
|
|
- [Cloudron docs: user management](https://docs.cloudron.io/user-management/)
|
|
- Cloudron pricing: ~€15/month for the Cloudron license + your VPS cost
|
|
|
|
### Key Cloudron apps for inference.coop
|
|
|
|
| App | Purpose | In Cloudron store? |
|
|
|-----|---------|-------------------|
|
|
| **Open WebUI** | Chat frontend | ✅ |
|
|
| **Ollama** | Model serving | ✅ |
|
|
| **LibreChat** | Alternative chat frontend | ✅ |
|
|
| **Gitea** | Git hosting (for skills/agents) | ✅ |
|
|
| **Nextcloud** | File sharing, collaboration | ✅ |
|
|
| **Loomio** | Democratic decision-making / governance | ✅ |
|
|
| **Discourse** | Forum / community discussion | ✅ |
|
|
| **Matrix/Element** | Chat / communication | ✅ |
|
|
|
|
This means **the entire cooperative platform** — inference, chat, governance, communication, file sharing — can be deployed through Cloudron with unified SSO. Members log in once and access all services.
|
|
|
|
### Alternatives to Cloudron
|
|
|
|
| Platform | Open source? | SSO? | Notes |
|
|
|----------|------------|------|-------|
|
|
| **Coolify** | ✅ Yes (self-hostable) | Partial | Open-source Cloudron alternative. 280+ one-click services. No built-in SSO/LDAP. |
|
|
| **YunoHost** | ✅ Yes | ✅ Yes | Free, Debian-based. Simpler than Cloudron. Fewer apps. Already used on Nathan's server. |
|
|
| **Cosmo Cloud** | ✅ Yes | ✅ Yes | Newer, Cosmos Server based. |
|
|
|
|
### Recommendation
|
|
|
|
**Cloudron is the right choice for inference.coop.** The security model is materially stronger than YunoHost for running untrusted or semi-trusted software like model inference engines.
|
|
|
|
**Cloudron security model** (per [Cloudron security docs](https://docs.cloudron.io/security/)):
|
|
- **Docker app isolation:** Each app runs in its own Docker container. One app cannot access another app's database or files.
|
|
- **Read-only rootfs:** Apps cannot tamper with their own application code.
|
|
- **AppArmor profiles:** System calls restricted, `/proc` and `/sys` filesystems blocked.
|
|
- **Non-root execution:** All apps run as non-root user by default.
|
|
- **Per-app subdomains:** Prevents XSS in one app from compromising others (unlike sub-path deployments).
|
|
- **Dropped capabilities:** `CAP_SYS_ADMIN` and other dangerous capabilities are dropped.
|
|
- **Automatic SSL/TLS:** All apps HTTPS-only, A+ SSL Labs rating, HSTS, wildcard certs to avoid certificate transparency leaks.
|
|
- **Rate limiting:** Built-in protection against brute force on passwords, SSH, email, database.
|
|
- **Signed updates:** Platform updates GPG-signed, keys maintained offline.
|
|
- **No remote access:** No mechanism for cloudron.io to access your server.
|
|
- **Automatic OS security updates:** Ubuntu unattended-upgrades enabled.
|
|
|
|
**YunoHost security model** — YunoHost does not provide Docker-based app isolation by default. Apps are installed directly on the system (not in containers), meaning a vulnerability in one app can potentially affect others. There is no AppArmor profiling, no read-only rootfs, no per-app sandboxing. This is acceptable for trusted, well-maintained apps on a personal server, but is a real concern for:
|
|
- Running model inference engines that process untrusted user input
|
|
- Running multiple services for multiple members (not just yourself)
|
|
- A cooperative that has a duty of care to its members' data
|
|
|
|
**Cost comparison:**
|
|
- Cloudron: €15/month license + VPS cost
|
|
- YunoHost: free + VPS cost
|
|
- The €15/month is the cost of containerized isolation, automatic security updates, and professional app packaging. For a cooperative handling member data and running inference workloads, this is a necessary expense, not a luxury.
|
|
|
|
**Alternative considered: Coolify** (open-source, self-hostable). Coolify deploys apps via Docker (better isolation than YunoHost) but lacks built-in SSO/LDAP user management and the polished app store. It's a middle ground but doesn't solve the unified account management problem as well as Cloudron.
|
|
|
|
- [Cloudron security docs](https://docs.cloudron.io/security/)
|
|
- [Cloudron vs YunoHost comparison](https://sugggest.com/compare/cloudron-vs-yunohost)
|
|
- [Self-hosted sandboxing platforms comparison](https://www.pistack.xyz/posts/2026-06-15-self-hosted-application-sandboxing-sandstorm-freedombox-cloudron/)
|
|
|
|
---
|
|
|
|
## Component 5: Payment and membership (Open Collective)
|
|
|
|
### What Open Collective provides
|
|
|
|
Open Collective is a platform for transparent funding of open projects:
|
|
- **Recurring payments** — monthly/yearly tiers
|
|
- **Fiscal sponsorship** — no need to incorporate immediately; a fiscal host handles legal/banking
|
|
- **Transparent budget** — all income and expenses visible
|
|
- **Tier system** — different membership levels with different benefits
|
|
- **Expense submission** — members can submit expenses for reimbursement
|
|
|
|
- [Open Collective](https://opencollective.com/)
|
|
- [Open Collective: fiscal hosts FAQ](https://docs.opencollective.com/help/fiscal-hosts/fiscal-hosts)
|
|
|
|
### How it fits inference.coop
|
|
|
|
1. Create an Open Collective for inference.coop
|
|
2. Set up tiers: Free (limited), Member ($5-10/month), Supporter ($20+/month)
|
|
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
|
|
5. Expenses (server costs, OpenRouter API costs) paid from the collective
|
|
|
|
### Gaps and additional needs
|
|
|
|
Open Collective handles **money in** (membership payments) but not:
|
|
- **Access provisioning** — automatically granting/denying API access based on payment status
|
|
- **Usage metering** — tracking token usage per member
|
|
- **Rate limiting** — enforcing per-tier limits
|
|
|
|
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.
|
|
|
|
### Alternatives
|
|
|
|
| Platform | Recurring payments | Fiscal sponsorship | Membership management | Cooperative-friendly? |
|
|
|----------|-------------------|-------------------|----------------------|----------------------|
|
|
| **Open Collective** | ✅ | ✅ | Partial (tiers, not access control) | ✅ Designed for collective governance |
|
|
| **Patreon** | ✅ | ❌ | Partial | ❌ Extractive platform |
|
|
| **Stripe + custom** | ✅ | ❌ | Custom build | Neutral |
|
|
| **Memberstack** | ✅ | ❌ | ✅ Access control, member portals | ❌ SaaS, not cooperative |
|
|
| **Outseta** | ✅ | ❌ | ✅ Full member management | ❌ SaaS |
|
|
|
|
### Recommendation
|
|
|
|
**Open Collective for payments + fiscal sponsorship, custom middleware for access provisioning.** The middleware is a small webhook handler that:
|
|
1. Receives Open Collective webhooks when payments are made/missed
|
|
2. Enables/disables the user's Cloudron account
|
|
3. Optionally sets rate limits in Open WebUI based on tier
|
|
|
|
This is maybe 200-500 lines of Python — the only custom code needed for the MVP.
|
|
|
|
---
|
|
|
|
## Component 6: Governance (missing from original design goals)
|
|
|
|
A cooperative needs governance infrastructure. Cloudron has **Loomio** in its app store — an open-source platform for democratic decision-making used by cooperatives and community organizations worldwide.
|
|
|
|
### Recommendation
|
|
|
|
Install **Loomio via Cloudron** for member governance:
|
|
- Proposals and voting
|
|
- Discussion threads
|
|
- Working groups
|
|
- Transparent decision history
|
|
|
|
This gives members a space to decide on model selection, pricing, privacy policies, and platform direction — all within the same SSO ecosystem as the chat and API.
|
|
|
|
- [Loomio](https://loomio.org/)
|
|
- [Loomio on Cloudron](https://www.cloudron.io/store/index.html)
|
|
|
|
---
|
|
|
|
## Component 7: API access (missing from original design goals)
|
|
|
|
In addition to the chat frontend, members need direct API access to use models in their own code, agents, and integrations.
|
|
|
|
### How to provide it
|
|
|
|
Both Ollama and vLLM expose an **OpenAI-compatible API** (`/v1/chat/completions`). Members point their code at:
|
|
```
|
|
https://inference.coop/v1/chat/completions
|
|
```
|
|
|
|
with their API key (issued via Cloudron SSO or a simple key management layer).
|
|
|
|
### Key management
|
|
|
|
Open WebUI has built-in API key generation for users. Alternatively, a lightweight API gateway (e.g., LiteLLM proxy) can handle:
|
|
- Per-user API keys
|
|
- Rate limiting per tier
|
|
- Usage logging
|
|
- Model routing (lightweight → self-hosted, frontier → OpenRouter)
|
|
|
|
- [LiteLLM](https://github.com/BerriAI/litellm) — proxy that unifies 100+ LLM providers behind OpenAI API
|
|
|
|
---
|
|
|
|
## Architecture summary (MVP)
|
|
|
|
```
|
|
┌─────────────────────────────────────────────────┐
|
|
│ 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 │
|
|
└──────────────────────┬──────────────────────────┘
|
|
│ HTTPS + SSO
|
|
┌──────────────────────▼──────────────────────────┐
|
|
│ Cloudron (VPS) │
|
|
│ ┌─────────┐ ┌──────────┐ ┌─────────────────┐ │
|
|
│ │ SSO/LDAP│ │ Open WebUI│ │ Loomio │ │
|
|
│ └─────────┘ └────┬─────┘ └─────────────────┘ │
|
|
│ ┌────▼─────┐ │
|
|
│ │ Ollama │ (lightweight models) │
|
|
│ │ or vLLM │ │
|
|
│ └────┬─────┘ │
|
|
│ │ OpenAI-compatible API │
|
|
│ ┌────▼─────┐ │
|
|
│ │OpenRouter│ (frontier brokered) │
|
|
│ └──────────┘ │
|
|
│ ┌──────────────────────┐ │
|
|
│ │ Middleware (custom) │ │
|
|
│ │ OC webhook → Cloudron │ │
|
|
│ │ account enable/disable│ │
|
|
│ └──────────────────────┘ │
|
|
└──────────────────────────────────────────────────┘
|
|
Hosted on: Scaleway DC5 (renewable) or Hetzner
|
|
```
|
|
|
|
---
|
|
|
|
## Cost estimate (MVP, 5-10 user-testers)
|
|
|
|
| Component | Monthly cost | Notes |
|
|
|-----------|-------------|-------|
|
|
| VPS (Scaleway or Hetzner) | €15-30 | 4-8 vCPU, 8-16GB RAM, modest GPU or CPU-only |
|
|
| Cloudron license | €15 | If using Cloudron (free if YunoHost) |
|
|
| OpenRouter API (frontier) | €5-20 | Pay-as-you-go, depends on usage |
|
|
| Domain | ~€1 | inference.coop or similar |
|
|
| Open Collective | 0-5% | Platform fee depends on fiscal host |
|
|
| **Total** | **€36-66/month** | |
|
|
|
|
At 10 members paying €10/month = €100/month revenue → **surplus of €34-64/month** for reinvestment.
|
|
|
|
---
|
|
|
|
## What's missing / needs further design
|
|
|
|
1. **Legal structure** — Open Collective fiscal sponsorship for MVP; formal cooperative incorporation later
|
|
2. **Data policy** — what's logged, retained, shared. FERPA/GDPR considerations.
|
|
3. **Model governance** — how members decide which models to add/remove
|
|
4. **Sustainability metrics** — energy per query, CO₂ tracking (à la GreenPT)
|
|
5. **API key management** — whether to use Open WebUI's built-in keys or a dedicated gateway (LiteLLM)
|
|
6. **Migration path** — Ollama → vLLM when scale requires it
|
|
7. **Agent support** — whether to offer agentic capabilities (like Hermes Agent) beyond chat
|
|
|
|
---
|
|
|
|
## Connections
|
|
|
|
- [co/core](../organizations/cocore.md) — most architecturally similar project (ATProto, mutual credit)
|
|
- [GreenPT](../organizations/greenpt.md) — renewable energy AI hosting precedent
|
|
- [Public AI Switzerland](../organizations/public-ai-switzerland.md) — consumer-facing AI cooperative model
|
|
- [Ollama](../solidarity-economies/assessments/ollama-e2c.md) — inference engine + potential E2C candidate
|
|
- [OpenRouter](../organizations/openrouter.md) — model brokering for frontier access
|
|
- [Campus AI Cooperative](../solidarity-economies/projects/campus-ai-cooperative.md) — larger-scale version of the same concept |