POST /pipeline.{id}/filter/inlet not found #249

Closed
opened 2026-02-15 19:17:22 -05:00 by yindo · 3 comments
Owner

Originally created by @ennioferreirab on GitHub (Jul 28, 2025).

I don’t know what’s going on. Even with a simple example, the pipeline API is adding the prefix “pipeline.” before the endpoint and returning a 404 Not Found error. What am I missing? Testing Swagger endpoint /inlet_events_pipeline/filter/inlet It works when put the right name "inlet_events_pipeline" .


from typing import List, Union, Generator, Iterator, Optional
from pprint import pprint
import time

# Uncomment to disable SSL verification warnings if needed.
# warnings.filterwarnings('ignore', message='Unverified HTTPS request')


class Pipeline:
    def __init__(self):
        self.pipeline_id = "inlet_events_pipeline"
        self.id = "inlet_events_pipeline"
        self.name = "Pipeline with Status Event"
        self.description = (
            "This is a pipeline that demonstrates how to use the status event."
        )
        self.debug = False
        self.version = "0.1.0"
        self.author = "Anthony Durussel"

        self.inlet_count = 0
        self.pipe_count = 0

    async def on_startup(self):
        # This function is called when the server is started.
        print(f"on_startup: {__name__}")
        pass

    async def on_shutdown(self):
        # This function is called when the server is shutdown.
        print(f"on_shutdown: {__name__}")
        pass

    async def inlet(self, body: dict, user: Optional[dict] = None) -> dict:
        """
        This function is called before the OpenAI API request is made. You
        can modify the form data before it is sent to the OpenAI API.
        """
        self.inlet_count += 1
        print()
        print(f"inlet {self.inlet_count}: {__name__}")
        print()
        if self.debug:
            print(f"inlet: {__name__} - body:")
            pprint(body)
            print(f"inlet: {__name__} - user:")
            pprint(user)
        return body

    async def outlet(self, body: dict, user: Optional[dict] = None) -> dict:
        """
        This function is called after the OpenAI API response is completed.
        You can modify the messages after they are received from the OpenAI API.
        """
        print()
        print(f"outlet: {__name__}")
        print()
        if self.debug:
            print(f"outlet: {__name__} - body:")
            pprint(body)
            print(f"outlet: {__name__} - user:")
            pprint(user)
        return body

    def pipe(
        self,
        user_message: str,
        model_id: str,
        messages: List[dict],
        body: dict,
    ) -> Union[str, Generator, Iterator]:
        self.pipe_count += 1
        print()
        print(f"pipe {self.pipe_count}: {__name__}")
        print()

        if self.debug:
            print(f"pipe: {__name__} - received message from user: {user_message}")
            print(f"pipe: {__name__} - messages:")
            pprint(messages)
            print(f"pipe: {__name__} - body:")
            pprint(body)

        yield {
            "event": {
                "type": "status",
                "data": {
                    "description": "Fake Status",
                    "done": False,
                },
            }
        }

        time.sleep(0.5)  # Sleep for 5 seconds

        yield f"user_message -- {user_message}"

        yield {
            "event": {
                "type": "status",
                "data": {
                    "description": "",
                    "done": True,
                },
            }
        }

INFO: 172.18.0.3:49672 - "POST /pipeline.inlet_events_pipeline/filter/inlet HTTP/1.1" 404 Not Found

Originally created by @ennioferreirab on GitHub (Jul 28, 2025). I don’t know what’s going on. Even with a simple example, the pipeline API is adding the prefix “pipeline.” before the endpoint and returning a 404 Not Found error. What am I missing? Testing Swagger endpoint /inlet_events_pipeline/filter/inlet It works when put the right name "inlet_events_pipeline" . ``` from typing import List, Union, Generator, Iterator, Optional from pprint import pprint import time # Uncomment to disable SSL verification warnings if needed. # warnings.filterwarnings('ignore', message='Unverified HTTPS request') class Pipeline: def __init__(self): self.pipeline_id = "inlet_events_pipeline" self.id = "inlet_events_pipeline" self.name = "Pipeline with Status Event" self.description = ( "This is a pipeline that demonstrates how to use the status event." ) self.debug = False self.version = "0.1.0" self.author = "Anthony Durussel" self.inlet_count = 0 self.pipe_count = 0 async def on_startup(self): # This function is called when the server is started. print(f"on_startup: {__name__}") pass async def on_shutdown(self): # This function is called when the server is shutdown. print(f"on_shutdown: {__name__}") pass async def inlet(self, body: dict, user: Optional[dict] = None) -> dict: """ This function is called before the OpenAI API request is made. You can modify the form data before it is sent to the OpenAI API. """ self.inlet_count += 1 print() print(f"inlet {self.inlet_count}: {__name__}") print() if self.debug: print(f"inlet: {__name__} - body:") pprint(body) print(f"inlet: {__name__} - user:") pprint(user) return body async def outlet(self, body: dict, user: Optional[dict] = None) -> dict: """ This function is called after the OpenAI API response is completed. You can modify the messages after they are received from the OpenAI API. """ print() print(f"outlet: {__name__}") print() if self.debug: print(f"outlet: {__name__} - body:") pprint(body) print(f"outlet: {__name__} - user:") pprint(user) return body def pipe( self, user_message: str, model_id: str, messages: List[dict], body: dict, ) -> Union[str, Generator, Iterator]: self.pipe_count += 1 print() print(f"pipe {self.pipe_count}: {__name__}") print() if self.debug: print(f"pipe: {__name__} - received message from user: {user_message}") print(f"pipe: {__name__} - messages:") pprint(messages) print(f"pipe: {__name__} - body:") pprint(body) yield { "event": { "type": "status", "data": { "description": "Fake Status", "done": False, }, } } time.sleep(0.5) # Sleep for 5 seconds yield f"user_message -- {user_message}" yield { "event": { "type": "status", "data": { "description": "", "done": True, }, } } ``` INFO: 172.18.0.3:49672 - "POST /pipeline.inlet_events_pipeline/filter/inlet HTTP/1.1" 404 Not Found
yindo closed this issue 2026-02-15 19:17:22 -05:00
Author
Owner

@fight-pig commented on GitHub (Aug 4, 2025):

The error you encountered is likely due to a version mismatch between the Open WebUI and Pipelines. Specifically, in the code in pipelines/main.py:

@app.post("/v1/{pipeline_id}/filter/inlet")
@app.post("/{pipeline_id}/filter/inlet")
async def filter_inlet(pipeline_id: str, form_data: FilterForm):
if pipeline_id not in app.state.PIPELINES:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=f"Filter {pipeline_id} not found",
)

The newer version of Open WebUI passes a different pipeline_id parameter format compared to what Pipelines expects. My solution was to modify the Pipelines code to handle this by extracting the last segment of the pipeline_id using pipeline_id.split(".")[-1]. The modified code looks like this:

@app.post("/v1/{pipeline_id}/filter/inlet")
@app.post("/{pipeline_id}/filter/inlet")
async def filter_inlet(pipeline_id: str, form_data: FilterForm):
pipeline_id = pipeline_id.split(".")[-1] # modified
if pipeline_id not in app.state.PIPELINES:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=f"Filter {pipeline_id} not found",
)

@app.post("/{pipeline_id}/filter/outlet")
async def filter_outlet(pipeline_id: str, form_data: FilterForm):
pipeline_id = pipeline_id.split(".")[-1] # modified
if pipeline_id not in app.state.PIPELINES:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=f"Filter {pipeline_id} not found",
)

@fight-pig commented on GitHub (Aug 4, 2025): The error you encountered is likely due to a version mismatch between the Open WebUI and Pipelines. Specifically, in the code in pipelines/main.py: @app.post("/v1/{pipeline_id}/filter/inlet") @app.post("/{pipeline_id}/filter/inlet") async def filter_inlet(pipeline_id: str, form_data: FilterForm): if pipeline_id not in app.state.PIPELINES: raise HTTPException( status_code=status.HTTP_404_NOT_FOUND, detail=f"Filter {pipeline_id} not found", ) The newer version of Open WebUI passes a different pipeline_id parameter format compared to what Pipelines expects. My solution was to modify the Pipelines code to handle this by extracting the last segment of the pipeline_id using pipeline_id.split(".")[-1]. The modified code looks like this: @app.post("/v1/{pipeline_id}/filter/inlet") @app.post("/{pipeline_id}/filter/inlet") async def filter_inlet(pipeline_id: str, form_data: FilterForm): pipeline_id = pipeline_id.split(".")[-1] # modified if pipeline_id not in app.state.PIPELINES: raise HTTPException( status_code=status.HTTP_404_NOT_FOUND, detail=f"Filter {pipeline_id} not found", ) @app.post("/{pipeline_id}/filter/outlet") async def filter_outlet(pipeline_id: str, form_data: FilterForm): pipeline_id = pipeline_id.split(".")[-1] # modified if pipeline_id not in app.state.PIPELINES: raise HTTPException( status_code=status.HTTP_404_NOT_FOUND, detail=f"Filter {pipeline_id} not found", )
Author
Owner

@ennioferreirab commented on GitHub (Aug 4, 2025):

Thank you !

@ennioferreirab commented on GitHub (Aug 4, 2025): Thank you !
Author
Owner

@fight-pig commented on GitHub (Aug 4, 2025):

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

@fight-pig commented on GitHub (Aug 4, 2025): 这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-webui/pipelines#249