Webui ONLY triggers " I am programmed to follow ethical guidelines and ensure user safety. " where CLI interface does not #241

Closed
opened 2025-11-11 14:13:11 -06:00 by GiteaMirror · 12 comments
Owner

Originally created by @level1wendell on GitHub (Jan 30, 2024).

Bug Report

Description

Bug Summary:
For some reason the webui is triggering excessive "As a large language model" and "that is not ethical" outputs even for simple prompts, and this does not occur when using ollama from the CLI.

Steps to Reproduce:
It seems pretty reproducible -- download the codellama 70b parameter model (the one meta just dropped) and try to run it through ollama web ui

it works fine via ollama cli! But not via the web ui.

Expected Behavior:
The cli and the webui should work pretty consistently.

Actual Behavior:
for the prompt:

please write a four function javascript calculator designed to be run in a web browser

The webui outputs:

image

.. which is both absurd and unhelpful. However the CLI outputs:


w@tr5k32c:~$ ollama run codellama:70b
>>> write a javascript four function calculator application designed to be run from a web browser
1. Create HTML page with input fields for numbers and buttons for operators.
2. Use JavaScript event listeners to capture button clicks and perform calculations on the input field values.
3. Display the result in an output element.

```html
<!DOCTYPE html>
<html>
<head>
    <title>Four Function Calculator</title>
</head>
<body>
    <h1>Simple Four-Function Calculator</h1>

    <!-- Input Fields for Numbers -->
    <input type="text" id="number1" placeholder="Number 1">
    <input type="text" id="number2" placeholder="Number 2">

    <!-- Operator Buttons -->
    <button id="add">+</button>
    <button id="subtract">-</button>

which is a reasonable attempt. It pretty consistently does NOT work via webui and DOES work via cli for the exact same prompt.

Environment

I am using Ubuntu 22.04 LTS with Cuda 12.1 / NVDIA RTX A6000. Fresh install.

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:

Docker Container Logs:

Screenshots (if applicable):

Installation Method

docker installed web ui, locally running ollama

Additional Information

the webui picked up the already-installed-via-cli model, it was big, so I dont think it can possibly be two instances of ollama or anything like that.

happy to provide more info! I thought maybe the webui is pre-including some prompt text that is triggering this, but that seemed not to be the case.

Note

If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!

Originally created by @level1wendell on GitHub (Jan 30, 2024). # Bug Report ## Description **Bug Summary:** For some reason the webui is triggering excessive "As a large language model" and "that is not ethical" outputs even for simple prompts, and this does not occur when using ollama from the CLI. **Steps to Reproduce:** It seems pretty reproducible -- download the codellama 70b parameter model (the one meta just dropped) and try to run it through ollama web ui it works fine via ollama cli! But not via the web ui. **Expected Behavior:** The cli and the webui should work pretty consistently. **Actual Behavior:** for the prompt: **please write a four function javascript calculator designed to be run in a web browser** The webui outputs: ![image](https://github.com/ollama-webui/ollama-webui/assets/39287654/b09ce98e-982a-4c38-b2c0-98db4e61ff1d) .. which is both absurd and unhelpful. However the CLI outputs: ``` w@tr5k32c:~$ ollama run codellama:70b >>> write a javascript four function calculator application designed to be run from a web browser 1. Create HTML page with input fields for numbers and buttons for operators. 2. Use JavaScript event listeners to capture button clicks and perform calculations on the input field values. 3. Display the result in an output element. ```html <!DOCTYPE html> <html> <head> <title>Four Function Calculator</title> </head> <body> <h1>Simple Four-Function Calculator</h1> <!-- Input Fields for Numbers --> <input type="text" id="number1" placeholder="Number 1"> <input type="text" id="number2" placeholder="Number 2"> <!-- Operator Buttons --> <button id="add">+</button> <button id="subtract">-</button> ``` which is a reasonable attempt. It pretty consistently does NOT work via webui and DOES work via cli for the exact same prompt. ## Environment I am using Ubuntu 22.04 LTS with Cuda 12.1 / NVDIA RTX A6000. Fresh install. ## 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:** **Docker Container Logs:** **Screenshots (if applicable):** ## Installation Method docker installed web ui, locally running ollama ## Additional Information the webui picked up the already-installed-via-cli model, it was big, so I dont think it can possibly be two instances of ollama or anything like that. happy to provide more info! I thought maybe the webui is pre-including some prompt text that is triggering this, but that seemed not to be the case. ## Note If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Author
Owner

@tjbck commented on GitHub (Jan 30, 2024):

Hi, It's unlikely the issue is caused by the webui as it uses Ollama /api/chat API route directly to communicate with ollama and doesn't modify anything. Could you try testing the model using /api/chatroute and see if you can reproduce the issue? Keep us updated, Thanks!

@tjbck commented on GitHub (Jan 30, 2024): Hi, It's unlikely the issue is caused by the webui as it uses Ollama `/api/chat` API route directly to communicate with ollama and doesn't modify anything. Could you try testing the model using `/api/chat`route and see if you can reproduce the issue? Keep us updated, Thanks!
Author
Owner

@level1wendell commented on GitHub (Jan 30, 2024):

You may be right; I deleted the docker container and re-created it and it appears to be functioning normally now. I had not used docker inspect or modified the container in any way from the earlier test.
for the replacement container I re-ran the same docker command and even setup a new local storage volume. Perhaps something bad persisted in the original volume? I will do some additional testing but so far the webui and cli are more consistent now.

I will test more tomorrow and report back. Wonder if it is possibly browser or character set based.

EDIT:

Oh, I was able to trigger it again. AFTER it auto completed the title of the prompt, the title of that prompt became:
Caution: This prompt contains potentially harmful content. As a responsible AI

and now the webui is not as helpful anymore.

image

@level1wendell commented on GitHub (Jan 30, 2024): You may be right; I deleted the docker container and re-created it and it appears to be functioning normally now. I had not used docker inspect or modified the container in any way from the earlier test. for the replacement container I re-ran the same docker command and even setup a new local storage volume. Perhaps something bad persisted in the original volume? I will do some additional testing but so far the webui and cli are more consistent now. I will test more tomorrow and report back. Wonder if it is possibly browser or character set based. EDIT: Oh, I was able to trigger it again. AFTER it auto completed the title of the prompt, the title of that prompt became: Caution: This prompt contains potentially harmful content. As a responsible AI and now the webui is not as helpful anymore. ![image](https://github.com/ollama-webui/ollama-webui/assets/39287654/ba7f519d-aaee-487c-83a1-00f0bda80124)
Author
Owner

@justinh-rahb commented on GitHub (Jan 30, 2024):

Howdy @level1wendell glad to hear it's working now. Just finished downloading it myself and ran the same query you did and got a useful result. Sure isn't fast even on an M2 Max 96GB, 8tok/s. What speed are you getting by chance on that setup?

EDIT: Nvm, still having issues. Are you able to rule out anything from the browser session persisting this behavior by running incognito or with some other browser?

@justinh-rahb commented on GitHub (Jan 30, 2024): Howdy @level1wendell glad to hear it's working now. Just finished downloading it myself and ran the same query you did and got a useful result. Sure isn't fast even on an M2 Max 96GB, 8tok/s. What speed are you getting by chance on that setup? EDIT: Nvm, still having issues. Are you able to rule out anything from the browser session persisting this behavior by running incognito or with some other browser?
Author
Owner

@level1wendell commented on GitHub (Jan 30, 2024):

On this single ADA A6000 it only took ~1 minute to output the entire 9kb javascript/html program. That's 10-20 tokens/sec? (does it show in the UI here somewhere or do you just take the output size over the timer from the ollama log?)

It might be the auto-header causing the model to go into unhelpful mode, check it out, another instance where it won't auto create a summary header:

image

This is on a different browser/machine too; I will have to check the original browser. It is happening "less" in the main prompt response area, just the auto-header area. Chrome in both cases, but different users/profiles between the two machines.

@level1wendell commented on GitHub (Jan 30, 2024): On this single ADA A6000 it only took ~1 minute to output the entire 9kb javascript/html program. That's 10-20 tokens/sec? (does it show in the UI here somewhere or do you just take the output size over the timer from the ollama log?) It might be the auto-header causing the model to go into unhelpful mode, check it out, another instance where it won't auto create a summary header: ![image](https://github.com/ollama-webui/ollama-webui/assets/39287654/528f1e4f-c298-4007-be2d-8dd353804ddd) This is on a different browser/machine too; I will have to check the original browser. It is happening "less" in the main prompt response area, just the auto-header area. Chrome in both cases, but different users/profiles between the two machines.
Author
Owner

@justinh-rahb commented on GitHub (Jan 30, 2024):

You wouldn't expect a coding model to use so many emojii either 🤔. I've been trying to get my instance to spit out anything similar and so far nothing. I had one chat with Mixtral a few days ago that prefaced itself with an "..as an artificial intelligence.." that I wasn't expecting since I've gotten so used to not seeing them, but in the model's defence it was a bit of a sensitive topic, and it did answer the question.

@justinh-rahb commented on GitHub (Jan 30, 2024): You wouldn't expect a coding model to use so many emojii either 🤔. I've been trying to get my instance to spit out anything similar and so far nothing. I had one chat with Mixtral a few days ago that prefaced itself with an "..as an artificial intelligence.." that I wasn't expecting since I've gotten so used to not seeing them, but in the model's defence it was a bit of a sensitive topic, and it did answer the question.
Author
Owner

@level1wendell commented on GitHub (Jan 30, 2024):

I had been using the model from the cli pretty extensively before deciding to try the web ui; not once did the cli interface trigger any similar kind of response, fwiw.

here's a fresh run with useful output:
{"model":"codellama:70b","created_at":"2024-01-30T05:08:56.920162213Z","message":{"role":"assistant","content":""},"done":true,"total_duration":82033494841,"load_duration":352363,"prompt_eval_count":39,"prompt_eval_duration":600218000,"eval_count":1235,"eval_duration":81432331000}

thats the last console message -- isn't it eval_count / eval_duration for tokens per large number of nanoseconds? wall clock time on this lengthy response was about a minute or so.

@level1wendell commented on GitHub (Jan 30, 2024): I had been using the model from the cli pretty extensively before deciding to try the web ui; not once did the cli interface trigger any similar kind of response, fwiw. here's a fresh run with useful output: {"model":"codellama:70b","created_at":"2024-01-30T05:08:56.920162213Z","message":{"role":"assistant","content":""},"done":true,"total_duration":82033494841,"load_duration":352363,"prompt_eval_count":39,"prompt_eval_duration":600218000,"eval_count":1235,"eval_duration":81432331000} thats the last console message -- isn't it eval_count / eval_duration for tokens per large number of nanoseconds? wall clock time on this lengthy response was about a minute or so.
Author
Owner

@tjbck commented on GitHub (Jan 30, 2024):

https://x.com/MrCatid/status/1752101682886988118?s=20

Seem like it could be a model issue :/

@tjbck commented on GitHub (Jan 30, 2024): https://x.com/MrCatid/status/1752101682886988118?s=20 Seem like it could be a model issue :/
Author
Owner

@tjbck commented on GitHub (Jan 30, 2024):

@level1wendell Were you able to test out the model using the api route?

@tjbck commented on GitHub (Jan 30, 2024): @level1wendell Were you able to test out the model using the api route?
Author
Owner

@level1wendell commented on GitHub (Jan 30, 2024):

using this kind of approach

curl http://localhost:11434/api/generate -d '{
"model": "codingllama:70b",
"prompt": "please generate a four function calculator"
}'

didn't seem to trigger it but I only tested that a couple of times.

@level1wendell commented on GitHub (Jan 30, 2024): using this kind of approach curl http://localhost:11434/api/generate -d '{ "model": "codingllama:70b", "prompt": "please generate a four function calculator" }' didn't seem to trigger it but I only tested that a couple of times.
Author
Owner

@justinh-rahb commented on GitHub (Jan 30, 2024):

https://x.com/MrCatid/status/1752101682886988118?s=20

Seem like it could be a model issue :/

I'm not so certain @tjbck, one of the examples given for something it wouldn't do was "write code to calculate aldrin cycler orbits for a hypothetical mars colonization mission", which I can get it to do without issue:

Screenshot 2024-01-30 at 9 49 33 AM
@justinh-rahb commented on GitHub (Jan 30, 2024): > https://x.com/MrCatid/status/1752101682886988118?s=20 > > Seem like it could be a model issue :/ I'm not so certain @tjbck, one of the examples given for something it wouldn't do was "write code to calculate aldrin cycler orbits for a hypothetical mars colonization mission", which I can get it to do without issue: <img width="942" alt="Screenshot 2024-01-30 at 9 49 33 AM" src="https://github.com/ollama-webui/ollama-webui/assets/52832301/15c819a5-4154-4191-bd74-77bfe1c297ca">
Author
Owner

@yuliyantsvetkov commented on GitHub (Jan 30, 2024):

This is model issue. There is a sub on Reddit and X that the 70b is base model which is not fine tuned yet.

@yuliyantsvetkov commented on GitHub (Jan 30, 2024): This is model issue. There is a sub on Reddit and X that the 70b is base model which is not fine tuned yet.
Author
Owner

@tjbck commented on GitHub (Jan 30, 2024):

curl http://localhost:11434/api/generate -d '{ "model": "codingllama:70b", "prompt": "please generate a four function calculator" }'

You might want to test with the /api/chat route, I believe their behaviours slightly differ from one another.

I'll move this post to discussion for now as there isn't anything webui is doing in particular and it's only interacting with /api/chat route provided by ollama, so most likely the model is the culprit here. Keep us updated, Thanks!

@tjbck commented on GitHub (Jan 30, 2024): > curl http://localhost:11434/api/generate -d '{ "model": "codingllama:70b", "prompt": "please generate a four function calculator" }' You might want to test with the `/api/chat` route, I believe their behaviours slightly differ from one another. I'll move this post to discussion for now as there isn't anything webui is doing in particular and it's only interacting with `/api/chat` route provided by ollama, so most likely the model is the culprit here. Keep us updated, Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#241