brianpetro / obsidian-smart-connections

Chat with your notes & see links to related content with AI embeddings. Use local models or 100+ via APIs like Claude, Gemini, ChatGPT & Llama 3
https://smartconnections.app
GNU General Public License v3.0
2.58k stars 175 forks source link

Support for Groq #580

Closed avcode-exe closed 1 month ago

avcode-exe commented 5 months ago

Any plans on integrating Groq? It is very fast and can save a lot of time when comparing with other options. Groq link: https://console.groq.com/docs/quickstart

brianpetro commented 5 months ago

@avcode-exe I have wanted to, it's very impressive.

It's just a hard balance between this sort of marginal improvement and shipping new features that I think could be 10X improvements.

That's why I made contributing adapters for these additional services as easy as possible, see https://github.com/brianpetro/jsbrains/issues/1#issuecomment-2071271220 for some details.

I'd like to say I'll get to it myself eventually, but it would of course be much faster if someone could contribute the adapter.

Thanks for participating in the Smart Connections community 😊🌴

seanrose commented 5 months ago

It looks like Groq has an OpenAI endpoint: https://console.groq.com/docs/openai

However, when I try it with the Custom API (OpenAl format) option, Smart Connections throws an invalid API key error. Am I doing something wrong, or is this expected?

2024-05-04 at 10 50 39@2x

brianpetro commented 5 months ago

@seanrose it's probably that the API key is handled different, even if the rest of the API format is the same.

It might be possible to already override this via the platforms.json config, but I'll have to check it out.

OnfrICiA commented 5 months ago

@seanrose I've just tested & got it to work - I believe the "path" needs to be: /openai/v1/chat/completions

e.g.

image
linmaobang commented 4 months ago

@seanrose I've just tested & got it to work - I believe the "path" needs to be:我刚刚测试并让它工作 - 我相信“路径”需要: /openai/v1/chat/completions

e.g. 例如: image

It doesn't work either.

OnfrICiA commented 4 months ago

Definitely working for me @linmaobang . Version: 2.1.63

Confirming settings: Model Platform = Custom API (OpenAl format) Model Name = llama3-70b-8192 Protocol = https Hostname = api.groq.com Path = /openai/v1/chat/completions Streaming = OFF Max input tokens = 8192 API Key = [starts with gsk...]

Here's my console: image

What does your console say?

linmaobang commented 4 months ago

Definitely working for me @linmaobang .绝对为我工作. Version: 2.1.63 版本: 2.1.63

Confirming settings: 确认设置: Model Platform = Custom API (OpenAl format)模型平台 = 自定义 API(OpenAl 格式) Model Name = llama3-70b-8192型号名称 = llama3-70b-8192 Protocol = https 协议 = https Hostname = api.groq.com 主机名 = api.groq.com Path = /openai/v1/chat/completions路径 = /openai/v1/chat/completions Streaming = OFF 流 = 关闭 Max input tokens = 8192最大输入令牌数 = 8192 API Key = [starts with gsk...]API 密钥 = [以 gsk 开头...]

Here's my console: 这是我的控制台: image

What does your console say?你的控制台怎么说?

This is so cool!Successful, after restarting Obsidian.thanks a lot!

xixia123 commented 2 months ago

@seanrose I've just tested & got it to work - I believe the "path" needs to be: /openai/v1/chat/completions

e.g. image

It works for me!

mayeenulislam commented 1 month ago

The issue can be closed. The solution provided by OnfrICiA is working just fine.

christianngarcia commented 1 month ago

Thanks for following up. 😊