zed icon indicating copy to clipboard operation
zed copied to clipboard

Assistant: Claude API support

Open kosswald opened this issue 11 months ago • 9 comments

Check for existing issues

  • [X] Completed

Describe the feature

With the release of Claude 3 Opus, it advertises the best coding assistant performance available today. Would be nice to be able to use different APIs with Zed

https://www.anthropic.com/api

If applicable, add mockups / screenshots to help present your vision of the feature

No response

kosswald avatar Mar 05 '24 23:03 kosswald

Also being discussed in https://github.com/zed-industries/zed/issues/6708

kosswald avatar Mar 05 '24 23:03 kosswald

Just playing with the free model it's very impressive

BryanJBryce avatar Mar 07 '24 05:03 BryanJBryce

Major +1 on this, would help switch from VS code :)

jaanli avatar Mar 09 '24 15:03 jaanli

Yes please! although I would probably rename this issue to "make custom assistant APIs possible". Because who knows what the next best LLM will be?

liam-k avatar Mar 18 '24 04:03 liam-k

YES claude 3 opus has been unmatched in terms of context length!

elamien avatar Mar 21 '24 20:03 elamien

I'm not going back to ChatGPT anytime soon, so Claude support is very desired feature

lessless avatar Apr 12 '24 12:04 lessless

+1

noozo avatar Apr 22 '24 14:04 noozo

I'm looking forward to Claude3's support!

windhorn avatar May 04 '24 21:05 windhorn

Here's the best that's available now of how I'm coping: https://colab.research.google.com/github/jaanli/language-model-notebooks/blob/main/notebooks/getting-started.ipynb

jaanli avatar May 05 '24 12:05 jaanli

Claude is available in Zed v0.136.0-pre.

JosephTLyons avatar May 15 '24 19:05 JosephTLyons

Yay! Thanks so much @JosephTLyons !!!

jaanli avatar May 16 '24 03:05 jaanli

@as-cii - is there more documentation or a way to check whether Claude or GPT4o is set?

I can't figure out the way to add the ANTHROPIC_API_KEY command line variable.

Has anyone gotten Claude working in Zed with their API key?

jaanli avatar Jun 02 '24 13:06 jaanli

Same here. I've been trying to set an open API key to work with GPT4o within Zed and I can't get it work. It keeps saying: Failed to connect to OpenAI API: The model 'gpt-4o' does not exist or you do not have access to it.

rafaelbiten avatar Jun 03 '24 16:06 rafaelbiten

@as-cii - is there more documentation or a way to check whether Claude or GPT4o is set?

I can't figure out the way to add the ANTHROPIC_API_KEY command line variable.

Has anyone gotten Claude working in Zed with their API key?

Hey @jaanli, you should be able to set it in your shell rc file or by launching zed via the command line:

ANTHROPIC_API_KEY=xyz zed /path/to/project

Make sure you set this in your settings.json:

"assistant": {
    "version": "1",
    "provider": {
      "name": "anthropic"
    }
  }

Same here. I've been trying to set an open API key to work with GPT4o within Zed and I can't get it work. It keeps saying: Failed to connect to OpenAI API: The model 'gpt-40' does not exist or you do not have access to it.

@rafaelbiten: it seems like you're misspelling gpt-4o (0 vs o)?

as-cii avatar Jun 03 '24 16:06 as-cii

Sorry, I just misspelled that in my initial message. Do I have to setup the assistant in the settings.json file? I tried resetting the key a few times. Also, just want to confirm one thing. The instructions say:

Make sure your OpenAI account has credits.

Is that the case if we're subscribed to ChatGPT Plus? If it is, then that's my problem...

rafaelbiten avatar Jun 03 '24 17:06 rafaelbiten

Ok so just for anyone else that needs a reference of how to do this. You dont need to add the ANTHROPIC_API_KEY and launch it via the command line.

you can just add these assistant settings as @as-cii says

"assistant": {
    "version": "1",
    "provider": {
      "name": "anthropic"
    }
  }

Then when you save the settings (cmd+s) the assistant panel will pop open and ask you to add your API key. Which you need to get from here https://console.anthropic.com/settings/keys

Even if you pay for Claude pro, you will still have to pay for additional credits to use it via the API. Which you can do here https://console.anthropic.com/settings/plans

This confused the hell out of me. So hopefully someone else finds this comment useful.

maxmckenzie avatar Jul 03 '24 06:07 maxmckenzie

I've added the above instructions to the documentation https://github.com/zed-industries/zed/pull/13765

maxmckenzie avatar Jul 03 '24 07:07 maxmckenzie