songquanpeng / one-api

OpenAI 接口管理 & 分发系统,支持 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用. OpenAI key management & redistribution system, using a single API for all LLMs, and features an English UI.
https://openai.justsong.cn/
MIT License
18.25k stars 4.12k forks source link

增加支持 Groq 模型 #1087

Closed jtsang4 closed 6 months ago

jtsang4 commented 7 months ago

例行检查

功能描述 支持 https://groq.com/ 的模型

应用场景 目前 Groq 的模型免费且性能非常好

JamesFlare1212 commented 7 months ago

groq的API兼容openai格式,渠道API地址写 https://api.groq.com/openai 即可

jtsang4 commented 7 months ago

groq的API兼容openai格式,渠道API地址写 https://api.groq.com/openai 即可

👍 确实可以用,估记我昨天测试的时候填错了

KrabsWong commented 7 months ago

groq的API兼容openai格式,渠道API地址写 https://api.groq.com/openai 即可

请问是选择自定义渠道然后设置 baseUrl 为 https://api.grpq.com/openai 吗? 我试了下这个方案,测试接口提示

错误:status code 404: The model gpt-3.5-turbo does not exist or you do not have access to it.

也尝试了直接选择 openai 的渠道类型,然后代理地址设置为 https://api.groq.com/openai 也是报一样错误。 是不是那里设置不太对呀?

jtsang4 commented 7 months ago

groq的API兼容openai格式,渠道API地址写 https://api.groq.com/openai 即可

请问是选择自定义渠道然后设置 baseUrl 为 https://api.grpq.com/openai 吗? 我试了下这个方案,测试接口提示

错误:status code 404: The model gpt-3.5-turbo does not exist or you do not have access to it.

也尝试了直接选择 openai 的渠道类型,然后代理地址设置为 https://api.groq.com/openai 也是报一样错误。 是不是那里设置不太对呀?

你需要配置模型为 mixtral-8x7b-32768llama2-70b-4096

KrabsWong commented 7 months ago

groq的API兼容openai格式,渠道API地址写 https://api.groq.com/openai 即可

请问是选择自定义渠道然后设置 baseUrl 为 https://api.grpq.com/openai 吗? 我试了下这个方案,测试接口提示

错误:status code 404: The model gpt-3.5-turbo does not exist or you do not have access to it.

也尝试了直接选择 openai 的渠道类型,然后代理地址设置为 https://api.groq.com/openai 也是报一样错误。 是不是那里设置不太对呀?

你需要配置模型为 mixtral-8x7b-32768llama2-70b-4096

对的,配置了这个模型。下面截图是尝试的两种方式的配置。

image image
jiz4oh commented 7 months ago
image

@KrabsWong 像这样即可,在使用的时候在对应的客户端填入 custom model name mixtral-8x7b-32768

KrabsWong commented 7 months ago
image

@KrabsWong 像这样即可,在使用的时候在对应的客户端填入 custom model name mixtral-8x7b-32768

明白了,感谢

yonmnm commented 7 months ago
image

@KrabsWong 像这样即可,在使用的时候在对应的客户端填入 custom model name mixtral-8x7b-32768 @jiz4oh 使用第三方客户端,出现这样的错误:(直接填写Groq的key到客户端就能正常使用) "error": { "message": "tools is not supported with this model (request id: 2024030808155972780750603165139)", "type": "invalid_request_error", "param": "", "code": null

ImYrS commented 7 months ago

@jiz4oh 使用第三方客户端,出现这样的错误:(直接填写Groq的key到客户端就能正常使用) "error": { "message": "tools is not supported with this model (request id: 2024030808155972780750603165139)", "type": "invalid_request_error", "param": "", "code": null

Groq 使用的 mixtral 和 llama2 不支持插件调用