Skip to content

rbb-dev/Open-WebUI-OpenRouter-pipe

Repository files navigation

Open WebUI → OpenRouter Pipe

License: MIT Version Open WebUI Compatible

Access 350+ AI models through one interface.

Use GPT-5.2, Gemini 3, Claude Opus, Llama 4, and hundreds more — all from your Open WebUI, all through OpenRouter's unified API.

output


What this is (in one minute)

  • OpenRouter Integration Subsystem for Open WebUI: this isn't a standalone service. Open WebUI loads it as a Function / Pipe.
  • Multimodal-aware routing adapters: it inspects the payload (text + images/files/audio/video) and selects the appropriate endpoint + format the target model actually supports.
  • Responses-first endpoint routing: it builds canonical requests and routes to /responses or /chat/completions depending on model rules, fallback behaviour, or attachments.
  • Operator controls via valves: routing, limits, storage, security posture, telemetry, and templates.

If you fork this: it’s worth keeping the tests and running them for changes (pytest) — and running pyright as well.
It keeps behaviour consistent and makes debugging a lot quicker.

For the full documentation, start with docs/README.md. If you're reviewing code, start with the pytest test suite in tests/, 3200+ pytest tests with broad coverage.

Check GitHub CI test workflows.


What You Get

🎯 Every Model, One Place GPT-5.2, Gemini 3, Claude Opus, Llama 4, DeepSeek, Qwen, Command R+ — browse them all, try them all, compare them all. One API key, one bill. Plus model variants (:free, :thinking, :exacto) for specialized routing.

🖼️ Multimodal That Actually Works Drop in images, PDFs, documents. The pipe figures out what each model supports and handles the rest.

🔧 Tools & Web Search Your Open WebUI tools work seamlessly. OpenRouter's native web search is one toggle away.

🛡️ Zero Data Retention (ZDR) Controls Filter to ZDR‑only models and enforce ZDR routing when privacy requirements demand it.

🎨 Complete Integration Model icons and descriptions sync automatically. Capabilities show up in the UI. It feels native because it is.

💬 Clear Communication Helpful error messages, real-time status updates, and transparent cost tracking per request.


For IT & Operations

Production Hardened Rate limiting, circuit breakers, request admission controls, and graceful degradation — built for real workloads, not demos.

🔐 Security First Encrypted credential storage, SSRF protection with HTTPS-only remote fetches by default (HTTP allowlist available), no secrets in logs. Designed for environments where security reviews happen.

📊 Cost & Attribution Track spending per user, per session. Optional Redis export for billing integration. Know who's using what.

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

🛡️ Enterprise Controls Encryption, retention policies, request attribution, and operational hooks your governance program can build on.


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 models. Pick one.

5. Chat!

That's it. Start talking.


Requirements

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

Documentation

Everything else lives in docs/:


License

MIT — use it, fork it, ship it.

About

OpenRouter Integration Subsystem for Open WebUI

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors