zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.04k stars 2.96k forks source link

Assistant: Claude API support #8914

Closed kosswald closed 5 months ago

kosswald commented 7 months ago

Check for existing issues

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 commented 7 months ago

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

BryanJBryce commented 7 months ago

Just playing with the free model it's very impressive

jaanli commented 7 months ago

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

liam-k commented 7 months ago

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?

elamien commented 7 months ago

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

lessless commented 6 months ago

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

noozo commented 6 months ago

+1

windhorn commented 5 months ago

I'm looking forward to Claude3's support!

jaanli commented 5 months ago

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

JosephTLyons commented 5 months ago

Claude is available in Zed v0.136.0-pre.

jaanli commented 5 months ago

Yay! Thanks so much @JosephTLyons !!!

jaanli commented 4 months ago

@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?

rafaelbiten commented 4 months ago

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.

as-cii commented 4 months ago

@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)?

rafaelbiten commented 4 months ago

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...

maxmckenzie commented 3 months ago

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 commented 3 months ago

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