Files
Fu-Jie_openwebui-extensions/docs/plugins/pipes/index.md
Fu-Jie db33f44cbc feat(plugins): release Copilot SDK Pipe v0.8.0 and Files Filter v0.1.3 (#50)
* feat(plugins): release copilot sdk pipe v0.8.0 and files filter v0.1.3

- Add P1~P4 conditional tool filtering and admin/server gating behavior

- Fix artifact publishing reliability, strict /api file URLs, and HTML preview/download delivery

- Update bilingual README/docs, release notes, and filter matching/debug improvements

* fix(docs): remove duplicate code block in tool-filtering zh doc

- Remove incorrectly placed duplicate 'if not is_enabled: continue' block
  outside code fence on line 161-163 of copilot-sdk-tool-filtering.zh.md
- Addresses review comment from gemini-code-assist (#50)
2026-02-26 01:05:31 +08:00

3.5 KiB

Pipe Plugins

Pipe plugins create custom model integrations or transform LLM responses. They appear as selectable models in the OpenWebUI interface.

What are Pipes?

Pipes allow you to:

  • :material-api: Connect to external AI APIs (Gemini, Claude, etc.)
  • :material-robot: Create custom model wrappers
  • :material-cog-transfer: Transform requests and responses
  • :material-middleware: Implement middleware logic

Available Pipe Plugins


How Pipes Work

graph LR
    A[User selects Pipe as Model] --> B[Pipe receives request]
    B --> C[Transform/Route request]
    C --> D[External API / Custom Logic]
    D --> E[Return response]
    E --> F[Display to User]

The pipes Method

Defines what models this pipe provides:

def pipes(self):
    return [
        {"id": "my-model", "name": "My Custom Model"},
        {"id": "my-model-fast", "name": "My Custom Model (Fast)"}
    ]

The pipe Method

Handles the actual request processing:

def pipe(self, body: dict) -> Generator:
    # Process the request
    messages = body.get("messages", [])
    
    # Call external API or custom logic
    response = call_external_api(messages)
    
    # Return response (can be streaming)
    return response

Quick Installation

  1. Download the desired pipe .py file
  2. Navigate to Admin PanelSettingsFunctions
  3. Upload the file and configure API keys
  4. The pipe will appear as a selectable model

Development Template

"""
title: My Custom Pipe
author: Your Name
version: 1.0.0
description: Description of your pipe plugin
"""

from pydantic import BaseModel, Field
from typing import Generator, Iterator, Union

class Pipe:
    class Valves(BaseModel):
        API_KEY: str = Field(
            default="",
            description="API key for the external service"
        )
        API_URL: str = Field(
            default="https://api.example.com",
            description="API endpoint URL"
        )
    
    def __init__(self):
        self.valves = self.Valves()
    
    def pipes(self) -> list[dict]:
        """Define available models."""
        return [
            {"id": "my-model", "name": "My Custom Model"},
        ]
    
    def pipe(
        self,
        body: dict
    ) -> Union[str, Generator, Iterator]:
        """Process the request and return response."""
        messages = body.get("messages", [])
        model = body.get("model", "")
        
        # Your logic here
        # Can return:
        # - str: Single response
        # - Generator/Iterator: Streaming response
        
        return "Response from custom pipe"

For more details, check our Plugin Development Guide.