### Start Pipelines Server - Shell Script Source: https://docs.openwebui.com/pipelines/index Starts the Pipelines server using a shell script. This command should be run after all dependencies are installed. ```bash sh ./start.sh ``` -------------------------------- ### Install Dependencies - Pip Source: https://docs.openwebui.com/pipelines/index Installs the required Python packages for the Pipelines project using pip. This command reads the 'requirements.txt' file to install all necessary libraries. ```bash pip install -r requirements.txt ``` -------------------------------- ### Clone Pipelines Repository - Git Source: https://docs.openwebui.com/pipelines/index Clones the Open WebUI Pipelines repository from GitHub. This is the first step to get the project code onto your local machine. ```git git clone https://github.com/open-webui/pipelines.git cd pipelines ``` -------------------------------- ### Run Pipelines Docker Container Source: https://docs.openwebui.com/pipelines/index This command starts the Open WebUI Pipelines Docker container, exposing port 9099 and mounting a volume for persistent pipeline storage. It ensures the container restarts automatically. ```docker docker run -d -p 9099:9099 --add-host=host.docker.internal:host-gateway -v pipelines:/app/pipelines --name pipelines --restart always ghcr.io/open-webui/pipelines:main ``` -------------------------------- ### Defining Optional Pipeline Valves with Pydantic (Python) Source: https://docs.openwebui.com/pipelines/valves This example shows how to define pipeline valves using Pydantic's `BaseModel`, specifically utilizing the `Optional` type for certain fields like `max_turns`. This allows the pipeline to initialize even if these optional valves are not provided, enhancing flexibility and preventing initialization errors. ```python class Pipeline: class Valves(BaseModel): target_user_roles: List[str] = ["user"] max_turns: Optional[int] = None ``` -------------------------------- ### Run Pipelines Docker Container with Custom Pipeline URL Source: https://docs.openwebui.com/pipelines/index This command runs the Pipelines Docker container and specifies a custom pipeline URL to be installed. It uses an environment variable to define the pipeline to load, suitable for pipelines with additional dependencies. ```docker docker run -d -p 9099:9099 --add-host=host.docker.internal:host-gateway -e PIPELINES_URLS="https://github.com/open-webui/pipelines/blob/main/examples/filters/detoxify_filter_pipeline.py" -v pipelines:/app/pipelines --name pipelines --restart always ghcr.io/open-webui/pipelines:main ``` -------------------------------- ### Setting Pipeline Valves with Environment Variables (Python) Source: https://docs.openwebui.com/pipelines/valves This snippet demonstrates how to set pipeline valves using environment variables with fallback default values. It uses `os.getenv()` to read variables like `LLAMAINDEX_OLLAMA_BASE_URL` and `LLAMAINDEX_MODEL_NAME`, providing defaults if the environment variables are not set. This allows for flexible configuration managed externally. ```python self.valves = self.Valves( **{ "LLAMAINDEX_OLLAMA_BASE_URL": os.getenv("LLAMAINDEX_OLLAMA_BASE_URL", "http://localhost:11434"), "LLAMAINDEX_MODEL_NAME": os.getenv("LLAMAINDEX_MODEL_NAME", "llama3"), "LLAMAINDEX_EMBEDDING_MODEL_NAME": os.getenv("LLAMAINDEX_EMBEDDING_MODEL_NAME", "nomic-embed-text"), } ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.