The Problem
Your organization has a private AI stack. OpenWebUI running on your servers, VLLM serving your fine-tuned model, safety filters catching prompt injection, audit logging tracking every interaction.
Now your team wants to use it from WhatsApp. Your customers want it on Telegram. Your developers want it in Slack. Your support team wants it on Discord.
The naive approach: build a separate bot for each channel that calls VLLM directly. This works — until you realize every bot bypass your entire safety stack. No prompt injection detection. No content safety. No memory. No audit trail. No RAG pipeline. No usage tracking.
You’ve just turned your carefully secured AI deployment into an unmonitored, unfiltered inference endpoint accessible from six different messaging apps.
The Architecture
The critical architectural decision: every channel must flow through OpenWebUI, not directly to VLLM.
User (WhatsApp / Telegram / Discord / Signal / Slack)
│
▼
OpenClaw Gateway (channel routing, message formatting)
│
▼
OpenWebUI API (/api/chat/completions)
│ ┌─ Inlet filters (prompt injection, content safety, policy)
│ ├─ Memory injection (LangGraph persistent memory)
│ ├─ RAG pipeline (knowledge base retrieval)
│ ├─ Model routing (base or fine-tuned via LoRA)
│ └─ Outlet filters (usage tracking, audit logging)
│
▼
VLLM (inference)
│
▼
OpenWebUI (post-processing, logging)
│
▼
OpenClaw Gateway (format reply for channel)
│
▼
User receives response in their messaging app
Why This Is Non-Negotiable
Every differentiator lives in OpenWebUI:
| Layer | What It Does | Direct-to-VLLM? |
|---|---|---|
| Prompt injection detection | AST-based analysis blocks injection attacks | No |
| Content safety | S1-S11 taxonomy classification on inputs and outputs | No |
| ClamAV antivirus | Scans file uploads for malware | No |
| Policy enforcement | Nemotron Safety Dataset v3 rule matching | No |
| LangGraph memory | Persistent cross-session memory per user | No |
| RAG pipeline | Knowledge base retrieval and document grounding | No |
| Usage tracking | Per-user and per-group token counting and rate limiting | No |
| Audit logging | Complete interaction records for HIPAA/SOC2/GDPR | No |
| User management | Authentication, roles, permissions | No |
VLLM is a dumb inference endpoint. It accepts a prompt, returns tokens. It has no memory, no safety layer, no audit trail. OpenWebUI is the intelligence layer.
OpenClaw: The Channel Router
OpenClaw is a messaging gateway that routes AI conversations across WhatsApp, Telegram, Discord, Signal, Slack, Microsoft Teams, Matrix, and more. It handles:
- Channel formatting: each platform has different message limits, markdown flavors, and media capabilities
- Session management: tracking conversation threads across platforms
- Routing rules: directing messages to the right AI backend
- Status monitoring: health probes across all connected channels
The Key Insight: No Plugin Needed
OpenClaw agents natively support any OpenAI-compatible API endpoint as a model provider. OpenWebUI’s /api/chat/completions is exactly that.
The integration is configuration, not code:
{
"models": {
"providers": {
"openwebui": {
"baseUrl": "http://your-openwebui-server:3000",
"apiKey": "your-openwebui-jwt-token",
"api": "openai",
"models": [{
"id": "my-fine-tuned-model",
"name": "Domain Expert"
}]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "openwebui/my-fine-tuned-model" }
}
}
}
That’s it. Every message from every channel now flows through OpenWebUI’s full middleware stack.
OpenWebUI’s Chat Completions API
The critical verification: does OpenWebUI’s API trigger all middleware when called externally (not from the web UI)?
Yes. The /api/chat/completions endpoint runs the complete pipeline:
| Middleware | Triggered on API Call? |
|---|---|
| Inlet filters (safety, injection) | Yes — always |
| Memory injection | Yes — if enabled on the model |
| RAG / Knowledge Base retrieval | Yes — if files attached or model defaults configured |
| Tools | Yes — if tool_ids or model defaults configured |
| Outlet filters (usage tracking, audit) | Yes — always |
| Audit logging | Yes — always |
The simplest deployment pattern: configure the model in OpenWebUI with all desired filters, tools, knowledge bases, and system prompts as defaults. Then the API call only needs model + messages. Everything triggers automatically.
What You Actually Need to Build
The OpenClaw-to-OpenWebUI connection is configuration. But there are real engineering challenges in making it production-ready:
1. User Identity Mapping
OpenClaw identifies users by channel-specific IDs (WhatsApp phone number, Discord user ID, Telegram user ID). OpenWebUI identifies users by email/username. You need a mapping layer:
WhatsApp +1234567890 → openwebui-user: john@company.com
Discord user#1234 → openwebui-user: john@company.com
Telegram @johndoe → openwebui-user: john@company.com
This mapping is critical for:
- Per-user memory: LangGraph memory is per-user in OpenWebUI
- Audit trails: compliance requires knowing which human generated each interaction
- Rate limiting: usage tracking is per-user/per-group
- Permissions: different users have different model access
2. Conversation Continuity
OpenClaw maintains conversation sessions per channel. OpenWebUI maintains chat histories. Bridging these means:
- Mapping OpenClaw session IDs to OpenWebUI
chat_idvalues - Preserving conversation context when a user switches channels mid-conversation
- Handling channel-specific threading (Discord threads, Slack threads, Telegram replies)
3. Health Monitoring
Production deployments need visibility into the full chain:
- OpenClaw Gateway → is it routing messages?
- OpenWebUI API → is
/healthand/health/dbresponding? - VLLM → is inference working?
- Safety filters → are they loading and processing?
A single broken link in the chain means silent message drops or unfiltered responses.
4. End-to-End Safety Validation
The most important test: does a prompt injection attack sent via WhatsApp get caught by the safety filter in OpenWebUI?
This requires E2E testing across each channel:
- Send a known injection payload via the channel
- Verify the inlet filter logs the block
- Verify the user receives the appropriate rejection message
- Verify the audit log records the attempted violation
Deployment Topology
Single-Server (Small Team)
For teams under 20 users:
┌─────────────────────────────────────┐
│ Your Server │
│ ┌──────────┐ ┌──────────────────┐ │
│ │ OpenClaw │→│ OpenWebUI │ │
│ │ Gateway │ │ + Safety Filters │ │
│ └──────────┘ │ + Memory │ │
│ │ + RAG │ │
│ └────────┬─────────┘ │
│ │ │
│ ┌────────▼─────────┐ │
│ │ VLLM │ │
│ │ (GPU: A5000+) │ │
│ └──────────────────┘ │
└─────────────────────────────────────┘
Everything runs on one machine with Docker Compose. The GPU handles VLLM inference, CPU handles OpenWebUI + OpenClaw + safety filters.
Split Architecture (Enterprise)
For larger deployments or compliance requirements:
┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│ DMZ / Edge │ │ Application Tier │ │ GPU Tier │
│ │ │ │ │ │
│ OpenClaw │────▶│ OpenWebUI │────▶│ VLLM │
│ Gateway │ │ + Safety Filters │ │ (A6000/H100) │
│ │ │ + PostgreSQL │ │ │
│ (TLS term) │ │ + Vector DB │ │ (Air-gapped │
│ │ │ │ │ optional) │
└──────────────┘ └──────────────────┘ └──────────────┘
OpenClaw sits in the DMZ handling TLS termination and channel connections. OpenWebUI runs in the application tier with database access. VLLM runs on the GPU tier, optionally air-gapped from the internet.
What This Enables
Once the pipeline is running:
- A clinician asks a question via WhatsApp → routed through HIPAA audit logging, grounded in clinical guidelines via RAG, answered by a fine-tuned medical model
- A customer messages your Telegram bot → rate-limited, safety-filtered, answered with product knowledge from your knowledge base
- Your legal team uses Slack → conversation memory persists across sessions, all interactions logged for compliance
- Your training department runs a Discord server → Circle of Speakers multi-persona dialogues accessible via Discord channels
Every channel gets the same safety, memory, RAG, and audit logging. No channel is a “back door” to unfiltered inference.
Getting Started
- Deploy OpenWebUI + VLLM on your infrastructure (Private AI Starter package)
- Add safety filters for compliance (Enterprise Safety Suite)
- Configure OpenClaw to point at your OpenWebUI instance (native provider config — no plugin needed)
- Build identity mapping between channel users and OpenWebUI accounts
- Validate E2E — send test payloads through each channel and verify safety, memory, and audit logging
For a turnkey deployment, our OpenClaw Channel Integration add-on ($2,000-5,000) covers steps 3-5 and works with any core package.