aider icon indicating copy to clipboard operation
aider copied to clipboard

try aider with anthropic claude-instant-100k

Open ericries opened this issue 2 years ago • 8 comments

I would be very curious to see how aider performs with claude-instant, especially the 100k context variant. I think the latency and cost might be really different. Let me know if you're interested and don't have access

ericries avatar May 27 '23 18:05 ericries

That would certainly be interesting to try.

I spent quite a bit of effort finding a prompt and syntax that GPT could use to output these sorts of code edits. I shared some notes recently on HN: https://news.ycombinator.com/item?id=35950068

Thanks to that process I have become fairly convinced that GPT-4 is just barely competent to complete these sort of tasks. I spent far too much time trying to get gpt-3.5-turbo to work in this way. It was a lost cause for outputting any editing syntax -- it only worked reliably by outputting the entire modified source file. Which was slow and wasted the small context window.

So I think it would be fun to try with other LLMs, but I am not optimistic about it "just working".

paul-gauthier avatar May 27 '23 21:05 paul-gauthier

smol-developer-js is the most similar I found to aider (much better than the original smol-developer) and the developer says it works better with claude 100k than with GPT-4 due to the larger context window.

I tried it and works well, but didn't try aider yet.

tiagoefreitas avatar May 31 '23 09:05 tiagoefreitas

That's good to know. I actually applied for Claude access yesterday, so I'll give it a try when I am able.

paul-gauthier avatar May 31 '23 13:05 paul-gauthier

Looks like GitHub redacted your email. You can reach me at: aider at paulg.org.

paul-gauthier avatar May 31 '23 15:05 paul-gauthier

Sent, please check

tiagoefreitas avatar Jun 01 '23 11:06 tiagoefreitas

That's good to know. I actually applied for Claude access yesterday, so I'll give it a try when I am able.

Claude hasn't been working well for me. If I give it 25k of an API doc and ask it to restructure as a Python class (Setting output len to 50k), it outputs maybe one or two methods of a few hundred tokens and decides it's done.

bitnom avatar Jul 02 '23 20:07 bitnom

Today Anthropic released Claude 2 with API access to the public. My first tests were quite impressing. Cody also seem to use Claude 2 as their LLM https://about.sourcegraph.com/cody

felixpie avatar Jul 12 '23 10:07 felixpie

@felixpie as far as I can tell, Anthropic only released Claude 2 to the public via their web chat UI? It appears that they are still waitlisting people for API access. I have not yet cleared the waitlist.

If I am mistaken and missed the public API signup please let me know.

paul-gauthier avatar Jul 12 '23 19:07 paul-gauthier

@paul-gauthier I saw your comment on hackernews, I'd be happy to work on integrating Claude with this project. Of course the Claude Client I created is still very much beta, unstable, etc, I'm planning to do a few things on it which would make it much more stable, integrating automated testing including file attachments, context length, etc.

Of course if Claude fails, it'd be simple to fall back to a more officially supported API, e.g. GPT3.5-Turbo

Explosion-Scratch avatar Jul 15 '23 00:07 Explosion-Scratch

@felixpie as far as I can tell, Anthropic only released Claude 2 to the public via their web chat UI? It appears that they are still waitlisting people for API access. I have not yet cleared the waitlist.

If I am mistaken and missed the public API signup please let me know.

@paul-gauthier Your are correct, I misunderstood their press release. Sorry.

felixpie avatar Jul 16 '23 08:07 felixpie

I'd be happy to work on integrating Claude with this project.

@Explosion-Scratch nice work on the Claude API!

I'm hesitant to integrate via unofficial/unsupported endpoints which are intended for use by their web chat ui. It seems likely they will try and block or complicate such usage if it gains much popularity. But perhaps I am misunderstanding how you're accessing Claude?

paul-gauthier avatar Jul 16 '23 16:07 paul-gauthier

Via their internal API, it seems these endpoints are fairly straightforward though, for instance https://claude.ai/api/append_message and many others like that (see the source code), as with ChatGPT it'd be very hard to block this type of traffic entirely, especially with User-Agent spoofing, headless browser and other such methods.

Explosion-Scratch avatar Jul 17 '23 01:07 Explosion-Scratch

My first tests were quite impressing

Hello. I don't know if it's only for me, but my coding experience with claude-2 was pretty awful.

Even when you ask it to give you the whole code, without placeholders and stuff like that, it always returns code similar to that:

some_function():
    # implementation of some function

# ...

And this is just annoying. No matter how hard I try, I couldn't defeat it's love for placeholder/pseudo code comments. Maybe it's just a skill issue though :D

Well, at least it can be a decent summarizer/explainer and can rhyme in Russian ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

Happ1ness-dev avatar Jul 19 '23 08:07 Happ1ness-dev

Nevermind. By some miracle, I managed to make it write okay code, but it's still very shaky

Happ1ness-dev avatar Jul 19 '23 12:07 Happ1ness-dev

I've been working on some prompts to make claude better handle placeholders and such, I'll give those here in a few mins once I get them to work better

Explosion-Scratch avatar Jul 19 '23 12:07 Explosion-Scratch

Current prompt:

Act as an expert software engineer at Google. Be concise! First write out your initial code draft (no comments and no placeholders), then think through 4 thoughts and criticisms of the code you wrote (in bullet points). Make sure to use the latest syntax (e.g. ESM/ES6 in JavaScript, HTML5, CSS3), try not to rely on libraries if possible, don't include debug or comments or empty lines. Include checks and error handling to make sure it works properly. Make sure your code is readable and does not include any placeholders or psuedocode. After your draft, write out some final thoughts and then write your final version. Your code should be able to be run instantly. Unless explicitly requested make sure all functions are completely filled in. DONT INCLUDE ANY TODO COMMENTS. DONT INCLUDE PSUEDOCODE. DONT INCLUDE PLACEHOLDERS. Adhere to the user's request as closely as possible. Use a single file only. Try to make all functions pure. Remember to fill in any placeholders and psuedocode! Start your final version with "FINAL:". Put your result in a codeblock and give instructions on how set up and run it afterwards with a single shell commant (e.g. pnpm init && pnpm i express && code index.js).

Your first request is: Write a javascript program to play hangman in the terminal (node.js, use inquirer).

Explosion-Scratch avatar Jul 19 '23 12:07 Explosion-Scratch

image Working pretty well so far!

Explosion-Scratch avatar Jul 19 '23 12:07 Explosion-Scratch

Working pretty well so far!

Can it handle editing existing code as well thought?

Happ1ness-dev avatar Jul 19 '23 22:07 Happ1ness-dev

Thought you guys might be interested in this:

https://github.com/Explosion-Scratch/claude-unofficial-api/assets/61319150/68b11264-d56e-4ade-a2bf-d4625b1397bb

Basically Claude cli with prompt templates it:

  1. Writes a design document for the program you request ("cli math game with simple multiplication, division and subtraction node.js")
  2. Uploads that as a file on Claude's API
  3. Starts a new conversation, writes the implementation based on the design doc
  4. Critiques its implementation finding bugs and improving it
  5. Outputs the final code
  6. Writes code to files on your computer (parsed using JS regex contained in templates)

See this filefor more

Explosion-Scratch avatar Jul 20 '23 16:07 Explosion-Scratch

Closing this for now. See #172 for more info.

paul-gauthier avatar Aug 02 '23 15:08 paul-gauthier