[GH-ISSUE #7380] Unable to run inference from web app #4690

Closed
opened 2026-04-12 15:37:00 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @MatthewDlr on GitHub (Oct 26, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7380

What is the issue?

Hi,
I recently tried to host this project to have a better UI to run ollama.
The app successfully gets the tags at /api/tags but however, when I try to send a chat using /api/chats, the request is being rejected, and I don't know why.
CleanShot X 2024-10-26 15 56 14
CleanShot X 2024-10-26 15 56 08

In ollama logs, I can see the tags request put no trace of the chat request
CleanShot 2024-10-26 at 15 59 07

FYI, I tried every configuration of OLLAMA_HOST and OLLAMA_ORIGINS, I restarted the app multiple times, without success.
Is it a bug, or just something I do wrong?

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.3.14

Originally created by @MatthewDlr on GitHub (Oct 26, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7380 ### What is the issue? Hi, I recently tried to host [this project](https://github.com/jakobhoeg/nextjs-ollama-llm-ui?tab=readme-ov-file) to have a better UI to run ollama. The app successfully gets the tags at `/api/tags` but however, when I try to send a chat using `/api/chats`, the request is being rejected, and I don't know why. ![CleanShot X 2024-10-26 15 56 14](https://github.com/user-attachments/assets/591dbd94-939f-4939-8e32-a8c5ac5db9ba) ![CleanShot X 2024-10-26 15 56 08](https://github.com/user-attachments/assets/31c4561f-018a-4af7-bee1-53c79e9d35cd) In ollama logs, I can see the tags request put no trace of the chat request ![CleanShot 2024-10-26 at 15 59 07](https://github.com/user-attachments/assets/475abe6d-8fde-42cb-bbf3-e5ae3c0b310a) FYI, I tried every configuration of `OLLAMA_HOST` and `OLLAMA_ORIGINS`, I restarted the app multiple times, without success. Is it a bug, or just something I do wrong? ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.3.14
GiteaMirror added the bug label 2026-04-12 15:37:00 -05:00
Author
Owner

@rick-github commented on GitHub (Oct 27, 2024):

What do the logs in the project show?

<!-- gh-comment-id:2439795994 --> @rick-github commented on GitHub (Oct 27, 2024): What do the logs in the project show?
Author
Owner

@MatthewDlr commented on GitHub (Oct 27, 2024):

What do the logs in the project show?

POST http://127.0.0.1:11434/api/chat net::ERR_BLOCKED_BY_CLIENT

<!-- gh-comment-id:2440108057 --> @MatthewDlr commented on GitHub (Oct 27, 2024): > What do the logs in the project show? `POST http://127.0.0.1:11434/api/chat net::ERR_BLOCKED_BY_CLIENT`
Author
Owner

@rick-github commented on GitHub (Oct 27, 2024):

Can you connect to ollama from the command line?

curl -D - localhost:11434/api/chat -d '{"model":"mistral:latest","messages":[{"role":"user","content":"why is the sky blue?"}],"stream":false}'
<!-- gh-comment-id:2440110366 --> @rick-github commented on GitHub (Oct 27, 2024): Can you connect to ollama from the command line? ``` curl -D - localhost:11434/api/chat -d '{"model":"mistral:latest","messages":[{"role":"user","content":"why is the sky blue?"}],"stream":false}' ```
Author
Owner

@MatthewDlr commented on GitHub (Oct 27, 2024):

Yes, it works here!

CleanShot 2024-10-27 at 10 34 45

Edit: if I run launchctl getenv OLLAMA_ORIGINS, I get *

<!-- gh-comment-id:2440111423 --> @MatthewDlr commented on GitHub (Oct 27, 2024): Yes, it works here! ![CleanShot 2024-10-27 at 10 34 45](https://github.com/user-attachments/assets/ab7c1507-2efc-4970-a74c-1fdf7586b58e) Edit: if I run `launchctl getenv OLLAMA_ORIGINS`, I get `*`
Author
Owner

@rick-github commented on GitHub (Oct 27, 2024):

Since ollama works, I think the actual network traffic from the app needs to be examined. I think it's similar to https://github.com/ollama/ollama/issues/5816. Are tools like tcpflow or tcpdump available to you? Run this command:

tcpflow -c -i any port 11434

and try connecting to the app.

<!-- gh-comment-id:2440116057 --> @rick-github commented on GitHub (Oct 27, 2024): Since ollama works, I think the actual network traffic from the app needs to be examined. I think it's similar to https://github.com/ollama/ollama/issues/5816. Are tools like `tcpflow` or `tcpdump` available to you? Run this command: ```sh tcpflow -c -i any port 11434 ``` and try connecting to the app.
Author
Owner

@MatthewDlr commented on GitHub (Oct 27, 2024):

This is what I received. When I sent the message, they were no extra lines added, and the following content appeared after the initial page load:

sudo tcpflow -c -i any port 11434
reportfilename: ./report.xml
tcpflow: listening on any
127.000.000.001.65319-127.000.000.001.11434: GET /api/tags HTTP/1.1
Host: localhost:11434
Connection: keep-alive
sec-ch-ua-platform: "macOS"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
sec-ch-ua: "Not?A_Brand";v="99", "Chromium";v="130"
DNT: 1
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://ollama.mdelarue.dev
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9,fr;q=0.8


127.000.000.001.65319-127.000.000.001.11434: GET /api/tags HTTP/1.1
Host: localhost:11434
Connection: keep-alive
sec-ch-ua-platform: "macOS"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
sec-ch-ua: "Not?A_Brand";v="99", "Chromium";v="130"
DNT: 1
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://ollama.mdelarue.dev
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9,fr;q=0.8


127.000.000.001.11434-127.000.000.001.65319: HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Date: Sun, 27 Oct 2024 18:00:33 GMT
Content-Length: 1013

{"models":[{"name":"mistral:latest","model":"mistral:latest","modified_at":"2024-10-26T15:00:39.954026296-07:00","size":4113301824,"digest":"f974a74358d62a017b37c6f424fcdf2744ca02926c4f952513ddf474b2fa5091","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"7.2B","quantization_level":"Q4_0"}},{"name":"llama3.1:latest","model":"llama3.1:latest","modified_at":"2024-07-31T00:29:15.986046114-07:00","size":4661226402,"digest":"62757c860e01d552d4e46b09c6b8d5396ef9015210105427e05a8b27d7727ed2","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"8.0B","quantization_level":"Q4_0"}},{"name":"gemma2:latest","model":"gemma2:latest","modified_at":"2024-07-13T03:05:04.657505087-07:00","size":5443152417,"digest":"ff02c3702f322b9e075e9568332d96c0a7028002f1a5a056e0a6784320a4db0b","details":{"parent_model":"","format":"gguf","family":"gemma2","families":["gemma2"],"parameter_size":"9.2B","quantization_level":"Q4_0"}}]}
127.000.000.001.11434-127.000.000.001.65319: HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Date: Sun, 27 Oct 2024 18:00:33 GMT
Content-Length: 1013

{"models":[{"name":"mistral:latest","model":"mistral:latest","modified_at":"2024-10-26T15:00:39.954026296-07:00","size":4113301824,"digest":"f974a74358d62a017b37c6f424fcdf2744ca02926c4f952513ddf474b2fa5091","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"7.2B","quantization_level":"Q4_0"}},{"name":"llama3.1:latest","model":"llama3.1:latest","modified_at":"2024-07-31T00:29:15.986046114-07:00","size":4661226402,"digest":"62757c860e01d552d4e46b09c6b8d5396ef9015210105427e05a8b27d7727ed2","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"8.0B","quantization_level":"Q4_0"}},{"name":"gemma2:latest","model":"gemma2:latest","modified_at":"2024-07-13T03:05:04.657505087-07:00","size":5443152417,"digest":"ff02c3702f322b9e075e9568332d96c0a7028002f1a5a056e0a6784320a4db0b","details":{"parent_model":"","format":"gguf","family":"gemma2","families":["gemma2"],"parameter_size":"9.2B","quantization_level":"Q4_0"}}]}
<!-- gh-comment-id:2440120417 --> @MatthewDlr commented on GitHub (Oct 27, 2024): This is what I received. When I sent the message, they were no extra lines added, and the following content appeared after the initial page load: ``` sudo tcpflow -c -i any port 11434 reportfilename: ./report.xml tcpflow: listening on any 127.000.000.001.65319-127.000.000.001.11434: GET /api/tags HTTP/1.1 Host: localhost:11434 Connection: keep-alive sec-ch-ua-platform: "macOS" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 sec-ch-ua: "Not?A_Brand";v="99", "Chromium";v="130" DNT: 1 sec-ch-ua-mobile: ?0 Accept: */* Origin: https://ollama.mdelarue.dev Sec-Fetch-Site: cross-site Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Accept-Encoding: gzip, deflate, br, zstd Accept-Language: en-US,en;q=0.9,fr;q=0.8 127.000.000.001.65319-127.000.000.001.11434: GET /api/tags HTTP/1.1 Host: localhost:11434 Connection: keep-alive sec-ch-ua-platform: "macOS" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 sec-ch-ua: "Not?A_Brand";v="99", "Chromium";v="130" DNT: 1 sec-ch-ua-mobile: ?0 Accept: */* Origin: https://ollama.mdelarue.dev Sec-Fetch-Site: cross-site Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Accept-Encoding: gzip, deflate, br, zstd Accept-Language: en-US,en;q=0.9,fr;q=0.8 127.000.000.001.11434-127.000.000.001.65319: HTTP/1.1 200 OK Access-Control-Allow-Origin: * Content-Type: application/json; charset=utf-8 Date: Sun, 27 Oct 2024 18:00:33 GMT Content-Length: 1013 {"models":[{"name":"mistral:latest","model":"mistral:latest","modified_at":"2024-10-26T15:00:39.954026296-07:00","size":4113301824,"digest":"f974a74358d62a017b37c6f424fcdf2744ca02926c4f952513ddf474b2fa5091","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"7.2B","quantization_level":"Q4_0"}},{"name":"llama3.1:latest","model":"llama3.1:latest","modified_at":"2024-07-31T00:29:15.986046114-07:00","size":4661226402,"digest":"62757c860e01d552d4e46b09c6b8d5396ef9015210105427e05a8b27d7727ed2","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"8.0B","quantization_level":"Q4_0"}},{"name":"gemma2:latest","model":"gemma2:latest","modified_at":"2024-07-13T03:05:04.657505087-07:00","size":5443152417,"digest":"ff02c3702f322b9e075e9568332d96c0a7028002f1a5a056e0a6784320a4db0b","details":{"parent_model":"","format":"gguf","family":"gemma2","families":["gemma2"],"parameter_size":"9.2B","quantization_level":"Q4_0"}}]} 127.000.000.001.11434-127.000.000.001.65319: HTTP/1.1 200 OK Access-Control-Allow-Origin: * Content-Type: application/json; charset=utf-8 Date: Sun, 27 Oct 2024 18:00:33 GMT Content-Length: 1013 {"models":[{"name":"mistral:latest","model":"mistral:latest","modified_at":"2024-10-26T15:00:39.954026296-07:00","size":4113301824,"digest":"f974a74358d62a017b37c6f424fcdf2744ca02926c4f952513ddf474b2fa5091","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"7.2B","quantization_level":"Q4_0"}},{"name":"llama3.1:latest","model":"llama3.1:latest","modified_at":"2024-07-31T00:29:15.986046114-07:00","size":4661226402,"digest":"62757c860e01d552d4e46b09c6b8d5396ef9015210105427e05a8b27d7727ed2","details":{"parent_model":"","format":"gguf","family":"llama","families":["llama"],"parameter_size":"8.0B","quantization_level":"Q4_0"}},{"name":"gemma2:latest","model":"gemma2:latest","modified_at":"2024-07-13T03:05:04.657505087-07:00","size":5443152417,"digest":"ff02c3702f322b9e075e9568332d96c0a7028002f1a5a056e0a6784320a4db0b","details":{"parent_model":"","format":"gguf","family":"gemma2","families":["gemma2"],"parameter_size":"9.2B","quantization_level":"Q4_0"}}]} ```
Author
Owner

@rick-github commented on GitHub (Oct 27, 2024):

There's no attempt to call /api/chat in the tcpflow log. Did you try a chat?

<!-- gh-comment-id:2440135200 --> @rick-github commented on GitHub (Oct 27, 2024): There's no attempt to call `/api/chat` in the `tcpflow` log. Did you try a chat?
Author
Owner

@MatthewDlr commented on GitHub (Oct 27, 2024):

Yes I did. I'm getting the same console error.

What do the logs in the project show?

POST http://127.0.0.1:11434/api/chat net::ERR_BLOCKED_BY_CLIENT

<!-- gh-comment-id:2440172338 --> @MatthewDlr commented on GitHub (Oct 27, 2024): Yes I did. I'm getting the same console error. > > What do the logs in the project show? > > `POST http://127.0.0.1:11434/api/chat net::ERR_BLOCKED_BY_CLIENT`
Author
Owner

@rick-github commented on GitHub (Oct 27, 2024):

The app is not trying to connect to ollama. The typical explanation for this is adblockers or virus filters.

<!-- gh-comment-id:2440216732 --> @rick-github commented on GitHub (Oct 27, 2024): The app is not trying to connect to ollama. The [typical explanation](https://www.keycdn.com/support/how-to-solve-err-blocked-by-client) for this is adblockers or virus filters.
Author
Owner

@MatthewDlr commented on GitHub (Oct 28, 2024):

I just disabled my ad blocker and... it worked.

Thanks so much, and sorry for the mess

<!-- gh-comment-id:2440266619 --> @MatthewDlr commented on GitHub (Oct 28, 2024): I just disabled my ad blocker and... it worked. Thanks so much, and sorry for the mess
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#4690