LM Studio link #311

Closed
opened 2025-11-11 14:16:26 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @fred-gb on GitHub (Feb 17, 2024).

Bonjour, 👋🏻

Description

Bug Summary:
It's not a bug, it's misunderstood about configuration.
I don't understand how to make work open-webui with open API BASE URL. As said in README.md

Steps to Reproduce:
Run HTTP server from LM-Studio
And in terminal:

docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://IP_OF_MACBOOK_M1:1234/v1-v ollama-webui:/app/backend/data --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main

I can try many URL, nothing works.

In LM Studio HTTP Server console:

[2024-02-17 17:09:15.095] [INFO] [LM STUDIO SERVER] ->	GET  http://localhost:1234/v1/models
[2024-02-17 17:09:15.095] [INFO] [LM STUDIO SERVER] ->	POST http://localhost:1234/v1/chat/completions
[2024-02-17 17:09:15.095] [INFO] [LM STUDIO SERVER] ->	POST http://localhost:1234/v1/completions

Expected Behavior:
Use LM Studio as API BASE. Because LM Studio can use accelerated GPU on my MacBook M1. If you have solution with ollama, I want to know!

Actual Behavior:
When I go on my localhost page, I cannot find models or have standard error: Ollama Version: Not Detected

Environment

  • Operating System: macOS Sonoma, Macbook M1 16 Go
  • Browser (if applicable): Firefox 122.0.1 (64 bits) ❤️

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:

LM Studio

[2024-02-17 17:13:23.968] [ERROR] Unexpected endpoint or method. (GET /v1/tags). Returning 200 anyway
[2024-02-17 17:13:23.971] [ERROR] Unexpected endpoint or method. (GET /v1/version). Returning 200 anyway
[2024-02-17 17:13:28.792] [ERROR] Unexpected endpoint or method. (GET /v1/tags). Returning 200 anyway
[2024-02-17 17:13:28.795] [ERROR] Unexpected endpoint or method. (GET /v1/version). Returning 200 anyway

Docker Container Logs:

INFO:     192.168.65.1:46904 - "GET /openai/api/models HTTP/1.1" 401 Unauthorized
INFO:     192.168.65.1:46904 - "GET /api/v1/chats/ HTTP/1.1" 200 OK

Installation Method

Docker

Thanks!

Originally created by @fred-gb on GitHub (Feb 17, 2024). Bonjour, 👋🏻 ## Description **Bug Summary:** It's not a bug, it's misunderstood about configuration. I don't understand how to make work open-webui with open API BASE URL. As said in README.md **Steps to Reproduce:** Run HTTP server from LM-Studio And in terminal: ``` docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://IP_OF_MACBOOK_M1:1234/v1-v ollama-webui:/app/backend/data --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main ``` I can try many URL, nothing works. In LM Studio HTTP Server console: ``` [2024-02-17 17:09:15.095] [INFO] [LM STUDIO SERVER] -> GET http://localhost:1234/v1/models [2024-02-17 17:09:15.095] [INFO] [LM STUDIO SERVER] -> POST http://localhost:1234/v1/chat/completions [2024-02-17 17:09:15.095] [INFO] [LM STUDIO SERVER] -> POST http://localhost:1234/v1/completions ``` **Expected Behavior:** Use LM Studio as API BASE. Because LM Studio can use accelerated GPU on my MacBook M1. If you have solution with ollama, I want to know! **Actual Behavior:** When I go on my localhost page, I cannot find models or have standard error: `Ollama Version: Not Detected` ## Environment - **Operating System:** macOS Sonoma, Macbook M1 16 Go - **Browser (if applicable):** Firefox 122.0.1 (64 bits) ❤️ ## 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. - [] I have included the browser console logs. - [X] I have included the Docker container logs. ## Logs and Screenshots **Browser Console Logs:** LM Studio ``` [2024-02-17 17:13:23.968] [ERROR] Unexpected endpoint or method. (GET /v1/tags). Returning 200 anyway [2024-02-17 17:13:23.971] [ERROR] Unexpected endpoint or method. (GET /v1/version). Returning 200 anyway [2024-02-17 17:13:28.792] [ERROR] Unexpected endpoint or method. (GET /v1/tags). Returning 200 anyway [2024-02-17 17:13:28.795] [ERROR] Unexpected endpoint or method. (GET /v1/version). Returning 200 anyway ``` **Docker Container Logs:** ``` INFO: 192.168.65.1:46904 - "GET /openai/api/models HTTP/1.1" 401 Unauthorized INFO: 192.168.65.1:46904 - "GET /api/v1/chats/ HTTP/1.1" 200 OK ``` ## Installation Method Docker Thanks!
Author
Owner

@justinh-rahb commented on GitHub (Feb 17, 2024):

If the LM Studio is running on a different system, that'll be why it isn't working. It only listens on 127.0.0.1 (localhost).

@justinh-rahb commented on GitHub (Feb 17, 2024): If the LM Studio is running on a different system, that'll be why it isn't working. It only listens on 127.0.0.1 (localhost).
Author
Owner

@fred-gb commented on GitHub (Feb 17, 2024):

Thanks,

LM Studio on same system.

127.0.0.1 or localhost does not work for docker isolation. It's why I put my lan IP.

@fred-gb commented on GitHub (Feb 17, 2024): Thanks, LM Studio on same system. 127.0.0.1 or localhost does not work for docker isolation. It's why I put my lan IP.
Author
Owner

@justinh-rahb commented on GitHub (Feb 17, 2024):

On mobile, didn't see your full issue report, there's a couple problems:

You're trying to use an OpenAI compatible API where an Ollama API is expected. This won't work. Not sure why you're involving LM Studio at all, Ollama can do GPU acceleration as well.

@justinh-rahb commented on GitHub (Feb 17, 2024): On mobile, didn't see your full issue report, there's a couple problems: You're trying to use an OpenAI compatible API where an Ollama API is expected. This won't work. Not sure why you're involving LM Studio at all, Ollama can do GPU acceleration as well.
Author
Owner

@fred-gb commented on GitHub (Feb 17, 2024):

Thanks @justinh-rahb

For GPU acceleration, I read this: https://github.com/ollama/ollama/issues/1986

I found on LM Studio:
Capture d’écran 2024-02-17 à 18 52 50

It's Metal! It's impressive on my simple MacBook M1 16Go!
Capture d’écran 2024-02-17 à 18 55 04

Capture d’écran 2024-02-17 à 18 56 32

I hope Ollama and open-webui can integrate Metal !

Thanks

@fred-gb commented on GitHub (Feb 17, 2024): Thanks @justinh-rahb For GPU acceleration, I read this: https://github.com/ollama/ollama/issues/1986 I found on LM Studio: <img width="932" alt="Capture d’écran 2024-02-17 à 18 52 50" src="https://github.com/open-webui/open-webui/assets/17061623/8fa25c05-e15c-4e45-b3ce-17ccdc3734b3"> It's `Metal`! It's impressive on my simple MacBook M1 16Go! <img width="761" alt="Capture d’écran 2024-02-17 à 18 55 04" src="https://github.com/open-webui/open-webui/assets/17061623/ab69e7e1-f81e-46e0-bb23-abe82b4dbe15"> <img width="761" alt="Capture d’écran 2024-02-17 à 18 56 32" src="https://github.com/open-webui/open-webui/assets/17061623/918b89b8-09fe-4c2c-9c40-d5179f29273c"> I hope Ollama and open-webui can integrate `Metal` ! Thanks
Author
Owner

@justinh-rahb commented on GitHub (Feb 17, 2024):

Yes but, Ollama does integrate metal already, I get identical performance on my own 2020 M1 MacBook Pro (touchbar) and even better on my 2021 M1 Pro 14" MacBook Pro.

2020 M1 MBP 16GB:
Screenshot 2024-02-17 at 1 33 54 PM

2021 M1 Pro MBP 16GB:
Screenshot 2024-02-17 at 1 38 59 PM

and for funsies, 2023 M2 Max Mac Studio 96GB:
Screenshot 2024-02-17 at 1 33 16 PM

These performance numbers would not be possible without Metal GPU support in Ollama. You can ditch LM Studio if you're running WebUI, just follow the README.md instructions for setting up. You'll want to install Ollama with the macOS app from their website, and setup WebUI with a docker run command with your OLLAMA_API_BASE_URL=http://host.docker.internal:11434/api environment variable set.

@justinh-rahb commented on GitHub (Feb 17, 2024): Yes but, _Ollama does integrate metal already_, I get identical performance on my own 2020 M1 MacBook Pro (touchbar) and even better on my 2021 M1 Pro 14" MacBook Pro. **2020 M1 MBP 16GB:** <img width="756" alt="Screenshot 2024-02-17 at 1 33 54 PM" src="https://github.com/open-webui/open-webui/assets/52832301/fee1c09d-b0a7-4ecc-9783-5212306d939a"> **2021 M1 Pro MBP 16GB:** ![Screenshot 2024-02-17 at 1 38 59 PM](https://github.com/open-webui/open-webui/assets/52832301/f43ae240-1803-4da7-92a9-7b8128768f6a) **and for funsies, 2023 M2 Max Mac Studio 96GB:** <img width="756" alt="Screenshot 2024-02-17 at 1 33 16 PM" src="https://github.com/open-webui/open-webui/assets/52832301/25dc05b2-c579-45bb-8a3c-134327e4db5b"> These performance numbers would not be possible without Metal GPU support in Ollama. You can ditch LM Studio if you're running WebUI, just follow the [README.md](https://github.com/open-webui/open-webui?tab=readme-ov-file#steps-to-install-open-webui) instructions for setting up. You'll want to install Ollama with the macOS app from their website, and setup WebUI with a `docker run` command with your `OLLAMA_API_BASE_URL=http://host.docker.internal:11434/api` environment variable set.
Author
Owner

@tjbck commented on GitHub (Feb 17, 2024):

Our webui still has Ollama dependency at the moment so your installation command should've been

docker run -d -p 3000:8080 -e OPENAI_API_BASE_URL=http://IP_OF_MACBOOK_M1:1234/v1-v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

Let us know if this resolves your issue!

@tjbck commented on GitHub (Feb 17, 2024): Our webui still has Ollama dependency at the moment so your installation command should've been ``` docker run -d -p 3000:8080 -e OPENAI_API_BASE_URL=http://IP_OF_MACBOOK_M1:1234/v1-v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main ``` Let us know if this resolves your issue!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#311