getcursor / cursor

The AI Code Editor
https://cursor.com
21.7k stars 1.41k forks source link

Add Support for Claude 3 Opus #1294

Closed 7KTX closed 5 months ago

7KTX commented 5 months ago

Is your feature request related to a problem? Please describe. Cursor is amazing. Claude 3 is also amazing. It's distinctly more performant than GPT-4 when it comes to coding and I think it'd be highly useful to integrate it with Cursor. Currently I am using Double instead. It's great, but Cursor is far more intuitive to use. The problem is that Claude is so much better than GPT-4 that it's not worth using Cursor without it currently IMO.

Describe the solution you'd like An implementation that works with Anthropic's Claude 3 Opus :)

ilyakamens commented 5 months ago

Yes, please!

vincentsch commented 5 months ago

Completely agree with @y0usaf. Cursor is an exceptional tool, and Opus 3 is the superior model.

Let's see if Cursor integrates Opus 3. Cursor is developed by Anysphere, which is backed by the OpenAI Fund. Opus 3 comes from Anthropic, a significant competitor to Cursor's lead investor.

clayrisser commented 5 months ago

Please

Thank you

😊

ccheney commented 5 months ago

The ability to point to any LLM should be seriously discussed, as it's highly likely that more advanced models will continue to be released in the foreseeable future.

e.g.

The app should also be flexible with the length of the context window relative to what the currently active model supports:

riley-wood commented 5 months ago

Just chiming in here to add to the pile of requests for this. Claude Opus performs better than GPT-4 in my testing for coding, and the context window is much-needed for large codebase analysis. Please please please add this. I'd even pay a premium for it.

ttizze commented 5 months ago

please!!!!!!!!!!!!!!!

briandonahue commented 5 months ago

Just signed up for Claude and have been blown away. Would love to try it in Cursor.

As an idea - what if your paid subscription included the ability to choose between multiple models - ChatGPT and Claude and maybe more. I would then be inclined to pay for Cursor instead of (or perhaps in addition to) multiple AI tools...

NicolasStuff commented 5 months ago

I reaaaaaaly want this feature!! I would pay more for the service if it could bring Opus to Custor 🙏

cantonalex commented 5 months ago

Pls

ghost commented 5 months ago

Opus! Opus! Opus!

NitrousBGC commented 5 months ago

This would be an incredible addition. I would be ready to pay alot more for Opus. Additionally, lots of us can't even try it out because of region restrictions.

Let's cross our fingers! 🤞

SebastienPingal commented 5 months ago

Switching to double...

bitdeep commented 5 months ago

I'll pay more for Opus, no problem, you guys can add additional layer of subscription for model like Opus.

tendiesfortwo commented 5 months ago

Currently I am using Double instead. It's great, but Cursor is far more intuitive to use. The problem is that Claude is so much better than GPT-4 that it's not worth using Cursor without it currently IMO.

and here i thought i was the only one using double.bot! yes, i downloaded it only because they had claude 3 opus and the code is significantly better.

their extension has less features but in the 1 week since i downloaded, their team has shipped like 6 new versions, they move quick!!

pb376 commented 5 months ago

Just downloaded double after seeing the rec here and yeah, the code output is indeed notably better quality when you choose claude v3, thanks.

Ischca commented 5 months ago

The ability to use Claude3 Opus is attractive, but what is more important to me personally is that the AI has access to the codebase.

pb376 commented 5 months ago

I don't know why cursor devs haven't responded to this over the past week, but apparently it's been possible to use Claude this whole time, i.e. via openrouter: https://forum.cursor.sh/t/support-local-llms/1099/25

vincentsch commented 5 months ago

@pb376 Thank you for the suggestion.

Configuring Cursor with Openrouter.ai isn't entirely straightforward. I've prepared a step-by-step guide:

https://www.vincentschmalbach.com/adding-models-to-cursor/

NicolasStuff commented 5 months ago

I think they want to use Opus but they can't because they have raised funds from OpenAI...

I'll also switch to double.bot for Opus

cantonalex commented 5 months ago

I don't know why cursor devs haven't responded to this over the past week, but apparently it's been possible to use Claude this whole time, i.e. via openrouter: https://forum.cursor.sh/t/support-local-llms/1099/25

@pb376 doesn't support codebase

vincentsch commented 5 months ago

@cantonalex Cursor does send code context with every request.

Here's a breakdown of Cursor's API request: https://www.vincentschmalbach.com/analyzing-cursors-gpt-4-api-request/

(Request is the same if you use Claude 3 Opus through Openrouter.ai.)

mike-courian commented 5 months ago

+1

cantonalex commented 5 months ago

@cantonalex Cursor does send code context with every request.

Here's a breakdown of Cursor's API request: https://www.vincentschmalbach.com/analyzing-cursors-gpt-4-api-request/

(Request is the same if you use Claude 3 Opus through Openrouter.ai.)

@vincentsch no it's not thats why everyone is requesting support. It works on only the open file, not the codebase.

InsightfulFuture commented 5 months ago

+1 seriously that would be incredible

murnanedaniel commented 5 months ago

+1 This should be the absolute priority @ Cursor right now.

lukecivantos commented 5 months ago

+1

thewillhuang commented 5 months ago

+1

lc commented 5 months ago

Please!!

truell20 commented 5 months ago

Hello! As a stopgap measure, if you’re a Pro or Business user, you can add “claude-3-opus” as a custom model in the Settings page, and use 10 fast requests per day for free (unlimited slow, but the delay increases exponentially).

We expect to roll out a more permanent solution (incl API key users) within the next few days.

We've made some changes to our internals to make adding new model providers much quicker. Going forward, we expect to add new near-SOTA coding models within the day they release.

vincentsch commented 5 months ago

@truell20

That doesn't work really well:

  1. Select some code range
  2. Press Ctrl+K
  3. Type a prompt + Enter
  4. Selected code will be deleted and replaced by this sentence: "Here is the rewritten selection according to your instructions:"

Tried adding this to my prompt: "just give me the rewritten code, nothing else, no explanation, just the code"

Initially this seemed to work better. But the generated code is truncated and leaves me with a non-functioning half-finished thing.

Update: For smaller files or pieces of code it's working, but you always have to add something like "just give me the rewritten code, nothing else, no explanation, just the code"

murnanedaniel commented 5 months ago

I'm getting the same behaviour. Ctrl K not working as before

transcendr commented 5 months ago

@vincentsch thanks for the guide, appreciated it. That said using openrouter seems to break Cursor's context for me. When sending a request with documentation, in the default setup, it reads the docs and generates doc-specific code. Making the same request with openrouter enabled results in generic code and the model responding things like "since I don't have access to xyz, here's a general approach you could take" and it always sends the current file as context which the default doesn't do (and is silly to send whatever random file you have open as context with each request). There's definitely something not working quite right.

vincentsch commented 5 months ago

@transcendr Yes, I wasn't satisfied with how it worked either. We'll have to wait until the Cursor team fully integrates Opus, I guess.

NicolasStuff commented 5 months ago

Hope it's coming soon!

vincentsch commented 5 months ago

@NicolasStuff It's already there.

Here's a step-by-step guide for adding Claude 3 Opus to Cursor:

  1. Open Cursor.

  2. Hit Ctrl+Shift+J to enter Cursor settings.

  3. Scroll to "OpenAI API".

  4. Click on "Configure models" below the API key field.

  5. Click on "+ Add model" (below the model names).

  6. Enter "claude-3-opus" as the model name.

  7. Click on the "+" next to the field to add the model.

  8. Close the settings page.

  9. Use Cursor as before with the new Claude 3 Opus model.

That's it! With the recent update, you no longer need to use OpenRouter.ai or override the OpenAI Base URL. Just add "claude-3-opus" as a custom model in the Settings page, and you're ready to go.

Edit: You have to add "just give me the code, nothing else, no explanation, just the code" to every prompt to make it work.

clayrisser commented 5 months ago

@vincentsch how to add the Claude api key?

I tried add it instead of the openai api key.

I get the following error.

I'm using the latest version of cursor.

Screenshot 2024-03-18 at 12 26 11 PM
clayrisser commented 5 months ago

I think I need to override the OpenAI Base URL. @vincentsch what should it be set to?

I tried the following.

https://api.anthropic.com/v1 https://api.anthropic.com

briandonahue commented 5 months ago

@clayrisser noticed this in the release notes - not sure if you are a paid user, but it doesn't seem like it's fully supported (yet):

If you’re a Pro or Business user, you can add "claude-3-opus" as a custom model in the Settings page and use 10 fast requests per day for free (unlimited slow, but the delay increases exponentially). We expect to roll out a more permanent solution (including API key users) very soon.

vincentsch commented 5 months ago

@clayrisser You cannot yet use your own API key. See what @truell20 said above. They will roll out support for custom API keys in the next few days.

7KTX commented 5 months ago

Well, looks like support is pretty much here. It looks like we can't click on "Apply" like normal, but I think it's still pretty good. Thanks a lot Cursor team!

LifeGains commented 3 months ago

@truell20 i do not see the Claude API key options on my end anymore - it was there yesterday? On a Mac

image