[GH-ISSUE #1012] Connect, pull & delete models working, but cannot select model to chat #50963

Closed
opened 2026-05-05 11:39:33 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @suderman on GitHub (Mar 3, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/1012

Bug Report

Description

Bug Summary:
I can connect to Ollama, pull and delete models, but I cannot select a model.

Steps to Reproduce:

  1. Ollama is running in background via systemd service (NixOS). Open WebUI is running in docker container on same system.
  2. Login to Open WebUI
  3. Settings > Connections > Ollama Base URL is already set to http://host.docker.internal:11434 and clicking button displays: "Server connection verified"
  4. Settings > Models > Pull a model from Ollama.com > phi:latest and clicking the button displays: "Model 'phi:latest' has been successfully downloaded."
  5. New Chat > Select a model > phi:latest > and clicking "Set as default" displays: "Default model updated"
  6. Type "hello" into input field and hit enter displays two errors: "Ollama: model is required" and "Uh-oh! There was an issue connecting to Ollama."

Expected Behavior:
Ollama to greet to say hello back.

Actual Behavior:
Error connecting to Ollama. Appears the UI is not setting and/or providing a selected model to the backend.

Environment

  • NixOS 23.11
  • Firefox 122.0.1

Reproduction Details

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I have reviewed the troubleshooting.md document.
  • I have included the browser console logs.
  • I have included the Docker container logs.

Logs and Screenshots

Browser Console Logs:
Browser Console

Docker Container Logs:

INFO:     10.1.0.4:0 - "GET / HTTP/1.1" 304 Not Modified
INFO:     10.1.0.4:0 - "GET /api/config HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "GET /api/v1/auths/ HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "GET /ollama/api/api/tags HTTP/1.1" 200 OK
https://api.openai.com/v1/models 
INFO:     10.1.0.4:0 - "GET /openai/api/models HTTP/1.1" 401 Unauthorized
id='b088ff91-2bf6-401c-9e30-44a37c6d3a8c' name='Jon Suderman' email='jon@suderman.net' role='admin' profile_image_url='https://www.gravatar.com/avatar/b30502e9e12fe8ffda4ea22e1a0888b339cc44e4e1f528c8b6094aa1264f62e2?d=mp' timestamp=1709417342
INFO:     10.1.0.4:0 - "GET /litellm/api/v1/models HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "GET /api/v1/modelfiles/ HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "GET /api/v1/prompts/ HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "GET /api/v1/documents/ HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "GET /api/v1/chats/tags/all HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "GET /api/changelog HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "GET /api/v1/chats/ HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "GET /ollama/api/api/tags HTTP/1.1" 200 OK
https://api.openai.com/v1/models 
INFO:     10.1.0.4:0 - "GET /openai/api/models HTTP/1.1" 401 Unauthorized
id='b088ff91-2bf6-401c-9e30-44a37c6d3a8c' name='Jon Suderman' email='jon@suderman.net' role='admin' profile_image_url='https://www.gravatar.com/avatar/b30502e9e12fe8ffda4ea22e1a0888b339cc44e4e1f528c8b6094aa1264f62e2?d=mp' timestamp=1709417342
INFO:     10.1.0.4:0 - "GET /litellm/api/v1/models HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "POST /api/v1/configs/default/models HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "POST /api/v1/chats/new HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "GET /api/v1/chats/ HTTP/1.1" 200 OK
INFO:     10.1.0.4:0 - "POST /ollama/api/api/chat HTTP/1.1" 500 Internal Server Error
INFO:     10.1.0.4:0 - "POST /ollama/api/api/generate HTTP/1.1" 500 Internal Server Error

Screenshots (if applicable):

image

Installation Method

I'm using the ollama service found in NixOS unstable here as part of a custom module that runs the ghcr.io/open-webui/open-webui image in a docker container. Here's my custom nixos module:

{ config, lib, pkgs, this, inputs, ... }: 

let 

  cfg = config.modules.ollama;
  inherit (builtins) toString;
  inherit (lib) mkIf mkOption mkBefore types;
  inherit (config.modules) traefik;
  inherit (this.lib) destabilize;

  # https://github.com/open-webui/open-webui
  tag = "main";
  dataDir = "/var/lib/ollama";
  port = 11434;
  webPort = 8080;

in {

  imports = 

    # Unstable upstream nixos module
    # https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/misc/ollama.nix
    ( destabilize inputs.nixpkgs-unstable "services/misc/ollama.nix" );

  options.modules.ollama = {
    enable = lib.options.mkEnableOption "ollama"; 
  };

  config = mkIf cfg.enable {

    # Ensure data directory exists with expected ownership
    file."${dataDir}/webui" = { 
      type = "dir"; 
      mode = 775; 
      user = "ollama";
      group = "ollama";
    };

    # Enable ollama and listen on all addresses
    services.ollama = {
      enable = true;
      package = pkgs.unstable.ollama;
      listenAddress = "0.0.0.0:${toString port}";
    };

    # Server back-end
    virtualisation.oci-containers.containers.open-webui = {
      image = "ghcr.io/open-webui/open-webui:${tag}";

      # Map volumes to host
      volumes = [ 
        "${dataDir}/webui:/app/backend/data"
      ];

      environment = {
        WEBUI_SECRET_KEY = "vrE43JBRQHd6hc7sucdJvJV1FJjd5O4Rn2hf63jd8hnhG3feTajkA";
      };

      # Traefik labels
      extraOptions = traefik.labels [ "ai" webPort ]

      # Networking
      ++ [ "--add-host=host.docker.internal:host-gateway" ];

    };

    # Open up the firewall for ollama
    networking.firewall.allowedTCPPorts = [ port ];

    # Also serve ollama on reverse proxy
    modules.traefik = {
      enable = true;
      routers.ollama = "http://127.0.0.1:${toString port}";
    };

  };

}

Additional Information

I don't think it's a connection issue because I can communicate with ollama via curl from within the container. First I attach to the container and install curl:

docker exec -it open-webui bash 
apt-get update && apt-get install curl

And then I'm able to run curl host.docker.internal:11434/api/generate and say hello to with the following results:

root@366b18f61d6c:/app/backend# curl host.docker.internal:11434/api/generate -d '{ "model": "phi", "prompt": "hello" }'
{"model":"phi","created_at":"2024-03-03T17:56:25.134576211Z","response":" Hello","done":false}
{"model":"phi","created_at":"2024-03-03T17:56:25.214508503Z","response":",","done":false}
{"model":"phi","created_at":"2024-03-03T17:56:25.257896588Z","response":" how","done":false}
{"model":"phi","created_at":"2024-03-03T17:56:25.301435919Z","response":" can","done":false}
{"model":"phi","created_at":"2024-03-03T17:56:25.344804708Z","response":" I","done":false}
{"model":"phi","created_at":"2024-03-03T17:56:25.387875603Z","response":" assist","done":false}
{"model":"phi","created_at":"2024-03-03T17:56:25.43104759Z","response":" you","done":false}
{"model":"phi","created_at":"2024-03-03T17:56:25.474697863Z","response":" today","done":false}
{"model":"phi","created_at":"2024-03-03T17:56:25.523738373Z","response":"?","done":false}
{"model":"phi","created_at":"2024-03-03T17:56:25.567499029Z","response":"\n","done":false}
{"model":"phi","created_at":"2024-03-03T17:56:25.654656954Z","response":"","done":true,"context":[11964,25,317,8537,1022,257,11040,2836,290,281,11666,4430,8796,13,383,8796,3607,7613,7429,284,262,2836,338,2683,13,198,12982,25,23748,198,48902,25,18435,11,703,460,314,3342,345,1909,30,198],"total_duration":7640325193,"load_duration":754523608,"prompt_eval_count":32,"prompt_eval_duration":6365256000,"eval_count":12,"eval_duration":520109000}
Originally created by @suderman on GitHub (Mar 3, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/1012 # Bug Report ## Description **Bug Summary:** I can connect to Ollama, pull and delete models, but I cannot select a model. **Steps to Reproduce:** 1. Ollama is running in background via systemd service (NixOS). Open WebUI is running in docker container on same system. 2. Login to Open WebUI 3. Settings > Connections > Ollama Base URL is already set to `http://host.docker.internal:11434` and clicking button displays: _"Server connection verified"_ 4. Settings > Models > Pull a model from Ollama.com > `phi:latest` and clicking the button displays: _"Model 'phi:latest' has been successfully downloaded."_ 5. New Chat > Select a model > `phi:latest` > and clicking "Set as default" displays: _"Default model updated"_ 6. Type "hello" into input field and hit enter displays two errors: _"Ollama: model is required"_ and _"Uh-oh! There was an issue connecting to Ollama."_ **Expected Behavior:** Ollama to greet to say hello back. **Actual Behavior:** Error connecting to Ollama. Appears the UI is not setting and/or providing a selected model to the backend. ## Environment - NixOS 23.11 - Firefox 122.0.1 ## Reproduction Details **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I have reviewed the troubleshooting.md document. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. ## Logs and Screenshots **Browser Console Logs:** ![Browser Console](https://github.com/open-webui/open-webui/assets/12491/d46a6c3d-eed5-4c00-8e42-08a4d9a10ecb) **Docker Container Logs:** ``` INFO: 10.1.0.4:0 - "GET / HTTP/1.1" 304 Not Modified INFO: 10.1.0.4:0 - "GET /api/config HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "GET /api/v1/auths/ HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "GET /ollama/api/api/tags HTTP/1.1" 200 OK https://api.openai.com/v1/models INFO: 10.1.0.4:0 - "GET /openai/api/models HTTP/1.1" 401 Unauthorized id='b088ff91-2bf6-401c-9e30-44a37c6d3a8c' name='Jon Suderman' email='jon@suderman.net' role='admin' profile_image_url='https://www.gravatar.com/avatar/b30502e9e12fe8ffda4ea22e1a0888b339cc44e4e1f528c8b6094aa1264f62e2?d=mp' timestamp=1709417342 INFO: 10.1.0.4:0 - "GET /litellm/api/v1/models HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "GET /api/v1/modelfiles/ HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "GET /api/v1/prompts/ HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "GET /api/v1/documents/ HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "GET /api/v1/chats/tags/all HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "GET /api/changelog HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "GET /api/v1/chats/ HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "GET /ollama/api/api/tags HTTP/1.1" 200 OK https://api.openai.com/v1/models INFO: 10.1.0.4:0 - "GET /openai/api/models HTTP/1.1" 401 Unauthorized id='b088ff91-2bf6-401c-9e30-44a37c6d3a8c' name='Jon Suderman' email='jon@suderman.net' role='admin' profile_image_url='https://www.gravatar.com/avatar/b30502e9e12fe8ffda4ea22e1a0888b339cc44e4e1f528c8b6094aa1264f62e2?d=mp' timestamp=1709417342 INFO: 10.1.0.4:0 - "GET /litellm/api/v1/models HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "POST /api/v1/configs/default/models HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "POST /api/v1/chats/new HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "GET /api/v1/chats/ HTTP/1.1" 200 OK INFO: 10.1.0.4:0 - "POST /ollama/api/api/chat HTTP/1.1" 500 Internal Server Error INFO: 10.1.0.4:0 - "POST /ollama/api/api/generate HTTP/1.1" 500 Internal Server Error ``` **Screenshots (if applicable):** ![image](https://github.com/open-webui/open-webui/assets/12491/a94be7ae-bae4-41a5-96ac-91e4ba89f563) ## Installation Method I'm using the ollama service found in NixOS unstable [here](https://search.nixos.org/options?channel=unstable&show=ollama&query=ollama) as part of a custom module that runs the [ghcr.io/open-webui/open-webui](https://github.com/open-webui/open-webui/releases) image in a docker container. Here's my custom nixos module: ```nix { config, lib, pkgs, this, inputs, ... }: let cfg = config.modules.ollama; inherit (builtins) toString; inherit (lib) mkIf mkOption mkBefore types; inherit (config.modules) traefik; inherit (this.lib) destabilize; # https://github.com/open-webui/open-webui tag = "main"; dataDir = "/var/lib/ollama"; port = 11434; webPort = 8080; in { imports = # Unstable upstream nixos module # https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/misc/ollama.nix ( destabilize inputs.nixpkgs-unstable "services/misc/ollama.nix" ); options.modules.ollama = { enable = lib.options.mkEnableOption "ollama"; }; config = mkIf cfg.enable { # Ensure data directory exists with expected ownership file."${dataDir}/webui" = { type = "dir"; mode = 775; user = "ollama"; group = "ollama"; }; # Enable ollama and listen on all addresses services.ollama = { enable = true; package = pkgs.unstable.ollama; listenAddress = "0.0.0.0:${toString port}"; }; # Server back-end virtualisation.oci-containers.containers.open-webui = { image = "ghcr.io/open-webui/open-webui:${tag}"; # Map volumes to host volumes = [ "${dataDir}/webui:/app/backend/data" ]; environment = { WEBUI_SECRET_KEY = "vrE43JBRQHd6hc7sucdJvJV1FJjd5O4Rn2hf63jd8hnhG3feTajkA"; }; # Traefik labels extraOptions = traefik.labels [ "ai" webPort ] # Networking ++ [ "--add-host=host.docker.internal:host-gateway" ]; }; # Open up the firewall for ollama networking.firewall.allowedTCPPorts = [ port ]; # Also serve ollama on reverse proxy modules.traefik = { enable = true; routers.ollama = "http://127.0.0.1:${toString port}"; }; }; } ``` ## Additional Information I don't think it's a connection issue because I can communicate with ollama via curl from within the container. First I attach to the container and install curl: ```bash docker exec -it open-webui bash apt-get update && apt-get install curl ``` And then I'm able to run `curl host.docker.internal:11434/api/generate` and say hello to with the following results: ```bash root@366b18f61d6c:/app/backend# curl host.docker.internal:11434/api/generate -d '{ "model": "phi", "prompt": "hello" }' {"model":"phi","created_at":"2024-03-03T17:56:25.134576211Z","response":" Hello","done":false} {"model":"phi","created_at":"2024-03-03T17:56:25.214508503Z","response":",","done":false} {"model":"phi","created_at":"2024-03-03T17:56:25.257896588Z","response":" how","done":false} {"model":"phi","created_at":"2024-03-03T17:56:25.301435919Z","response":" can","done":false} {"model":"phi","created_at":"2024-03-03T17:56:25.344804708Z","response":" I","done":false} {"model":"phi","created_at":"2024-03-03T17:56:25.387875603Z","response":" assist","done":false} {"model":"phi","created_at":"2024-03-03T17:56:25.43104759Z","response":" you","done":false} {"model":"phi","created_at":"2024-03-03T17:56:25.474697863Z","response":" today","done":false} {"model":"phi","created_at":"2024-03-03T17:56:25.523738373Z","response":"?","done":false} {"model":"phi","created_at":"2024-03-03T17:56:25.567499029Z","response":"\n","done":false} {"model":"phi","created_at":"2024-03-03T17:56:25.654656954Z","response":"","done":true,"context":[11964,25,317,8537,1022,257,11040,2836,290,281,11666,4430,8796,13,383,8796,3607,7613,7429,284,262,2836,338,2683,13,198,12982,25,23748,198,48902,25,18435,11,703,460,314,3342,345,1909,30,198],"total_duration":7640325193,"load_duration":754523608,"prompt_eval_count":32,"prompt_eval_duration":6365256000,"eval_count":12,"eval_duration":520109000} ```
Author
Owner

@tjbck commented on GitHub (Mar 3, 2024):

Unable to reproduce, could you share your screenshot of the network tab with the chat request highlighted?

image

<!-- gh-comment-id:1975279238 --> @tjbck commented on GitHub (Mar 3, 2024): Unable to reproduce, could you share your screenshot of the network tab with the chat request highlighted? ![image](https://github.com/open-webui/open-webui/assets/25473318/4be3412c-9063-4bcb-acd7-15de94045ed4)
Author
Owner

@suderman commented on GitHub (Mar 3, 2024):

Firefox:
image

Chromium:
image

image

<!-- gh-comment-id:1975309902 --> @suderman commented on GitHub (Mar 3, 2024): Firefox: ![image](https://github.com/open-webui/open-webui/assets/12491/35b4ce77-0610-47c9-af46-576ba5daf65a) Chromium: ![image](https://github.com/open-webui/open-webui/assets/12491/10ad138e-0591-42c1-8398-28384358c165) ![image](https://github.com/open-webui/open-webui/assets/12491/5a817be7-b6e5-4123-863a-dd742c3b8dab)
Author
Owner

@suderman commented on GitHub (Mar 3, 2024):

Is each model <option> in the <select> box supposed to have empty value attributes? Also, after choosing one, the select box no longer responds and doesn't respond to clicks.

image

<!-- gh-comment-id:1975319448 --> @suderman commented on GitHub (Mar 3, 2024): Is each model `<option>` in the `<select>` box supposed to have empty value attributes? Also, after choosing one, the select box no longer responds and doesn't respond to clicks. ![image](https://github.com/open-webui/open-webui/assets/12491/4756e12b-4e4f-446a-b368-13da5fe30787)
Author
Owner

@tjbck commented on GitHub (Mar 3, 2024):

image

Here's what they should look like.

<!-- gh-comment-id:1975322528 --> @tjbck commented on GitHub (Mar 3, 2024): ![image](https://github.com/open-webui/open-webui/assets/25473318/3b71daf3-186a-4d50-8b8f-331de3880338) Here's what they should look like.
Author
Owner

@suderman commented on GitHub (Mar 3, 2024):

I figured out the problem: my ollama was out of date. I upgraded from 0.1.17 to 0.1.27 and now it's all good. Sorry for the hassle!

<!-- gh-comment-id:1975397771 --> @suderman commented on GitHub (Mar 3, 2024): I figured out the problem: my ollama was out of date. I upgraded from [0.1.17](https://github.com/ollama/ollama/releases/tag/v0.1.17) to [0.1.27](https://github.com/ollama/ollama/releases/tag/v0.1.27) and now it's all good. Sorry for the hassle!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#50963