Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Open-webui Pipelines #1784

Open
hugalafutro opened this issue Mar 4, 2025 · 15 comments · Fixed by #1786
Open

Add Open-webui Pipelines #1784

hugalafutro opened this issue Mar 4, 2025 · 15 comments · Fixed by #1786
Assignees

Comments

@hugalafutro
Copy link

hugalafutro commented Mar 4, 2025

open-webui expects http://host.docker.internal:9099 (that is not alliteration it expects that literal string as host) exposed as oai endpoint internally with api key of 0p3n-w3bu! for the Pipelines functionality (more at open-webui/open-webui#3206), it comes from this in their docker-compose.yml:

  open-webui:
...
    extra_hosts:
      - host.docker.internal:host-gateway
...

or this from docker command argument --add-host=host.docker.internal:host-gateway

However it does not work when open-webui runs as Scale app.
Image
Image

It works as expected without the extra configuration running with docker-compose on different host.

@hugalafutro
Copy link
Author

Hi was this merged already in v1.0.40? I updated the app today, but the Pipelines still do not work either out-of-the-box or with adding the address manually. Output is same as screenshots above.

Pipelines is needed for function calls, amongst other things it's the only way to connect open-webui with Anthropic API

@stavros-k
Copy link
Contributor

Yes it should be there.
You can try resolving the host.docker.internal within the container to see if it resolves correctly.

But re-reading the issue linked, the extra host is not really needed.
Well its needed under specific scenarios.

What's the actual requirement here, is the pipelines container to be running, which is a separate one.

@stavros-k
Copy link
Contributor

Re-opening as enhancement to add that extra container.

@stavros-k stavros-k reopened this Mar 7, 2025
@stavros-k stavros-k added the enhancement New feature or request label Mar 7, 2025
@hugalafutro
Copy link
Author

I read about the extra container and running the open-webui in docker didn't require additional container. I migrated from docker install to Scale and the pipelines stopped working which is how I discovered about the extra address.

So it confuses me why would it need extra container suddenly.

Thank you for your work on fixing the issue!

@stavros-k
Copy link
Contributor

I've no idea how you where running it before. But that's from their docs

Image

@hugalafutro
Copy link
Author

hugalafutro commented Mar 7, 2025

This is docker-compose I ran it with in vm, pipelines were working as Claude was last model I used and Pipelines are needed to import the json function file to make anthropic api available.

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    restart: always
    container_name: open-webui
    volumes:
      - ./data:/app/backend/data
    environment:
      - OPENAI_API_KEY=${OAIAPI}
      - AUTOMATIC1111_BASE_URL=${A1111URL}
      - ENABLE_IMAGE_GENERATION=true
      - IMAGE_GENERATION_MODEL=perfectdeliberate_v5
      - IMAGE_SIZE=512x512
    ports:
      - 3333:8080
networks: {}

the address seems to exist in the container, but it doesn;t function as OAI endpoint

root@truenas[/home/admin]# docker exec ix-open-webui-open-webui-1 bash -c "curl host.docker.internal"        
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   138  100   138    0     0   123k      0 --:--:-- --:--:-- --:--:--  134k
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

I'm too inexperienced to check for the port, but trying to add it into the app as in original post results in same error message.

I'm not trying to be confrontational, just genuinely wondering as the above docker-compose everything worked and in scale it doesn't.

edit: if it matters I use the -gpu image in Scale, I have P400 in it and thought open-webui could utilize it for the internal embedding model if I use the -gpu image

@stavros-k
Copy link
Contributor

I really don't know how it all works. I just go by the docs.
And their docs say pipelines need additional container.

https://docs.openwebui.com/pipelines/

Maybe you have run the additional container on the VM before so it was able to connect?

@stavros-k
Copy link
Contributor

stavros-k commented Mar 7, 2025

It says that you dont need pipelines for antrhopic ?

Image

Maybe on your VM did something different to use it?

@hugalafutro
Copy link
Author

hugalafutro commented Mar 7, 2025

I'm not really sure myself, maybe the :main image includes it?

When I try to import the function for anthropic from here: https://openwebui.com/f/ncks024/anthropic_balaxxe_cot
in open-webui running in truenas it doesn't work and says this in log

2025-03-07 11:54:50.344 | ERROR    | open_webui.routers.openai:send_get_request:78 - Connection error: Cannot connect to host host.docker.internal:9099 ssl:default [Connect call failed ('172.16.0.1', 9099)] - {}
2025-03-07 11:54:50.899 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/models HTTP/1.1" 200 - {}
2025-03-07 11:54:50.970 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/v1/configs/banners HTTP/1.1" 200 - {}
2025-03-07 11:54:51.027 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/v1/tools/ HTTP/1.1" 200 - {}
2025-03-07 11:54:51.100 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/v1/channels/ HTTP/1.1" 200 - {}
2025-03-07 11:54:51.104 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/v1/functions/ HTTP/1.1" 200 - {}
2025-03-07 11:54:51.159 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/v1/chats/all/tags HTTP/1.1" 200 - {}
2025-03-07 11:54:51.216 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/v1/chats/pinned HTTP/1.1" 200 - {}
2025-03-07 11:54:51.285 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/version/updates HTTP/1.1" 200 - {}
2025-03-07 11:54:51.291 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 - {}
2025-03-07 11:54:51.292 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/v1/folders/ HTTP/1.1" 200 - {}
2025-03-07 11:54:51.456 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 185.201.188.10:0 - "GET /api/v1/chats/?page=2 HTTP/1.1" 200 - {}

and googling that address and port gave me the thread here: open-webui/open-webui#3206

So yes, sorry for being confusing (story of my life)

I am trying to import a function, which doesn't work and while googling the error I discovered it depends on the Pipelines. But I am not trying to use pipeline, I am trying to import Function, but it seems all interconnected somehow

@stavros-k
Copy link
Contributor

Well host.docker.internal resolves to the docker network address on the host, used to access other containers or host services.
So on your VM I'm pretty sure it runs the pipelines container (or via other way).

You can check if its a container with docker ps -a

@hugalafutro
Copy link
Author

hugalafutro commented Mar 7, 2025

let me spin the container back up on the vm and I'll check
edit: will take a bit my internet is crap

@hugalafutro
Copy link
Author

hugalafutro commented Mar 7, 2025

The confusion continues.
I spun a container with original docker-compose on vm. Tried to import function no error about address in docker console, but no function imported.

Then I restored the whole directory along with data and the function is there (as I imported it on the 3rd of March) and I can use Claude. But trying to import another function again doesn't work and spits error in browser console:

Uncaught (in promise) SyntaxError: Unexpected non-whitespace character after JSON at position 2 (line 1 column 3)
    at JSON.parse (<anonymous>)
    at _.onload (Functions.svelte:529:28)
Functions.svelte:404 

So at this point I'm not sure if it's broken at open-webui side or what (they update quite often)

All I'm trying to do is migrate open-webui to truenas, while being able to use Anthropic API. If I restore my old instance on vm where the function is already imported it works, but I'm unable to import a function into new install.

Perhaps the issue is in actuality that the Functions import is broken, I dunno.

I would still be thankful if you'd include an option to run https://github.com/open-webui/pipelines alongside the main container when creating the app. If not I don;t mind spinning it up as custom app.

for completion's sake these all the containers I run on the vm (I could not have had run the pipelines container as today is the first time I heard about it, until this point I assumed it's part of :main image):

CONTAINER ID   IMAGE                                                   COMMAND                  CREATED          STATUS                    PORTS                                                                                                                                                                                                                   NAMES
56d737e90eb2   ghcr.io/open-webui/open-webui:main                      "bash start.sh"          14 minutes ago   Up 14 minutes (healthy)   0.0.0.0:3333->8080/tcp, [::]:3333->8080/tcp                                                                                                                                                                             open-webui
6bf8223424df   privatebin/nginx-fpm-alpine                             "/etc/init.d/rc.local"   16 hours ago     Up 16 hours               0.0.0.0:12882->8080/tcp, [::]:12882->8080/tcp                                                                                                                                                                           privatebin
1715a0d7a7cd   ghcr.io/home-assistant/home-assistant:stable            "/init"                  16 hours ago     Up 16 hours                                                                                                                                                                                                                                       home-assistant
28798938ad38   eclipse-mosquitto:latest                                "/docker-entrypoint.…"   16 hours ago     Up 16 hours               0.0.0.0:1883->1883/tcp, [::]:1883->1883/tcp                                                                                                                                                                             mosquitto
b2cc4ac28500   amir20/dozzle:latest                                    "/dozzle"                20 hours ago     Up 20 hours               0.0.0.0:4999->8080/tcp, [::]:4999->8080/tcp                                                                                                                                                                             dozzle
d908c915b642   koenkk/zigbee2mqtt:latest                               "docker-entrypoint.s…"   3 days ago       Up 2 days                 0.0.0.0:8890->8080/tcp, [::]:8890->8080/tcp                                                                                                                                                                             zigbee2mqtt
84e8dcd3ae1f   ghcr.io/rafhaanshah/container-mon:latest                "./app"                  3 days ago       Up 2 days                                                                                                                                                                                                                                         container-mon
989e4d68ca43   crazymax/diun:latest                                    "diun serve"             3 days ago       Up 2 days                                                                                                                                                                                                                                         diun
bd9a9be1536f   crowdsecurity/crowdsec:latest                           "/bin/bash /docker_s…"   3 days ago       Up 2 days                                                                                                                                                                                                                                         crowdsec
9093a7dc577e   nicolargo/glances:latest-full                           "/bin/sh -c '/venv/b…"   3 days ago       Up 2 days                                                                                                                                                                                                                                         glances
1a2ae36215f3   shizunge/endlessh-go                                    "/endlessh -log_dir …"   3 days ago       Up 2 days                 2112/tcp, 0.0.0.0:22->2222/tcp, [::]:22->2222/tcp                                                                                                                                                                       endlessh-go
8443c5c43690   jc21/nginx-proxy-manager                                "/init"                  3 days ago       Up 2 days                 0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp, 0.0.0.0:8971->8971/tcp, [::]:8971->8971/tcp, 0.0.0.0:55415->55415/tcp, [::]:55415->55415/tcp, 0.0.0.0:10081->81/tcp, [::]:10081->81/tcp   nginx-proxy-manager
6f04584e3595   borgwarehouse/borgwarehouse                             "./docker-bw-init.sh"    3 days ago       Up 2 days                 0.0.0.0:3000->3000/tcp, [::]:3000->3000/tcp, 0.0.0.0:2223->22/tcp, [::]:2223->22/tcp                                                                                                                                    borgwarehouse
2e35ccc4feee   ghcr.io/sdr-enthusiasts/docker-planefinder:latest       "/init"                  3 days ago       Up 25 hours (healthy)     0.0.0.0:30053->30053/tcp, [::]:30053->30053/tcp, 30054/tcp                                                                                                                                                              pfclient
2e83c29a09fe   ghcr.io/sdr-enthusiasts/docker-radarbox:latest          "/init"                  3 days ago       Up 2 days (healthy)       30105/tcp, 32088/tcp                                                                                                                                                                                                    rbfeeder
bb3debadcc06   ghcr.io/sdr-enthusiasts/docker-adsbhub:latest           "/init"                  3 days ago       Up 2 days (healthy)                                                                                                                                                                                                                               adsbhub
b2c336ad91d2   ghcr.io/sdr-enthusiasts/docker-opensky-network:latest   "/init"                  3 days ago       Up 2 days (healthy)                                                                                                                                                                                                                               opensky
44d2b2dddebc   ghcr.io/sdr-enthusiasts/docker-piaware:latest           "/init"                  3 days ago       Up 2 days (healthy)       80/tcp, 30003/tcp, 30005/tcp, 30105/tcp, 30978-30979/tcp, 0.0.0.0:8081->8080/tcp, [::]:8081->8080/tcp                                                                                                                   piaware
3b0545881330   ghcr.io/sdr-enthusiasts/docker-flightradar24:latest     "/init"                  3 days ago       Up 2 days (healthy)       30003/tcp, 0.0.0.0:8754->8754/tcp, [::]:8754->8754/tcp, 30334/tcp                                                                                                                                                       fr24
e484672f60c8   ghcr.io/plane-watch/docker-plane-watch:latest           "/init"                  3 days ago       Up 2 days (healthy)                                                                                                                                                                                                                               planewatch
2e3e3281dc0f   ghcr.io/sdr-enthusiasts/docker-adsb-ultrafeeder         "/init"                  3 days ago       Up 2 days (healthy)       0.0.0.0:8089->80/tcp, [::]:8089->80/tcp                                                                                                                                                                                 ultrafeeder
a6357bbf40d1   shlinkio/shlink-web-client                              "/docker-entrypoint.…"   6 days ago       Up 2 days                 0.0.0.0:8334->8080/tcp, [::]:8334->8080/tcp                                                                                                                                                                             shlink-gui
fdea7651dfeb   shlinkio/shlink:stable                                  "/bin/sh ./docker-en…"   6 days ago       Up 2 days                 0.0.0.0:8092->8080/tcp, [::]:8092->8080/tcp                                                                                                                                                                             shlink-backend
2d5b1536d0e1   bbilly1/tubearchivist                                   "./run.sh"               7 days ago       Up 2 days (healthy)       0.0.0.0:8543->8000/tcp, [::]:8543->8000/tcp                                                                                                                                                                             tubearchivist
2ae2c6546001   redis/redis-stack-server                                "/entrypoint.sh"         7 days ago       Up 2 days                 6379/tcp                                                                                                                                                                                                                archivist-redis
5c2a64d2494b   bbilly1/tubearchivist-es                                "/bin/tini -- /usr/l…"   7 days ago       Up 2 days                 9200/tcp, 9300/tcp                                                                                                                                                                                                      archivist-es
362c00c58719   librenms/librenms:latest                                "/init"                  7 days ago       Up 2 days                 162/tcp, 8000/tcp, 162/udp, 0.0.0.0:5140->514/tcp, 0.0.0.0:5140->514/udp, [::]:5140->514/tcp, [::]:5140->514/udp                                                                                                        librenms_syslogng
f69723b7bf72   librenms/librenms:latest                                "/init"                  7 days ago       Up 2 days                 514/tcp, 0.0.0.0:162->162/tcp, 0.0.0.0:162->162/udp, [::]:162->162/tcp, [::]:162->162/udp, 8000/tcp, 514/udp                                                                                                            librenms_snmptrapd
89459388fbe4   librenms/librenms:latest                                "/init"                  7 days ago       Up 2 days                 162/tcp, 162/udp, 514/tcp, 8000/tcp, 514/udp                                                                                                                                                                            librenms_dispatcher
50f223786e34   librenms/librenms:latest                                "/init"                  7 days ago       Up 2 days                 162/tcp, 162/udp, 514/tcp, 514/udp, 0.0.0.0:8161->8000/tcp, [::]:8161->8000/tcp                                                                                                                                         librenms
33dc40c8a4e6   mariadb:10.5                                            "docker-entrypoint.s…"   7 days ago       Up 2 days                 3306/tcp                                                                                                                                                                                                                librenms_db
7239b2e7aa41   redis:5.0-alpine                                        "docker-entrypoint.s…"   7 days ago       Up 2 days                 6379/tcp                                                                                                                                                                                                                librenms_redis
6672b87ac64d   onlyoffice/documentserver                               "/app/ds/run-documen…"   7 days ago       Up 2 days                 443/tcp, 0.0.0.0:10044->80/tcp, [::]:10044->80/tcp                                                                                                                                                                      onlyoffice-ds
d6ed223d7cbb   ghcr.io/arabcoders/watchstate:latest                    "/opt/bin/init-conta…"   8 days ago       Up 2 days (healthy)       8443/tcp, 9000/tcp, 0.0.0.0:8192->8080/tcp, [::]:8192->8080/tcp                                                                                                                                                         watchstate
4021dbfe1e44   portainer/agent                                         "./agent"                8 days ago       Up 2 days                 0.0.0.0:9001->9001/tcp, [::]:9001->9001/tcp                                                                                                                                                                             portainer_agent
def40957717e   portainer/portainer-ce:latest                           "/portainer"             8 days ago       Up 2 days                 8000/tcp, 9443/tcp, 0.0.0.0:9900->9000/tcp, [::]:9900->9000/tcp                                                                                                                                                         portainer
686fb6c29fa5   ghcr.io/blakeblackshear/frigate:stable                  "/init"                  10 days ago      Up 2 days (healthy)       172.17.0.1:5000->5000/tcp, 0.0.0.0:8554-8555->8554-8555/tcp, [::]:8554-8555->8554-8555/tcp, 0.0.0.0:8555->8555/udp, [::]:8555->8555/udp, 0.0.0.0:18971->8971/tcp, [::]:18971->8971/tcp                                  frigate
6a38559a870b   willfarrell/autoheal:1.2.0                              "/docker-entrypoint …"   2 weeks ago      Up 2 days (healthy)                                                                                                                                                                                                                               autoheal
330f055f8101   mariadb:latest                                          "docker-entrypoint.s…"   2 weeks ago      Up 2 days                 3306/tcp                                                                                                                                                                                                                shlink-database
89bfa78a0a37   rustdesk/rustdesk-server                                "hbbs -r 192.168.1.1…"   5 weeks ago      Up 2 days                 0.0.0.0:21115-21116->21115-21116/tcp, [::]:21115-21116->21115-21116/tcp, 0.0.0.0:21118->21118/tcp, [::]:21118->21118/tcp, 0.0.0.0:21116->21116/udp, [::]:21116->21116/udp                                               rustdesk_hbbs
0ac6d48b14d3   rustdesk/rustdesk-server                                "hbbr -k _"              5 weeks ago      Up 2 days                 0.0.0.0:21117->21117/tcp, [::]:21117->21117/tcp, 0.0.0.0:21119->21119/tcp, [::]:21119->21119/tcp                                                                                                                        rustdesk_hbbr
c49d6b748abc   foxxmd/multi-scrobbler                                  "/init"                  6 weeks ago      Up 2 days                 0.0.0.0:9078->9078/tcp, [::]:9078->9078/tcp                                                                                                                                                                             multi-scrobbler
9b48366f21df   caronc/apprise                                          "/opt/apprise/webapp…"   8 weeks ago      Up 2 days                 8000/tcp                                                                                                                                                                                                                apprise
4a862851e713   2fauth/2fauth                                           "/usr/local/bin/entr…"   3 months ago     Up 16 hours               0.0.0.0:46413->8000/tcp, [::]:46413->8000/tcp                                                                                                                                                                           2fauth
e28187a8ce11   ghcr.io/wg-easy/wg-easy                                 "docker-entrypoint.s…"   5 months ago     Up 2 days (healthy)       0.0.0.0:51820->51820/udp, [::]:51820->51820/udp, 0.0.0.0:51821->51821/tcp, [::]:51821->51821/tcp                                                                                                                        wg-easy
35e89d360e45   louislam/dockge:1                                       "/usr/bin/dumb-init …"   9 months ago     Up 2 days (healthy)       0.0.0.0:5001->5001/tcp, [::]:5001->5001/tcp                                                                                                                                                                             dockge-dockge-1

edit: I think the pipelines are needed because most of the functions I try are tagged [function][pipe], but then for the love of god how was I able to import the function 4 days ago?

Image

@hugalafutro
Copy link
Author

I created a pipelines custom app in truenas, open-webui detected it immediately without having to add the address manually, so as enhancement it is imho still viable

Seems my problem wasn't actually related to pipelines and is a recent-ish one (open-webui/open-webui#8716). Creating the function manually and pasting the code in actually creates the function.

@stavros-k
Copy link
Contributor

Okay I've looked into adding it as "bundled in" container that you could enable with a toggle.
But I cant find a way to automatically configure it using env vars or something.

I believe this might be worth adding as a standalone app, and users can connect it manually anyway.

@stavros-k
Copy link
Contributor

Semi-blocked by open-webui/pipelines#309

@stavros-k stavros-k added app-request and removed enhancement New feature or request labels Mar 7, 2025
@stavros-k stavros-k changed the title open-webui Pipelines not working due to missing internal endpoint Add Open-webui Pipelines Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants