Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

How to set up a network proxy in a configuration file #18

Open
anuxs opened this issue Feb 8, 2024 · 20 comments
Open

How to set up a network proxy in a configuration file #18

anuxs opened this issue Feb 8, 2024 · 20 comments

Comments

@anuxs
Copy link

anuxs commented Feb 8, 2024

I'm behind a vpn and I can't download any LLama model via LM and the network times out.
But if I paste the downloaded URL into the browser, it can be downloaded.
The LM is apparently requesting the network directly, without using the system network proxy setup
I use windows 11.

@yagil
Copy link
Member

yagil commented Feb 8, 2024

@anuxs we are actively investigating this. It would be really helpful to be able to send you a beta build to test a few options to fix this issue.

If you're open to it, would you mind emailing team@lmstudio.ai? Thank you in advance!

@Idzana
Copy link

Idzana commented Feb 12, 2024

Hello! I had a similar problem with a computer behind a proxy server. Is any idea how resolve this problem?

@hhmmjjnn
Copy link

I tried to set the HTTPS_PROXY environment variable, but it doesn't seem to comply with that.

image

@lzjever
Copy link

lzjever commented Feb 15, 2024

Same here. Launching lmstudio with those proxy configurations:
❯ env | grep PROXY
HTTP_PROXY=http://127.0.0.1:8889
HTTPS_PROXY=http://127.0.0.1:8889
FTP_PROXY=http://127.0.0.1:8889
RSYNC_PROXY=http://127.0.0.1:8889
ALL_PROXY=socks5://127.0.0.1:1089

reports:
12:49:47.536 › Failed to search models: 'Error: Network error'
There was a network error: fetch failed

@tears743
Copy link

tears743 commented Feb 22, 2024

Mac下可以直接修改model-catalog.json的downloadUrl 为镜像地址可以正常下载,具体文件位置Mac下在 ~/Library/Application Support/LM Studio/,windows上可能在C:\Users<you>\AppData\Local<Your App Name>,windows 我没有验证,大家自行摸索一下;需要注意的是,应用关闭后重新打开是会重新下载这个文件,修改会被覆盖,需要重新替换...

@kaiwater
Copy link

kaiwater commented Mar 2, 2024

proxychains -lv "%USERPROFILE%\AppData\Local\LM-Studio\LM Studio.exe"

it's work for me , windows11

@iguoli
Copy link

iguoli commented Mar 4, 2024

proxychains -lv "%USERPROFILE%\AppData\Local\LM-Studio\LM Studio.exe"

it's work for me , windows11

it reports below error message on my laptop (windwos 10)

[PID18992] [W] 2024/03/04 11:14:18 GetThreadContext() Failed: The parameter is incorrect.(87)
[PID18992] [E] 2024/03/04 11:14:18 Injecting WINPID 20612 Error: The parameter is incorrect.(87)
[I] 2024/03/04 11:14:23 All Windows descendant process exited.
[I] 2024/03/04 11:14:23 Master exiting

@kaiwater
Copy link

kaiwater commented Mar 5, 2024

proxychains -lv "%USERPROFILE%\AppData\Local\LM-Studio\LM Studio.exe"
it's work for me , windows11

it reports below error message on my laptop (windwos 10)

[PID18992] [W] 2024/03/04 11:14:18 GetThreadContext() Failed: The parameter is incorrect.(87)
[PID18992] [E] 2024/03/04 11:14:18 Injecting WINPID 20612 Error: The parameter is incorrect.(87)
[I] 2024/03/04 11:14:23 All Windows descendant process exited.
[I] 2024/03/04 11:14:23 Master exiting

sorry my bad,

proxychains -lv "%USERPROFILE%\AppData\Local\LM-Studio\app-0.2.16\LM Studio.exe"

should care about folder name everytime when update.

@LosUnidades
Copy link

Mac下可以直接修改model-catalog.json的downloadUrl 为镜像地址可以正常下载,具体文件位置Mac下在 ~/Library/Application Support/LM Studio/,windows上可能在C:\Users\AppData\Local,windows 我没有验证,大家自行摸索一下;需要注意的是,应用关闭后重新打开是会重新下载这个文件,修改会被覆盖,需要重新替换...

model-catalog.json在什么位置呀,LM Studio下没找到对应文件呢,我Mac

@ibaoger
Copy link

ibaoger commented Apr 21, 2024

proxychains -lv "%USERPROFILE%\AppData\Local\LM-Studio\LM Studio.exe"
it's work for me , windows11

it reports below error message on my laptop (windwos 10)

[PID18992] [W] 2024/03/04 11:14:18 GetThreadContext() Failed: The parameter is incorrect.(87)
[PID18992] [E] 2024/03/04 11:14:18 Injecting WINPID 20612 Error: The parameter is incorrect.(87)
[I] 2024/03/04 11:14:23 All Windows descendant process exited.
[I] 2024/03/04 11:14:23 Master exiting

sorry my bad,

proxychains -lv "%USERPROFILE%\AppData\Local\LM-Studio\app-0.2.16\LM Studio.exe"

should care about folder name everytime when update.

感谢,在 Win10 系统下测试成功

这里手动指定了配置文件的路径,LM Studio 版本为 0.2.20
proxychains -f "%USERPROFILE%\proxychains-windows\proxychains.conf" -lv "%USERPROFILE%\AppData\Local\LM-Studio\app-0.2.20\LM Studio.exe"

@zhutoutoutousan
Copy link

proxychains -lv "%USERPROFILE%\AppData\Local\LM-Studio\LM Studio.exe"
it's work for me , windows11

it reports below error message on my laptop (windwos 10)

[PID18992] [W] 2024/03/04 11:14:18 GetThreadContext() Failed: The parameter is incorrect.(87)
[PID18992] [E] 2024/03/04 11:14:18 Injecting WINPID 20612 Error: The parameter is incorrect.(87)
[I] 2024/03/04 11:14:23 All Windows descendant process exited.
[I] 2024/03/04 11:14:23 Master exiting

sorry my bad,
proxychains -lv "%USERPROFILE%\AppData\Local\LM-Studio\app-0.2.16\LM Studio.exe"
should care about folder name everytime when update.

感谢,在 Win10 系统下测试成功

这里手动指定了配置文件的路径,LM Studio 版本为 0.2.20 proxychains -f "%USERPROFILE%\proxychains-windows\proxychains.conf" -lv "%USERPROFILE%\AppData\Local\LM-Studio\app-0.2.20\LM Studio.exe"

Also works for Win 11 23H2

@gayshub
Copy link

gayshub commented Apr 24, 2024

Mac下可以直接修改model-catalog.json的downloadUrl 为镜像地址可以正常下载,具体文件位置Mac下在 ~/Library/Application Support/LM Studio/,windows上可能在C:\Users\AppData\Local,windows 我没有验证,大家自行摸索一下;需要注意的是,应用关闭后重新打开是会重新下载这个文件,修改会被覆盖,需要重新替换...

It works with macos, replace huggingface.co to hf-mirror.com with vim in model-catalog.json of ~/Library/Application\ Support/LM\ Studio, then clear your tasks and restart LM studio

@steezer
Copy link

steezer commented May 31, 2024

目前最新版本(版本0.2.24)这样修改已经没用了,模型下载地址 "https://huggingface.co/" 已经写入到了程序里面。不过程序是用electron+webpack开发,安装后的程序文件在 "/Applications/LM\ Studio.app/Contents/Resources/app/.webpack" 路径下,可以在此文件夹搜索 "https://huggingface.co" ,然后批量替换为 "https://hf-mirror.com"

@jfhyang
Copy link

jfhyang commented May 31, 2024

目前最新版本(版本0.2.24)这样修改已经没用了,模型下载地址 "https://huggingface.co/" 已经写入到了程序里面。不过程序是用electron+webpack开发,安装后的程序文件在 "/Applications/LM\ Studio.app/Contents/Resources/app/.webpack" 路径下,可以在此文件夹搜索 "https://huggingface.co" ,然后批量替换为 "https://hf-mirror.com"

运行前需要清理一下~/Library/Application Support/LM Studio里旧数据文件

@yf94453
Copy link

yf94453 commented Jun 2, 2024

win下修改后清理%APPDATA%\LM Studio可以

@EricXZPan
Copy link

STILL got network issue in Win11. I downloaded proxychains for win, update the conf file for my local socks5 proxy. After run the command, I can see the app log and got network issue for searching the models. Is that mean 0.2.25 version can't consume the Win11 system proxy for all its network connections?

Any other approach can solve the network issue to huggingface.co?

@Hu-Wentao
Copy link

目前最新版本(版本0.2.24)这样修改已经没用了,模型下载地址 "https://huggingface.co/" 已经写入到了程序里面。不过程序是用electron+webpack开发,安装后的程序文件在 "/Applications/LM\ Studio.app/Contents/Resources/app/.webpack" 路径下,可以在此文件夹搜索 "https://huggingface.co" ,然后批量替换为 "https://hf-mirror.com"

windows see:

https://juejin.cn/post/7373961220585603124

work for me

@feuyeux
Copy link

feuyeux commented Aug 17, 2024

Thanks guys, and I try to do the workaround on Win11, it works.

1 open the webpack directory in vscode

export VERSION=0.2.31
code "$HOME/AppData/Local/LM-Studio/app-$VERSION/resources/app/.webpack"

2 replace all using vscode

2024-08-17_144728

3 clean the cache directory

%APPDATA%\LM Studio

@laienliang
Copy link

目前最新版本(版本0.2.24)这样修改已经没用了,模型下载地址 "https://huggingface.co/" 已经写入到了程序里面。不过程序是用electron+webpack开发,安装后的程序文件在 "/Applications/LM\ Studio.app/Contents/Resources/app/.webpack" 路径下,可以在此文件夹搜索 "https://huggingface.co" ,然后批量替换为 "https://hf-mirror.com"

运行前需要清理一下~/Library/Application Support/LM Studio里旧数据文件

按这个可以下载,但搜索还是搜索不出来,环境mac

@sweetcard
Copy link

目前最新版本(版本0.2.24)这样修改已经没用了,模型下载地址 "https://huggingface.co/" 已经写入到了程序里面。不过程序是用electron+webpack开发,安装后的程序文件在 "/Applications/LM\ Studio.app/Contents/Resources/app/.webpack" 路径下,可以在此文件夹搜索 "https://huggingface.co" ,然后批量替换为 "https://hf-mirror.com"

运行前需要清理一下~/Library/Application Support/LM Studio里旧数据文件

按这个可以下载,但搜索还是搜索不出来,环境mac

0.2.x版本好像可以。有可能用的搜索api在镜像里面可能不可用

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests