josStorer / chatGPTBox

Integrating ChatGPT into your browser deeply, everything you need is here
MIT License
9.9k stars 746 forks source link

Unable to use Groq API as custom model #780

Open umasse opened 1 month ago

umasse commented 1 month ago

Describe the bug 问题描述 Tried to configure Llama 3.1 models on this extension using Groq and API key, following the Groq documentation.

To Reproduce 如何复现 Steps to reproduce the behavior:

  1. Add a custom model following https://console.groq.com/docs/openai
  2. Enter the Groq API url: https://api.groq.com/openai/v1 and your own (free) API key
  3. Try to use chatGPTBox as usual with this model
  4. See error:
    
    Error:

{ "error": { "message": "Unknown request URL: POST /openai/v1. Please check the URL for typos, or see the docs at https://console.groq.com/docs/", "type": "invalid_request_error", "code": "unknown_url" } }



**Expected behavior**
**期望行为**
It should just work.

**Screenshots**
**截图说明**

![image](https://github.com/user-attachments/assets/b70fcaa2-6b17-444a-92b2-474b43a04e12)

![image](https://github.com/user-attachments/assets/cd589c87-1594-4245-ab09-dbdda31b7cab)

**Please complete the following information):**
**请补全以下内容**
 - OS: Linux
 - Browser: Brave
 - Extension Version: v2.5.8

**Additional context**
**其他**
umasse commented 1 month ago

Oh, of course, just found the solution: The correct URL is: https://api.groq.com/openai/v1/chat/completions

norrybul commented 1 day ago

Yes, sometimes users forget about the api reference scripts by providers. Some allow https while others permit http custom base urls, just to add. Most must be aware of this. The "Custom Model" option is such a great feature to use an assortment of custom online and local AI models if not specified by default. A local API server does the trick in most cases - no api key needed. The only CON is the additional resource to run it and a few bugs too, here and there. The server might have completed the request, but chatGPTBox can't, possibly if the model tag was not the exact name coming from the provider. Thus, a "Waiting for response..." might occur...and many other random problems. That's why inputting correct provider models, api keys and endpoints eases up usage in this addon. I love to see a Serp API option to utilize web search in the future.