Open-WebUI-Functions

Open-WebUI-Functions

Open-WebUI-Functions is a collection of custom pipelines, filters, and integrations designed to enhance Open WebUI. These functions enable seamless interactions with Azure AI, N8N, Google Gemini and other AI models, providing dynamic request handling, preprocessing, and automation.

Stars: 177

Visit
 screenshot

Open-WebUI-Functions is a collection of Python-based functions that extend Open WebUI with custom pipelines, filters, and integrations. Users can interact with AI models, process data efficiently, and customize the Open WebUI experience. It includes features like custom pipelines, data processing filters, Azure AI support, N8N workflow integration, flexible configuration, secure API key management, and support for both streaming and non-streaming processing. The functions require an active Open WebUI instance, may need external AI services like Azure AI, and admin access for installation. Security features include automatic encryption of sensitive information like API keys. Pipelines include Azure AI Foundry, N8N, Infomaniak, and Google Gemini. Filters like Time Token Tracker measure response time and token usage. Integrations with Azure AI, N8N, Infomaniak, and Google are supported. Contributions are welcome, and the project is licensed under Apache License 2.0.

README:

Open-WebUI-Functions

GitHub stars GitHub forks GitHub watchers GitHub top language GitHub contributors GitHub License

Open-WebUI-Functions is a collection of Python-based functions designed to extend the capabilities of Open WebUI with additional pipelines, filters, and integrations. These functions allow users to interact with various AI models, process data efficiently, and customize the Open WebUI experience.

Features ⭐

  • 🧩 Custom Pipelines: Extend Open WebUI with AI processing pipelines, including model inference and data transformations.

  • 🔍 Filters for Data Processing: Apply custom filtering logic to refine, manipulate, or preprocess input and output data.

  • 🤝 Azure AI Support: Seamlessly connect Open WebUI with Azure OpenAI and other Azure AI models.

  • 🤝 N8N Workflow Integration: Enable interactions with N8N for automation.

  • 📱 Flexible Configuration: Use environment variables to adjust function settings dynamically.

  • 🚀 Streaming and Non-Streaming Support: Handle both real-time and batch processing efficiently.

  • 🛡️ Secure API Key Management: Automatic encryption of sensitive information like API keys.

Prerequisites 🔗

To use these functions, ensure the following:

  1. An Active Open WebUI Instance: You must have Open WebUI installed and running.

  2. Required AI Services (if applicable): Some pipelines require external AI services, such as Azure AI.

  3. Admin Access: To install functions in Open WebUI, you must have administrator privileges.

Installation 🚀

To install and configure functions in Open WebUI, follow these steps:

  1. Ensure Admin Access:

    • You must be an admin in Open WebUI to install functions.
  2. Access Admin Settings:

    • Navigate to the Admin Settings section in Open WebUI.
  3. Go to the Function Tab:

    • Open the Functions tab in the admin panel.
  4. Create a New Function:

    • Click Add New Function.
    • Copy the function code from this repository and paste it into the function editor.
  5. Set Environment Variables (if required):

    • Some functions require API keys or specific configurations via environment variables.
    • Set WEBUI_SECRET_KEY for secure encryption of sensitive API keys.
  6. Save and Activate:

    • Save the function, and it will be available for use within Open WebUI.

Security Features 🛡️

API Key Encryption

The functions include a built-in encryption mechanism for sensitive information:

  • Automatic Encryption: API keys and other sensitive data are automatically encrypted when stored.
  • Encrypted Storage: Values are stored with an "encrypted:" prefix followed by the encrypted data.
  • Transparent Usage: The encryption/decryption happens automatically when values are accessed.
  • No Configuration Required: Works out-of-the-box when WEBUI_SECRET_KEY is set.

To enable encryption:

# Set this in your Open WebUI environment or .env file
WEBUI_SECRET_KEY="your-secure-random-string"

Pipelines 🧩

Pipelines are processing functions that extend Open WebUI with custom AI models, external integrations, and data manipulation logic.

  • Enables interaction with Azure OpenAI and other Azure AI models.
  • Supports multiple Azure AI models selection via the AZURE_AI_MODEL environment variable (e.g. gpt-4o;gpt-4o-mini).
  • Filters valid parameters to ensure clean requests.
  • Handles both streaming and non-streaming responses.
  • Provides configurable error handling and timeouts.
  • Predefined models for easy access.
  • Supports encryption of sensitive information like API keys.

🔗 Azure AI Pipeline in Open WebUI

🔗 Learn More About Azure AI

  • Integrates Open WebUI with N8N, an automation and workflow platform.
  • Sends messages from Open WebUI to an N8N webhook.
  • Supports real-time message processing with dynamic field handling.
  • Enables automation of AI-generated responses within an N8N workflow.
  • Supports encryption of sensitive information like API keys.
  • Here is an example N8N workflow for N8N Pipeline

🔗 N8N Pipeline in Open WebUI

🔗 Learn More About N8N

  • Integrates Open WebUI with Infomaniak, a Swiss web hosting and cloud services provider.
  • Sends messages from Open WebUI to an Infomaniak AI Tool.
  • Supports encryption of sensitive information like API keys.

🔗 Infomaniak Pipeline in Open WebUI

🔗 Learn More About Infomaniak

  • Integrates Open WebUI with Google Gemini, a generative AI model by Google.
  • Integration with Google Generative AI or Vertex AI API for content generation.
  • Sends messages from Open WebUI to Google Gemini.
  • Supports encryption of sensitive information like API keys.
  • Supports both streaming and non-streaming responses (streaming automatically disabled for image generation models).
  • Supports thinking and reasoning capabilities.
  • Provides configurable error handling and timeouts.
  • Advanced Image Processing: Optimized image handling with configurable compression, resizing, and quality settings.
  • Configurable Parameters: Environment variables for image optimization (quality, max dimensions, format conversion).
  • Grounding with Google search with google_search_tool.py filter
  • Native tool calling support

🔗 Google Gemini Pipeline in Open WebUI

🔗 Learn More About Google Gemini

Filters 🔍

Filters allow for preprocessing and postprocessing of data within Open WebUI.

  • Measures response time and token usage for AI interactions.
  • Supports tracking of total token usage and per-message token counts.
  • Can calculate token usage for all messages or only a subset.
  • Uses OpenAI's tiktoken library for token counting (only accurate for OpenAI models).
  • Optional: Can send logs to Azure Log Analytics Workspace.

🔗 Time Token Tracker in Open WebUI

🔗 How to Setup Azure Log Analytics

Integrations 🤝

Azure AI

Look here for Azure AI Integration.

N8N

Look here for N8N Integration.

Infomaniak

Look here for Infomaniak Integration.

Google

Look here for Google Gemini Integration.

Contribute 💪

We accept different types of contributions, including some that don't require you to write a single line of code. For detailed instructions on how to get started with our project, see about contributing to Open-WebUI-Functions.

License 📜

This project is licensed under the Apache License 2.0 - see the LICENSE file for details. 📄

Support 💬

If you have any questions, suggestions, or need assistance, please open an issue to connect with us! 🤝

Star History 💫

Star History Chart

Created by owndev - Let's make Open WebUI even more amazing together! 💪

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for Open-WebUI-Functions

Similar Open Source Tools

For similar tasks

For similar jobs