Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anthropic (Claude) provider #22

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

brichet
Copy link
Collaborator

@brichet brichet commented Dec 9, 2024

This PR adds the Anthropic provider as a chat model.
It does not include completion.

@brichet brichet added the enhancement New feature or request label Dec 9, 2024
@brichet brichet marked this pull request as ready for review December 16, 2024 12:09
@brichet brichet marked this pull request as draft December 17, 2024 12:36
@brichet
Copy link
Collaborator Author

brichet commented Dec 18, 2024

I added a first version of code completion.
The idea is to give a context to the AI, and to send the current prompt as a message to complete.
The 2 issues I have so far are:

  • it is really slow on my side
  • anthropic raises if there is a space at the end of the prompt. Currently this PR is removing it, but it can lead to wrong suggestions

@jtpio
Copy link
Member

jtpio commented Dec 19, 2024

Thanks @brichet for looking into this 👍

I just tried this PR locally and there seems to be many requests made to the anthropic API, so maybe there is indeed something not expected happening:

jupyterlite-anthropic.webm

@jtpio
Copy link
Member

jtpio commented Dec 19, 2024

Interestingly when testing with Jupyter AI, completions don't seem to work and trigger some warnings in the dev tools console:

jupyter-ai-lab-434-anthropic.webm

The Jupyter Server logs also show some long response time for the inline completer:

image

@brichet
Copy link
Collaborator Author

brichet commented Dec 20, 2024

Thanks for testing it @jtpio

Using Anthropic completion with jupyter-ai do not trigger error on my side, but the suggestions are not really relevant (most of the time):

Peek 2024-12-20 13-59

Indeed, you're right about the extra requests, I'll take a closer look.

@jtpio
Copy link
Member

jtpio commented Dec 20, 2024

Using Anthropic completion with jupyter-ai do not trigger error on my side, but the suggestions are not really relevant (most of the time):

Indeed according to your screenshot there seems to be an issue with how Jupyter AI handles the inline completer suggestions. So likely an issue in Jupyter AI (we could open one if non exists already)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants