Skip to main content
Open WebUI integration with Openlayer Open WebUI is a self-hosted WebUI that operates offline and supports various LLM runners, including Ollama and OpenAI-compatible APIs. Openlayer integrates with Open WebUI through its Pipelines framework, enabling you to:
  • Capture application traces with full execution hierarchies
  • Track usage patterns and user interactions
  • Monitor LLM performance, latency, and token usage
  • Run automated quality evaluations on your data

Prerequisites

Before you begin, ensure you have:
  1. Open WebUI running - Follow the Open WebUI documentation to set up your instance
  2. Docker - Required to run the Pipelines container
  3. Openlayer account - Sign up at app.openlayer.com
  4. Openlayer API key - Find your API key in the Openlayer dashboard
  5. Data source - Create a data source in your Openlayer project to receive traces

Setup guide

This guide walks you through setting up the Openlayer filter pipeline, which intercepts requests and responses to capture trace data. This is the recommended approach for most users.

Step 1: Start the Pipelines service

Run the Pipelines container using Docker:
This command exposes the Pipelines service on port 9099 and ensures it restarts automatically.

Step 2: Connect Open WebUI to Pipelines

In the Open WebUI interface, navigate to Admin Panel → Settings → Connections:
  1. Click the + button to add a new connection
  2. Select OpenAI API as the connection type
  3. Configure the connection:
    • API URL: http://localhost:9099/
    • API Key: 0p3n-w3bu! (default Pipelines password)
  4. Save the connection - you should see a Pipelines icon appear when hovering over the API Base URL field
If Open WebUI runs in a Docker container, use http://host.docker.internal:9099/ as the API URL.

Step 3: Install the Openlayer filter pipeline

In the Open WebUI interface, navigate to Admin Panel → Settings → Pipelines:
  1. Click Add a new pipeline
  2. Copy and paste the Openlayer filter pipeline code below into the editor
  3. Click Save to install
Security Notice: Pipelines execute arbitrary code. Only install pipelines from sources you trust.

Step 4: Configure the pipeline

After installing the pipeline, click on it in the Open WebUI Pipelines list to configure the Valves (settings):
To find your data source ID in Openlayer, navigate to your project and copy the ID from the data source settings.

Step 5: Enable token usage tracking (optional)

To capture token usage metrics, navigate to model settings in Open WebUI and enable the “Usage” capability. This ensures token counts are included in your traces.

View traces in Openlayer

Once configured, interact with your Open WebUI chat and traces will appear in Openlayer in real-time:
  1. Open your project in the Openlayer dashboard
  2. Navigate to your data source
  3. View traces including:
    • User prompts and LLM responses
    • Latency and performance metrics
    • Token usage and cost estimates
    • Full conversation context

Advanced: Manifold pipelines

For advanced users who need custom processing logic, nested trace hierarchies, or integration with specific LLM providers, you can use manifold pipelines instead of the filter pipeline. Manifold pipelines use Openlayer’s auto-instrumentation functions (trace_openai(), trace_litellm()) for richer tracing with automatic step hierarchies.
Use the filter pipeline (above) unless you need custom request processing or provider-specific features.
To install a manifold pipeline, follow the same steps as the filter pipeline: navigate to Open WebUI → Admin Panel → Settings → Pipelines, add a new pipeline, paste the code, and configure the valves.

Troubleshooting

Traces not appearing in Openlayer

  1. Verify your API key and data source ID are correct in the pipeline valves
  2. Ensure the Pipelines container can reach api.openlayer.com
  3. Check the Pipelines logs: docker logs pipelines

Token usage not captured

Enable the “Usage” capability in model settings within Open WebUI (Admin Panel → Settings → Models).

Pipeline not loading

  1. Ensure the Pipelines container is running: docker ps | grep pipelines
  2. Verify the connection URL in Open WebUI matches where Pipelines is running

Learn more