使用socks或http代理来访问openai的模型断点,生成代理url兼容openai框架

关习习 5c378dd9ed 修正readme 1 ay önce
.gitignore 676f4dc616 修正提交 1 ay önce
Dockerfile 8d385971a4 首次提交代码 1 ay önce
README.md 5c378dd9ed 修正readme 1 ay önce
proxy.py 8d385971a4 首次提交代码 1 ay önce
requirements.txt 8d385971a4 首次提交代码 1 ay önce

README.md

在源码开头修改为你自己的翻墙代理配置

SOCKS_PROXY = 'socks5h://host.docker.internal:20170'
proxies = {
    'http': SOCKS_PROXY,
    'https': SOCKS_PROXY
}

修改为你想代理的openai端点

API_BASE = "https://api.groq.com/openai"

使用方法:

pip install -r requirements.txt

python proxy.py

将日志中输出的url作为openai端点配置使用即可!