mirror of
https://github.com/open-webui/pipelines.git
synced 2026-11-05 01:37:24 +00:00
[GH-ISSUE #166] Error with anthropic_manifold_pipeline #80
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/pipelines#80
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dannykorpan on GitHub (Jul 19, 2024).
Original GitHub issue: https://github.com/open-webui/pipelines/issues/166
Bug Report
Description
Bug Summary:

When using Claude 3.5 via anthropic_manifold_pipeline.py from https://github.com/open-webui/pipelines/blob/main/examples/pipelines/providers/anthropic_manifold_pipeline.py, I get the following error after a while. The API Key is correct.
Steps to Reproduce:

I deployed Pipelines via docker and set up the API Key via the admin interface.
After using Claude 3.5 the pipelines container prints the following error after 2-3 uses.
Environment
Open WebUI Version: [e.g., 0.1.120]
v0.3.10
Operating System: [e.g., Windows 10, macOS Big Sur, Ubuntu 20.04]
Server: Latest Docker, x64
Client: Latest macOS Sonoma, ARM64
Browser (if applicable): [e.g., Chrome 100.0, Firefox 98.0]
Latest Firefox, ARM64
Confirmation:
@eddienubes commented on GitHub (Jul 19, 2024):
We often experience the same thing.
@justinh-rahb commented on GitHub (Jul 19, 2024):
I'll have a look when I've got time, but I've been mostly using my Anthropic Function nowadays. I haven't noticed this issue in that, but then it's just using
requestsand not using theanthropiclibrary actually, so there could be differences there.@dannykorpan commented on GitHub (Jul 23, 2024):
Any solution yet? Today I have the same problem.
@justinh-rahb commented on GitHub (Jul 23, 2024):
401 Authentication error. Have you checked your keys work if you do a request manually with cURL?
@dannykorpan commented on GitHub (Jul 23, 2024):
See my initial post.
@justinh-rahb commented on GitHub (Jul 23, 2024):
Your logs are either at odds with the reality, or your key is bad. You didn't answer the question of whether you've tried that key with anything else. You're certain your account is in good-standing, and adequately funded ($5 minimum balance required IIRC)?
If I deliberately set an incorrect key I get this error, same as you:
@dannykorpan commented on GitHub (Jul 24, 2024):
25$ Balance
Here is the cURL Example with output
@justinh-rahb commented on GitHub (Jul 24, 2024):
Well, I'm truly at a loss then, I've been unable to reproduce this by any easy means, and I don't wish to push the issue too much further for fear of affecting my own access to their API.
@dannykorpan commented on GitHub (Jul 24, 2024):
If I create a second API key and use it, it works. The first API key, however, functions flawlessly via cURL.
@justinh-rahb commented on GitHub (Jul 24, 2024):
Strange... is it possible they're using a weird character in your first key that isn't being escaped properly?
@dannykorpan commented on GitHub (Jul 25, 2024):
Sometimes it's working with the key and after some time the same key won't work anymore.
@realies commented on GitHub (Jul 26, 2024):
I occasionally see the same issue with a working key. Seems reproducible when I restart the pipelines container. If I go into Open WebUI/Pipelines and select the anthropic_manifold_pipeline (manifold), the saved API key loads up. After pressing save without changing anything, it starts working as it should. The mounted appdata folder has the correct file/folder permissions and ownership.
PS: I have to do the same steps for openai_manifold_pipeline (manifold) for OpenAI models to load up and be usable.
@justinh-rahb commented on GitHub (Jul 26, 2024):
Now there's a clue I can work on. Thanks @realies, I'll see if this new information uncovers anything.
@Digit404 commented on GitHub (Jul 26, 2024):
I am also experiencing this same error. With curl, the key works fine before I use it with Pipelines, but after I use it in Open WebUI, like a banshee, the key is marked for death (figuratively speaking) and will unceremoniously expire in <24 hours. After this, not even curl can revive the key. I have made dozens of new keys trying to get around this issue and I have not been banned from the API or anything, but my keys are dropping like flies.
This is the error that happens after a key has been cursed:
@justinh-rahb commented on GitHub (Jul 26, 2024):
If you're paying customers, have any of you tried contacting Anthropic's support to inquire as to the reason your keys are being revoked?
@Digit404 commented on GitHub (Jul 26, 2024):
I have, and Anthropic took the entirety of the month to respond (Thanks, Claude 3.5). Today, they're asking for what the header sent from the app looks like and I don't really know how to find that out.
@justinh-rahb commented on GitHub (Jul 26, 2024):
Thanks for the additional datapoint @Digit404. I've no intention of closing this until I figure out what the heck is going on 😅
@sriparashiva commented on GitHub (Jul 27, 2024):
While this issue is being looked at, anyone who wants to temporarily bypass this problem can use the following working anthropic pipeline which uses the HTTP API directly and is currently working without any errors (no invalid x-api-key error):
@justinh-rahb commented on GitHub (Jul 27, 2024):
@sriparashiva ironically that's exactly what I was planning to do to "resolve" this if I had to, since using
requestshas been working just fine on my Function version of this: https://openwebui.com/f/justinrahb/anthropic@dannykorpan commented on GitHub (Jul 29, 2024):
Hi, thank you. I have downloaded your script and uploaded it through the OpenWebUI interface. Afterwards, the file is immediately moved to the "failed" subfolder within the pipeline folder. In the pipeline docker Logs, I see the following:
@sriparashiva commented on GitHub (Jul 29, 2024):
@dannykorpan Since the pipeline has an additional dependency
sseclient, you need to install it manually on the pipelines python environment. This currently needs to be done manually (I couldn't find any existing documentation showing how to have the dependencies of a custom pipeline auto-installed).I am using a Docker setup for pipelines, so I just executed the command
pip3 install sseclient-pyinside the pipelines docker container. That should make it work.Or alternatively, you can use the code snippet from @justinh-rahb's linked custom function which does not use any external dependencies.
@dannykorpan commented on GitHub (Jul 29, 2024):
Your workaround works :-) Thank you!
@justinh-rahb commented on GitHub (Jul 30, 2024):
@dannykorpan @Digit404 @sriparashiva please give this PR a try:
If you install it by putting the raw URL into your
PIPELINES_URLSenvironment variable, the server will pull it and install dependencysseclient-pyautomatically on startup:@dannykorpan commented on GitHub (Jul 30, 2024):
Thank you, but still get the following error after importing into pipelines:
@justinh-rahb commented on GitHub (Jul 30, 2024):
@dannykorpan as noted, the dependency only installs on server startup if it is already in the
pipelines/dir or you've added the URL toPIPELINES_URLS, if you attempt to upload the pipeline from Admin Settings > Pipelines, you'll get such an error.@dannykorpan commented on GitHub (Jul 30, 2024):
Thank you, but I think it represents a potential source of error.
If I restart the server, the sseclient module still won't be installed automatically. I always have to install it manually, even after a restart. Or am I misunderstanding something?
@justinh-rahb commented on GitHub (Jul 30, 2024):
You are misunderstanding something, yes. The frontmatter at the top of the file specifies what depends it uses:
When the server is started (or restarted) with
start.sh, it loops through all of the installed pipelines and willpip installtheir requirements:github.com/open-webui/pipelines@cd6c092a53/start.sh (L85-L105)@dannykorpan commented on GitHub (Jul 30, 2024):
But I start the pipelines server via docker.
@justinh-rahb commented on GitHub (Jul 30, 2024):
Two options:
Bind mount the
pipelinesvolume:You can then drop the
anthropic_manifold_pipeline.pyfile in thepipelinesdir, restart the container, and it should install.Alternatively, use the
PIPELINES_URLSenvironment variable:This should install the depends immediately after downloading the pipeline when the container starts.
@dannykorpan commented on GitHub (Jul 31, 2024):
Works, thank you!
@Digit404 commented on GitHub (Jul 31, 2024):
After installing the new pipeline, it's been a while and my key still works. Thanks for the fix!
@realies commented on GitHub (Aug 3, 2024):
@justinh-rahb, for some reason I still have to re-submit API keys for each pipeline for the service to continue to work after a restart; this is the compose file:
here's a log of starting the container, trying to use anthropic and failing to do so because
going to the settings page for anthropic_manifold_pipeline and pressing save can be seen to fix it further down the logs
any idea why this is happening?
@dannykorpan commented on GitHub (Aug 5, 2024):
Today getting the same error as @realies. After resaving the API-Key in the UI under Pipelines it works for a while.
@realies commented on GitHub (Aug 6, 2024):
Sonnet 3.5 said this could help:
@realies commented on GitHub (Aug 6, 2024):
wait, you're supposed to provide the key via ANTHROPIC_API_KEY? can keys be fetched from valves.json as a fallback?
@justinh-rahb commented on GitHub (Aug 6, 2024):
Intended to be optional with ability to set via valves as well, but if this is not working it'll need refac. Will look into when my time allows. For now, yes, setting an
ANTHROPIC_API_KEYenvironment variable should resolve the current issue until a new PR is made.@dannykorpan commented on GitHub (Aug 7, 2024):
Will try it.
@dannykorpan commented on GitHub (Aug 7, 2024):
The day after... same problem today.
@justinh-rahb commented on GitHub (Aug 7, 2024):
For what it's worth, I’ve been using my own pipeline since I created it and haven’t personally encountered any of the reported errors or issues. All my troubleshooting and debugging has been based on these reports, but I haven’t been able to fully reproduce them. This means I’m essentially working in the dark. I would greatly appreciate any additional information, such as logs or detailed accounts of the exact sequence of events that led to these outcomes, even if it feels excessive or "too much detail", let me decide that.
@dannykorpan commented on GitHub (Aug 7, 2024):
How do I enable debugging, so that I can see the the used API key?
@RamboRogers commented on GitHub (Sep 7, 2024):
I have the same error. Brand new install, valid key used on other things. Google works, anthropic crashes.
@bgeneto commented on GitHub (Sep 23, 2024):
I'm also having to save api key manually (for both Anthropic and Dall-E) manifold pipelines every time the docker container restarts. What is more Strange is that api keys are there and correct, I just have press save button.
@Aman-14 commented on GitHub (Sep 24, 2024):
@bgeneto Pipeline headers need to be updated at startup, I have create another here #271
@yazon commented on GitHub (Jan 30, 2025):
Same issue. Workaround from https://github.com/open-webui/pipelines/issues/166#issuecomment-2253134986 works but is a bit annoying.
@recallmenot commented on GitHub (Feb 11, 2025):
@bgeneto @Aman-14 can confirm, after rebooting (or restarting the pipelines docker container), for the API key to work again, I have to manually go into the pipelines interface in open-webui and hit save so something is not being passed on automatically here.
@Aman-14 commented on GitHub (Feb 11, 2025):
If you are using pipelines just for Anthropic models, you can use functions instead.
https://openwebui.com/f/justinrahb/anthropic
@savely-krasovsky commented on GitHub (Apr 20, 2025):
Resaving tokens helps, but why pipelines lose them over time? It happens in my case with Anthropic, Google and OpenAI pipelines. They just stop working at some point even without container restart. Why it stores tokens in
/pipelinesdirectory then? Restore mechanism is broken?cc @justinh-rahb