cursor icon indicating copy to clipboard operation
cursor copied to clipboard

Add groq API

Open iamnvt opened this issue 1 year ago • 16 comments

this is the game changer for the speed with llama 3.

iamnvt avatar Apr 21 '24 11:04 iamnvt

+1 for this ^

spikecodes avatar Apr 23 '24 01:04 spikecodes

it can be as simple as let cursor respect 'OPENAI_API_BASE_URL' env

yangcheng avatar Apr 23 '24 09:04 yangcheng

But it will make you lose the access to openai, and also dont have codebase coding.


From: Cheng Yang @.> Sent: Tuesday, April 23, 2024 4:13:46 PM To: getcursor/cursor @.> Cc: Tommy Nguyen @.>; Author @.> Subject: Re: [getcursor/cursor] Add groq API (Issue #1407)

it can be as simple as let cursor respect 'OPENAI_API_BASE_URL' env

— Reply to this email directly, view it on GitHubhttps://github.com/getcursor/cursor/issues/1407#issuecomment-2071810032, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADJZKO6LR74G637JETJZGPLY6YQ4VAVCNFSM6AAAAABGRJZJFOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZRHAYTAMBTGI. You are receiving this because you authored the thread.Message ID: @.***>

iamnvt avatar Apr 23 '24 10:04 iamnvt

This would be awesome - has anyone figured out a workaround for now it would be a gamechanger prob 10x my dev speed

CalamariDude avatar Apr 23 '24 19:04 CalamariDude

This would be awesome - has anyone figured out a workaround for now it would be a gamechanger prob 10x my dev speed

yes! just override openai base url to groq https://api.groq.com/openai/v1

Screenshot 2024-04-24 at 11 30 34 AM

yangcheng avatar Apr 24 '24 02:04 yangcheng

@yangcheng Thank you! For some reason the speed seems around the same as current gpt4 in cursor, is this your experience?

CalamariDude avatar Apr 24 '24 03:04 CalamariDude

for me the chat is noticeably faster. commnad+K is about same, maybe the bottleneck is somewhere else. maybe you can try 8b models to be sure?

yangcheng avatar Apr 25 '24 13:04 yangcheng

for me the chat is noticeably faster. commnad+K is about same, maybe the bottleneck is somewhere else. maybe you can try 8b models to be sure?

its about the same for small models on groq : /

CalamariDude avatar Apr 25 '24 13:04 CalamariDude

Today I made llm-router, enabling the use of ⌘ K or ⌘ L, followed by ⌘ /, to toggle between openai and groq. If there's interest, I can open source it and cut a release.

kcolemangt avatar Apr 29 '24 04:04 kcolemangt

@yangcheng Thanks! But how do we pass our API key? https://console.groq.com/docs/api-keys says:

API keys are required for accessing the APIs.

spikecodes avatar May 02 '24 23:05 spikecodes

@yangcheng Thanks! But how do we pass our API key? https://console.groq.com/docs/api-keys says:

API keys are required for accessing the APIs.

@spikecodes Set the base URL and API key to Groq. However, you will lose access to OpenAI models until you remove the base URL and replace your Groq key with your OpenAI key.

The llm-router option I mentioned above allows you to provide the Groq API key via an environment variable, enabling you to use OpenAI models and others, like OLLAMA, simultaneously.

kcolemangt avatar May 02 '24 23:05 kcolemangt

Thanks @kcolemangt! I didn't realize, I could pass the Groq API key the same as the OpenAI API key.

Regarding llm-router, I don't think it would help me much as I don't really need to switch back and forth between models. Just want a good fast option.

spikecodes avatar May 03 '24 00:05 spikecodes

Does anyone know why cursor is still slow even using groq? I would imagine the completion should be slightly faster if the llm part is done in 1/8th of the time... is this a limitation of extensions built with vscodium ? increasing the speed of cursor seems like the next important milestone to get this to become the best AI editor. @truell20 @Sanger2000 Do you know who would be the best person to ask regarding this ?

CalamariDude avatar May 07 '24 04:05 CalamariDude

@yangcheng Thanks! But how do we pass our API key? https://console.groq.com/docs/api-keys says:

API keys are required for accessing the APIs.

@spikecodes Set the base URL and API key to Groq. However, you will lose access to OpenAI models until you remove the base URL and replace your Groq key with your OpenAI key.

The llm-router option I mentioned above allows you to provide the Groq API key via an environment variable, enabling you to use OpenAI models and others, like OLLAMA, simultaneously.

saw you tweet, very cool,how can we use it?

yangcheng avatar May 07 '24 06:05 yangcheng

Today I made llm-router, enabling the use of ⌘ K or ⌘ L, followed by ⌘ /, to toggle between openai and groq. If there's interest, I can open source it and cut a release.

Yes please, god i need this

krishnapraveen7 avatar May 10 '24 14:05 krishnapraveen7

https://github.com/kcolemangt/llm-router

kcolemangt avatar May 10 '24 14:05 kcolemangt

First time using cursor - implemented open source groq. How does the automation work with cursor setting up folders, files, python packages, and so on automatically without the need to manually do it yourself?

aicuby avatar Aug 22 '24 08:08 aicuby

Considering the API is compatible with OpenAI's all we need is another tab to not have to manually change urls and api keys. {45D83373-F982-4CD4-BE53-BF85A8300F76}

sugoidesune avatar Sep 17 '24 13:09 sugoidesune