Functions

What are Functions?

Open WebUI Functions are Python scripts provided to a Large Language Model (LLM) at the time of request. These tools enable LLMs to perform actions and access additional context. To use functions effectively, the LLM you’re working with must support function calling.

How can I use Functions?

Once installed, functions can be used by either assigning them to a specific LLM or enabling them globally. Some functions, like manifolds, are always globally enabled. To assign a function to a model, follow these steps:

  1. Go to Workspace => Models.
  2. Select the model you wish to configure.
  3. Click the pencil icon to edit the model settings.
  4. Scroll down to the Functions section and check the desired functions to enable them.
  5. Click Save to apply your changes.

You can also enable functions globally for all models by navigating to Workspace => Functions, clicking the “…” menu, and toggling the Global switch. This will enable the function across all models in your OpenWebUI instance.

How to Install Open WebUI Functions

Installing functions is simple, and you have two options:

  1. Manual Download and Import:
  • Visit the community site: https://openwebui.com/functions/
  • Select the function you want to import.
  • Click the blue “Get” button in the top right corner.
  • Choose “Download as JSON export.”
  • Upload the function into OpenWebUI by going to Workspace => Functions and clicking Import Functions.
  1. Import via OpenWebUI URL:
  • Visit the community site.
  • Select the function you want to import.
  • Click the blue “Get” button.
  • Enter the IP address of your OpenWebUI instance and click Import to WebUI. This will automatically open your instance and import the function.

Note: You can manually install your own functions or others not tracked on the community site. However, avoid importing functions from untrustworthy sources, as running unknown code poses security risks.

Read related articles: