You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: We need to upgrade @huggingface/inference to the latest version as HF has been working to change their API endpoint in support of their multi-provider API model.
My above code worked fine until mid last week when my app broke and I started to get the error about the same time HF released their new multi provider configurations thru their dashboard. Digging thru the code for @huggingface/inference ^2.6.4 that langchain specifies as a peer dependency, I found out that "An error occurred while fetching the blob" was because HF API endpoint was failing with a 404 error and only "400, 422, 404, 500" errors were being handled with a meaningful response in the huggingface inference npm package. It was just giving out the mentioned error for all other cases. The older version uses the "https://api-inference.huggingface.co" end point for the API calls ( https://github.com/huggingface/huggingface.js/blob/96b4436e76e613a8c6362423ee7201604d6e3bbc/packages/inference/src/lib/makeRequestOptions.ts#L5 ), while the newer versions use a new router endpoint with a "provider" (https://router.huggingface.co/[providerName]/models/[modelName]/pipeline/... ) . I couldn't find any announcements about the old end-point getting deprecated, but it may had gone down with a premature shutdown as part of their move to the new multi-provider model. I also don't know if the old end-point is still down or back online because I am using the newer @huggingface/inference 3.12.1 now in a clunky way and not planning to downgrade it. More specifically:
I was able to override @huggingface/inference in my package.json to the latest version and use patch-package to add some changes to langchain to get the new version to work and be back running. FYI, in addition to the new provider field that needs to be piped, I also noticed multiple methods used by langchain that @huggingface/inference 3.12 has marked as deprecated and to be removed in future versions. Those methods don't need to be changed to migrate to the new version at the moment, but they are a ticking bomb.
I can potentially look into a PR for this upgrade next week, unless if you are already working on or plan to do it.
The text was updated successfully, but these errors were encountered:
dosubotbot
added
the
auto:bug
Related to a bug, vulnerability, unexpected error with an existing feature
label
May 9, 2025
YasharF
changed the title
Huggingface intermitent issues partly because of out-of-date dependency
Huggingface call issues partly because of out-of-date dependency
May 9, 2025
Uh oh!
There was an error while loading. Please reload this page.
Checked other resources
Example Code
cjs
Error Message and Stack Trace (if applicable)
An error occurred while fetching the blob
Description
Summary: We need to upgrade @huggingface/inference to the latest version as HF has been working to change their API endpoint in support of their multi-provider API model.
My above code worked fine until mid last week when my app broke and I started to get the error about the same time HF released their new multi provider configurations thru their dashboard. Digging thru the code for @huggingface/inference ^2.6.4 that langchain specifies as a peer dependency, I found out that "An error occurred while fetching the blob" was because HF API endpoint was failing with a 404 error and only "400, 422, 404, 500" errors were being handled with a meaningful response in the huggingface inference npm package. It was just giving out the mentioned error for all other cases. The older version uses the "https://api-inference.huggingface.co" end point for the API calls ( https://github.com/huggingface/huggingface.js/blob/96b4436e76e613a8c6362423ee7201604d6e3bbc/packages/inference/src/lib/makeRequestOptions.ts#L5 ), while the newer versions use a new router endpoint with a "provider" (https://router.huggingface.co/[providerName]/models/[modelName]/pipeline/... ) . I couldn't find any announcements about the old end-point getting deprecated, but it may had gone down with a premature shutdown as part of their move to the new multi-provider model. I also don't know if the old end-point is still down or back online because I am using the newer @huggingface/inference 3.12.1 now in a clunky way and not planning to downgrade it. More specifically:
I was able to override @huggingface/inference in my package.json to the latest version and use patch-package to add some changes to langchain to get the new version to work and be back running. FYI, in addition to the new provider field that needs to be piped, I also noticed multiple methods used by langchain that @huggingface/inference 3.12 has marked as deprecated and to be removed in future versions. Those methods don't need to be changed to migrate to the new version at the moment, but they are a ticking bomb.
I can potentially look into a PR for this upgrade next week, unless if you are already working on or plan to do it.
System Info
WSL Ubuntu 24.04.01 LTS
$ node -v
v22.15.0
=====
"@langchain/community": "^0.3.42",
"@langchain/core": "^0.3.54",
"@langchain/mongodb": "^0.1.0",
"@langchain/textsplitters": "^0.1.0",
"langchain": "^0.3.24",
The text was updated successfully, but these errors were encountered: