@huggingface/inference 3.9.2 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/dist/index.cjs +771 -646
- package/dist/index.js +770 -646
- package/dist/src/InferenceClient.d.ts +16 -17
- package/dist/src/InferenceClient.d.ts.map +1 -1
- package/dist/src/lib/getInferenceProviderMapping.d.ts +6 -2
- package/dist/src/lib/getInferenceProviderMapping.d.ts.map +1 -1
- package/dist/src/lib/getProviderHelper.d.ts.map +1 -1
- package/dist/src/lib/makeRequestOptions.d.ts.map +1 -1
- package/dist/src/providers/consts.d.ts.map +1 -1
- package/dist/src/providers/ovhcloud.d.ts +38 -0
- package/dist/src/providers/ovhcloud.d.ts.map +1 -0
- package/dist/src/providers/providerHelper.d.ts +1 -1
- package/dist/src/providers/providerHelper.d.ts.map +1 -1
- package/dist/src/snippets/getInferenceSnippets.d.ts +1 -1
- package/dist/src/snippets/getInferenceSnippets.d.ts.map +1 -1
- package/dist/src/snippets/templates.exported.d.ts.map +1 -1
- package/dist/src/tasks/audio/audioClassification.d.ts.map +1 -1
- package/dist/src/tasks/audio/audioToAudio.d.ts.map +1 -1
- package/dist/src/tasks/audio/automaticSpeechRecognition.d.ts.map +1 -1
- package/dist/src/tasks/audio/textToSpeech.d.ts.map +1 -1
- package/dist/src/tasks/custom/request.d.ts.map +1 -1
- package/dist/src/tasks/custom/streamingRequest.d.ts.map +1 -1
- package/dist/src/tasks/cv/imageClassification.d.ts.map +1 -1
- package/dist/src/tasks/cv/imageSegmentation.d.ts.map +1 -1
- package/dist/src/tasks/cv/imageToImage.d.ts.map +1 -1
- package/dist/src/tasks/cv/imageToText.d.ts.map +1 -1
- package/dist/src/tasks/cv/objectDetection.d.ts.map +1 -1
- package/dist/src/tasks/cv/textToImage.d.ts.map +1 -1
- package/dist/src/tasks/cv/textToVideo.d.ts.map +1 -1
- package/dist/src/tasks/cv/zeroShotImageClassification.d.ts.map +1 -1
- package/dist/src/tasks/multimodal/documentQuestionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/multimodal/visualQuestionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/nlp/chatCompletion.d.ts.map +1 -1
- package/dist/src/tasks/nlp/chatCompletionStream.d.ts.map +1 -1
- package/dist/src/tasks/nlp/featureExtraction.d.ts.map +1 -1
- package/dist/src/tasks/nlp/fillMask.d.ts.map +1 -1
- package/dist/src/tasks/nlp/questionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/nlp/sentenceSimilarity.d.ts.map +1 -1
- package/dist/src/tasks/nlp/summarization.d.ts.map +1 -1
- package/dist/src/tasks/nlp/tableQuestionAnswering.d.ts.map +1 -1
- package/dist/src/tasks/nlp/textClassification.d.ts.map +1 -1
- package/dist/src/tasks/nlp/textGeneration.d.ts.map +1 -1
- package/dist/src/tasks/nlp/textGenerationStream.d.ts.map +1 -1
- package/dist/src/tasks/nlp/tokenClassification.d.ts.map +1 -1
- package/dist/src/tasks/nlp/translation.d.ts.map +1 -1
- package/dist/src/tasks/nlp/zeroShotClassification.d.ts.map +1 -1
- package/dist/src/tasks/tabular/tabularClassification.d.ts.map +1 -1
- package/dist/src/tasks/tabular/tabularRegression.d.ts.map +1 -1
- package/dist/src/types.d.ts +7 -5
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/typedEntries.d.ts +4 -0
- package/dist/src/utils/typedEntries.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/InferenceClient.ts +32 -43
- package/src/lib/getInferenceProviderMapping.ts +68 -19
- package/src/lib/getProviderHelper.ts +5 -0
- package/src/lib/makeRequestOptions.ts +4 -3
- package/src/providers/consts.ts +1 -0
- package/src/providers/ovhcloud.ts +75 -0
- package/src/providers/providerHelper.ts +1 -1
- package/src/snippets/getInferenceSnippets.ts +5 -4
- package/src/snippets/templates.exported.ts +7 -3
- package/src/tasks/audio/audioClassification.ts +3 -1
- package/src/tasks/audio/audioToAudio.ts +4 -1
- package/src/tasks/audio/automaticSpeechRecognition.ts +3 -1
- package/src/tasks/audio/textToSpeech.ts +2 -1
- package/src/tasks/custom/request.ts +3 -1
- package/src/tasks/custom/streamingRequest.ts +3 -1
- package/src/tasks/cv/imageClassification.ts +3 -1
- package/src/tasks/cv/imageSegmentation.ts +3 -1
- package/src/tasks/cv/imageToImage.ts +3 -1
- package/src/tasks/cv/imageToText.ts +3 -1
- package/src/tasks/cv/objectDetection.ts +3 -1
- package/src/tasks/cv/textToImage.ts +2 -1
- package/src/tasks/cv/textToVideo.ts +2 -1
- package/src/tasks/cv/zeroShotImageClassification.ts +3 -1
- package/src/tasks/multimodal/documentQuestionAnswering.ts +3 -1
- package/src/tasks/multimodal/visualQuestionAnswering.ts +3 -1
- package/src/tasks/nlp/chatCompletion.ts +3 -1
- package/src/tasks/nlp/chatCompletionStream.ts +3 -1
- package/src/tasks/nlp/featureExtraction.ts +3 -1
- package/src/tasks/nlp/fillMask.ts +3 -1
- package/src/tasks/nlp/questionAnswering.ts +4 -1
- package/src/tasks/nlp/sentenceSimilarity.ts +3 -1
- package/src/tasks/nlp/summarization.ts +3 -1
- package/src/tasks/nlp/tableQuestionAnswering.ts +3 -1
- package/src/tasks/nlp/textClassification.ts +3 -1
- package/src/tasks/nlp/textGeneration.ts +3 -1
- package/src/tasks/nlp/textGenerationStream.ts +3 -1
- package/src/tasks/nlp/tokenClassification.ts +3 -1
- package/src/tasks/nlp/translation.ts +3 -1
- package/src/tasks/nlp/zeroShotClassification.ts +3 -1
- package/src/tasks/tabular/tabularClassification.ts +3 -1
- package/src/tasks/tabular/tabularRegression.ts +3 -1
- package/src/types.ts +9 -4
- package/src/utils/typedEntries.ts +5 -0
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# 🤗 Hugging Face Inference
|
|
2
2
|
|
|
3
|
-
A Typescript powered wrapper for
|
|
4
|
-
It works with [Inference
|
|
3
|
+
A Typescript powered wrapper for Inference Providers (serverless) and Inference Endpoints (dedicated).
|
|
4
|
+
It works with [Inference Providers (serverless)](https://huggingface.co/docs/api-inference/index) – including all supported third-party Inference Providers – and [Inference Endpoints (dedicated)](https://huggingface.co/docs/inference-endpoints/index), and even with .
|
|
5
5
|
|
|
6
6
|
Check out the [full documentation](https://huggingface.co/docs/huggingface.js/inference/README).
|
|
7
7
|
|
|
@@ -25,20 +25,20 @@ yarn add @huggingface/inference
|
|
|
25
25
|
|
|
26
26
|
```ts
|
|
27
27
|
// esm.sh
|
|
28
|
-
import { InferenceClient } from "https://esm.sh/@huggingface/inference"
|
|
28
|
+
import { InferenceClient } from "https://esm.sh/@huggingface/inference";
|
|
29
29
|
// or npm:
|
|
30
|
-
import { InferenceClient } from "npm:@huggingface/inference"
|
|
30
|
+
import { InferenceClient } from "npm:@huggingface/inference";
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
### Initialize
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
|
-
import { InferenceClient } from '@huggingface/inference'
|
|
36
|
+
import { InferenceClient } from '@huggingface/inference';
|
|
37
37
|
|
|
38
|
-
const hf = new InferenceClient('your access token')
|
|
38
|
+
const hf = new InferenceClient('your access token');
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
❗**Important note:**
|
|
41
|
+
❗**Important note:** Always pass an access token. Join [Hugging Face](https://huggingface.co/join) and then visit [access tokens](https://huggingface.co/settings/tokens) to generate your access token for **free**.
|
|
42
42
|
|
|
43
43
|
Your access token should be kept private. If you need to protect it in front-end applications, we suggest setting up a proxy server that stores the access token.
|
|
44
44
|
|
|
@@ -54,6 +54,7 @@ Currently, we support the following providers:
|
|
|
54
54
|
- [Nebius](https://studio.nebius.ai)
|
|
55
55
|
- [Novita](https://novita.ai/?utm_source=github_huggingface&utm_medium=github_readme&utm_campaign=link)
|
|
56
56
|
- [Nscale](https://nscale.com)
|
|
57
|
+
- [OVHcloud](https://endpoints.ai.cloud.ovh.net/)
|
|
57
58
|
- [Replicate](https://replicate.com)
|
|
58
59
|
- [Sambanova](https://sambanova.ai)
|
|
59
60
|
- [Together](https://together.xyz)
|
|
@@ -84,6 +85,7 @@ Only a subset of models are supported when requesting third-party providers. You
|
|
|
84
85
|
- [Hyperbolic supported models](https://huggingface.co/api/partners/hyperbolic/models)
|
|
85
86
|
- [Nebius supported models](https://huggingface.co/api/partners/nebius/models)
|
|
86
87
|
- [Nscale supported models](https://huggingface.co/api/partners/nscale/models)
|
|
88
|
+
- [OVHcloud supported models](https://huggingface.co/api/partners/ovhcloud/models)
|
|
87
89
|
- [Replicate supported models](https://huggingface.co/api/partners/replicate/models)
|
|
88
90
|
- [Sambanova supported models](https://huggingface.co/api/partners/sambanova/models)
|
|
89
91
|
- [Together supported models](https://huggingface.co/api/partners/together/models)
|