使用socks或http代理来访问openai的模型断点,生成代理url兼容openai框架
|
hace 1 mes | |
---|---|---|
.idea | hace 1 mes | |
.gitignore | hace 1 mes | |
Dockerfile | hace 1 mes | |
README.md | hace 1 mes | |
proxy.py | hace 1 mes | |
requirements.txt | hace 1 mes |
在源码开头修改为你自己的翻墙代理配置
SOCKS_PROXY = 'socks5h://host.docker.internal:20170'
proxies = {
'http': SOCKS_PROXY,
'https': SOCKS_PROXY
}
修改为你想代理的openai端点
API_BASE = "https://api.groq.com/openai"
使用方法:
pip install requirements.txt
python proxy.py
将日志中输出的url作为openai端点配置使用即可!