Skip to content

rbb-dev/Open-WebUI-OpenRouter-pipe

Repository files navigation

Open WebUI → OpenRouter Pipe

License: MIT Version Open WebUI Compatible

380+ AI models. Chat, image, video, and live multi-model Fusion with full access to your knowledge bases and tools — all from your Open WebUI.

GPT-5.6, Gemini 3.1, Claude Opus, Llama 4, FLUX.2, Sora 2, Veo 3.1, Kling, Wan, Riverflow — text, images, and video generation through OpenRouter's unified API, plus live multi-model Fusion deliberation that runs inside your Open WebUI — panels that draw on your knowledge bases and tools, not just the open web. One key, one bill, every model that matters.

chat generation

Pipe Dashboard walkthrough


What this is (in one minute)

  • OpenRouter Integration Subsystem for Open WebUI — not a standalone service. Open WebUI loads it as a Function / Pipe.
  • Multimodal-aware routing adapters — inspects the payload (text + images/files/audio/video) and picks the endpoint and format the target model supports.
  • Responses-first endpoint routing — builds canonical requests and routes between /responses and /chat/completions based on model rules, fallbacks, or attachments.
  • Native image and video generation — exposed as regular chat models with per-model knobs.
  • Fusion — multi-model deliberation (a panel of models plus a judge), rendered as a live, theme-aware in-chat panel. The built-in engine runs the deliberation inside the pipe, so every panelist has access to the user's knowledge bases, tools, and tool servers — not just web search.
  • OpenRouter server toolsweb_search, web_fetch, datetime, advisor, subagent, and model search behind one OWUI filter, with a per-request cost cap.
  • Operator controls via valves — routing, limits, storage, security, telemetry, and templates.

What You Get

🎯 Every Model, One Place 340+ chat models, 16 video models, 36 image-output models. All variants (:nitro, :thinking, :exacto, :free) and OpenRouter presets (@preset/...).

🎨 Image Generation, Inline 36 image models — Recraft, Sourceful Riverflow, Black Forest Labs FLUX.2, ByteDance Seedream, Gemini Image, GPT-5 Image, xAI Grok Imagine, Microsoft MAI. Type a prompt, get an image. Custom fonts, transparent backgrounds, and Gemini's ultrawide aspect ratios all exposed as one-click filters.

🎬 Video Generation 16 video models — Veo 3.1, Sora 2 Pro, Kling, Wan, Hailuo, Seedance, xAI Grok Imagine. Type a prompt, get a video that plays inline. Per-model knobs (duration, aspect ratio, resolution, audio, frames, negative prompt) all exposed as one-click filters.

💡 Per-Model Help, Built In Type help (literally just that word, nothing else) in a chat against any image or video model — the pipe responds with curated, model-specific guidance: what it's best for, every knob the filter exposes, and tips/pitfalls for that specific model. A different answer for every one of the 50+ generation models.

🧬 Fusion — Many Models, One Answer, Live Ask once; a panel of up to 8 models answers in parallel, a judge weighs their answers — consensus, disagreements, gaps, blind spots — and the final answer is written from that analysis. The pipe renders the whole deliberation as a live, theme-aware panel in the chat: each model's answer and thinking streaming in, the judge's breakdown, and the final answer as it is written.

Two engines, one switch: OpenRouter's hosted Fusion, or the pipe's built-in engine. On the built-in engine, panelists, judge, and synthesizer run as ordinary pipe requests, each with full access to the chatting user's workspace — knowledge bases, personal and workspace tools, tool servers, and the pipe's web tools. Hosted Fusion can only search the open web; the built-in engine deliberates over your data. Every inner call is cost-attributed and budget-capped, and a failed panelist costs you one card, not the whole run.

🖼️ Multimodal That Actually Works Drop in images, PDFs, audio, video. The pipe figures out what each model supports — /responses vs /chat/completions, file vs RAG, streaming vs not.

🔧 OpenRouter Server Tools Web Search, Web Fetch, Datetime, Advisor (let a model consult a higher-intelligence model mid-answer), Subagent (delegate self-contained sub-tasks to a cheaper, faster worker model), and Model Search (let the model browse OpenRouter's catalog) — OpenRouter's server-side tools (run on their infrastructure, not yours, no client-side code). Any model can call them. Bundled into one toggleable filter; calls render as styled cards with citations, with a per-request cost cap to bound the agent loop.

🛡️ Zero Data Retention (ZDR) Controls Filter to ZDR-only models. Enforce ZDR routing when privacy demands it. Video models always treated as not-ZDR.

🎨 Complete Integration Model icons + descriptions + capabilities sync automatically. Per-chat cost display. Per-user cost attribution. Feels native because it is.


What's New

  • Fusion, two engines — multi-model deliberation (up to 8 panel models plus a judge), rendered as a live, theme-aware HTML panel that streams every model's answer and thinking, the judge's analysis, and the final answer. Switch between OpenRouter's hosted engine and the pipe's built-in engine, which gives every panelist full access to the user's knowledge bases, tools, and tool servers. Preset, panel, judge, and tool-budget knobs via the filter.
  • Native image generation — 36 image-output models (Sourceful, FLUX, Seedream, Gemini Image, GPT-5 Image, Recraft, xAI Grok Imagine, Microsoft MAI) with 7 per-family filters (generic, Gemini Options, Sourceful Options, Sourceful V2.5 Options, Recraft Options, Recraft V3 Extras, Grok Imagine Options).
  • Video generation — 16 OpenRouter video models with per-model filters and inline <video> rendering.
  • OpenRouter Web Tools — Web Search + Web Fetch + Datetime + Advisor + Subagent + Model Search as one toggleable filter; tool-execution cards with citations, plus a per-request SERVER_TOOLS_MAX_COST_USD cap that bounds the server-tool agent loop.
  • Open WebUI 0.9.x compatibility — fully migrated to the async DB stack.
  • Provider routing filters — admin + user-controlled routing, fallbacks, ZDR, sort order.
  • Direct Uploads filter — bypass OWUI RAG; forward chat attachments as input_file to OpenRouter.

For IT & Operations

Production Hardened Rate limiting, circuit breakers, request admission, graceful degradation. 5200+ pytest tests, both readable and compressed bundle variants.

🔐 Security First Encrypted credential storage. SSRF protection with HTTPS-only remote fetches by default. No secrets in logs. Capability-gated filter attach (image and video models cannot accidentally enable tools they don't support).

📊 Cost & Attribution Track spending per user, per session, per model. Optional Redis export for billing integration. Per-user concurrency caps for video and image generation.

📝 Audit Trail Optional encrypted session logs for incident response. Request identifiers flow through to OpenRouter for end-to-end attribution.

🏢 Enterprise Controls Provider routing policies, ZDR enforcement, retention controls, per-model access (admin curated), tool/feature kill switches via valves.


Quick Start

1. Install

In Open WebUI: Admin PanelFunctions+Import from Link

Pick one:

Readable bundle (easy to audit/edit):

https://github.com/rbb-dev/Open-WebUI-OpenRouter-pipe/releases/latest/download/open_webui_openrouter_pipe_bundled.py

Compressed bundle (routine installs; smaller payload, faster upload, same runtime behavior):

https://github.com/rbb-dev/Open-WebUI-OpenRouter-pipe/releases/latest/download/open_webui_openrouter_pipe_bundled_compressed.py

Both are automatically generated from the same modular source code on every release.

Alternative: bleeding-edge from dev branch

For the latest development commits (may be unstable):

Readable bundle:

https://github.com/rbb-dev/Open-WebUI-OpenRouter-pipe/releases/download/dev/open_webui_openrouter_pipe_bundled.py

Compressed bundle:

https://github.com/rbb-dev/Open-WebUI-OpenRouter-pipe/releases/download/dev/open_webui_openrouter_pipe_bundled_compressed.py

2. Enable

Toggle the pipe ON (the switch next to the function name).

3. Add Your API Key

Click the ⚙️ gear icon on the pipe → paste your OpenRouter API keySave.

4. Select a Model

Back in the chat, click the model dropdown — you'll see all OpenRouter chat, image, and video models. Pick one.

5. Chat!

For image generation, just describe what you want. For video, type a prompt and the pipe submits, polls, downloads, and renders inline. For chat models with reasoning, the <think> tokens stream live.

That's it.

Requirements

  • Open WebUI 0.9.1+
  • An OpenRouter account
  • WEBUI_SECRET_KEY configured (required for encrypted credential storage)

Documentation

Every document in docs/:

Get started

Security & compliance

Operations & performance

Engineering deep dives

Plus CHANGELOG.md — audit trail of changes.


Contributing & forking

If you fork this, run the same checks CI does before pushing: ruff check, pyright, and pytest. CI validates the source plus both generated bundles (readable + compressed) on every push.

For code review, start with the pytest suite in tests/ — broad coverage across chat, image, video, tools, filters, persistence, and the streaming pipeline.


License

MIT — use it, fork it, ship it.

About

OpenRouter Integration Subsystem for Open WebUI

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages