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

feat: Add support for Anthropic API (Claude etc) #3288

Closed
moodler opened this issue Jun 19, 2024 · 10 comments
Closed

feat: Add support for Anthropic API (Claude etc) #3288

moodler opened this issue Jun 19, 2024 · 10 comments

Comments

@moodler
Copy link

moodler commented Jun 19, 2024

I often use Claude from Anthropic for some use cases, as it has some advantages. But I'd love to do it in Open WebUI so I can keep all my chat records in one place.

I'd like to propose support for the Anthropic API in the same way that OpenAI API is supported. The API is extremely similar: https://docs.anthropic.com/en/api/getting-started

And really, if we do this, why stop there, there could easily be a way that admins can define new external services out there that work in similar ways. Perhaps these definitions are shareable as JSON files.

@moodler moodler changed the title Add support for Anthropic API (Claude etc) feat: Add support for Anthropic API (Claude etc) Jun 19, 2024
@justinh-rahb
Copy link
Collaborator

Our Pipelines sister-project already supports many providers that are often requested, including Anthropic:
https://github.com/open-webui/pipelines/tree/main/examples/pipelines/providers

@zaptrem
Copy link

zaptrem commented Jun 27, 2024

The process for actually setting this up is very unclear and unwieldly. For anyone else that doesn't want to lose the time I lost:

  1. Set up the main Open-WebUI Docker container following repo instructions (there goes half your RAM)
  2. Set up Pipelines Docker container following the instructions in the readme (there goes the other half of your RAM)
  3. In Open-WebUI click your Profile Picture > Admin Panel > Gear Icon (Admin Settings) > Pipelines > Paste this URL: https://github.com/open-webui/pipelines/blob/main/examples/pipelines/providers/anthropic_manifold_pipeline.py
  4. Enter your Anthropic API key.

@justinh-rahb
Copy link
Collaborator

Docs PRs always welcomed 👍

@moodler
Copy link
Author

moodler commented Jul 5, 2024

Thanks to @justinh-rahb for the pipelines project (though it feels overkill making this a whole separate service). Thanks @zaptrem for the extra guidance.

I had all this working for a while, but then it just broke ... containers all seem fine but I'm getting random errors like:

  • Uh-oh! There was an issue connecting to anthropic/claude-3.5-sonnet. Load failed
  • OpenAI: Could not fetch models from OpenAI, please update the API key in the valves.

What are Valves? No idea. Will keep playing and trying to make this work ...

@moblangeois
Copy link
Contributor

You can now integrate anthropic manifold through functions without installing Pipelines : https://openwebui.com/f/justinrahb/anthropic/

Works well for me.

@moodler
Copy link
Author

moodler commented Jul 10, 2024

Fantastic, that is exactly what I'd asked for in the original post. Confirmed it works great!

Full install instructions:

  1. Go to https://openwebui.com/f/justinrahb/anthropic/
  2. Press Get and specify your OpenWebUI URL to install the script into your Workspace as a Function.
  3. Once installed, click the setting icon (called Valves for some reason) and enter your Anthropic key.
  4. Enjoy Claude working perfectly without an entire new Pipelines docker image needed.

@justinh-rahb
Copy link
Collaborator

Glad that I could be of assistance 🫡

@Piste
Copy link

Piste commented Jul 14, 2024

Thank you, everyone! Amazing. The function works really well.

@theultimatetestings
Copy link

Is anyone else encountering a network error 400 stating you have insufficient credit balance? I thought Claude 3.5-sonnet was free use.

@justinh-rahb
Copy link
Collaborator

Is anyone else encountering a network error 400 stating you have insufficient credit balance? I thought Claude 3.5-sonnet was free use.

Their chat app at claude.ai has a limited free tier, the API does not.

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

No branches or pull requests

6 participants