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