@huggingface/inference 3.7.0 → 3.7.1
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/dist/index.cjs +1152 -839
- package/dist/index.js +1154 -841
- package/dist/src/lib/getProviderHelper.d.ts +37 -0
- package/dist/src/lib/getProviderHelper.d.ts.map +1 -0
- package/dist/src/lib/makeRequestOptions.d.ts +0 -2
- package/dist/src/lib/makeRequestOptions.d.ts.map +1 -1
- package/dist/src/providers/black-forest-labs.d.ts +14 -18
- package/dist/src/providers/black-forest-labs.d.ts.map +1 -1
- package/dist/src/providers/cerebras.d.ts +4 -2
- package/dist/src/providers/cerebras.d.ts.map +1 -1
- package/dist/src/providers/cohere.d.ts +5 -2
- package/dist/src/providers/cohere.d.ts.map +1 -1
- package/dist/src/providers/fal-ai.d.ts +50 -3
- package/dist/src/providers/fal-ai.d.ts.map +1 -1
- package/dist/src/providers/fireworks-ai.d.ts +5 -2
- package/dist/src/providers/fireworks-ai.d.ts.map +1 -1
- package/dist/src/providers/hf-inference.d.ts +125 -2
- package/dist/src/providers/hf-inference.d.ts.map +1 -1
- package/dist/src/providers/hyperbolic.d.ts +31 -2
- package/dist/src/providers/hyperbolic.d.ts.map +1 -1
- package/dist/src/providers/nebius.d.ts +20 -18
- package/dist/src/providers/nebius.d.ts.map +1 -1
- package/dist/src/providers/novita.d.ts +21 -18
- package/dist/src/providers/novita.d.ts.map +1 -1
- package/dist/src/providers/openai.d.ts +4 -2
- package/dist/src/providers/openai.d.ts.map +1 -1
- package/dist/src/providers/providerHelper.d.ts +182 -0
- package/dist/src/providers/providerHelper.d.ts.map +1 -0
- package/dist/src/providers/replicate.d.ts +23 -19
- package/dist/src/providers/replicate.d.ts.map +1 -1
- package/dist/src/providers/sambanova.d.ts +4 -2
- package/dist/src/providers/sambanova.d.ts.map +1 -1
- package/dist/src/providers/together.d.ts +32 -2
- package/dist/src/providers/together.d.ts.map +1 -1
- package/dist/src/snippets/getInferenceSnippets.d.ts.map +1 -1
- package/dist/src/tasks/audio/audioClassification.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/audio/utils.d.ts +2 -1
- package/dist/src/tasks/audio/utils.d.ts.map +1 -1
- package/dist/src/tasks/custom/request.d.ts +0 -2
- package/dist/src/tasks/custom/request.d.ts.map +1 -1
- package/dist/src/tasks/custom/streamingRequest.d.ts +0 -2
- 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/index.d.ts +6 -6
- package/dist/src/tasks/index.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/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 +3 -13
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/lib/getProviderHelper.ts +270 -0
- package/src/lib/makeRequestOptions.ts +34 -91
- package/src/providers/black-forest-labs.ts +73 -22
- package/src/providers/cerebras.ts +6 -27
- package/src/providers/cohere.ts +9 -28
- package/src/providers/fal-ai.ts +195 -77
- package/src/providers/fireworks-ai.ts +8 -29
- package/src/providers/hf-inference.ts +555 -34
- package/src/providers/hyperbolic.ts +107 -29
- package/src/providers/nebius.ts +65 -29
- package/src/providers/novita.ts +68 -32
- package/src/providers/openai.ts +6 -32
- package/src/providers/providerHelper.ts +354 -0
- package/src/providers/replicate.ts +124 -34
- package/src/providers/sambanova.ts +5 -30
- package/src/providers/together.ts +92 -28
- package/src/snippets/getInferenceSnippets.ts +16 -9
- package/src/snippets/templates.exported.ts +1 -1
- package/src/tasks/audio/audioClassification.ts +4 -7
- package/src/tasks/audio/audioToAudio.ts +3 -26
- package/src/tasks/audio/automaticSpeechRecognition.ts +4 -3
- package/src/tasks/audio/textToSpeech.ts +5 -29
- package/src/tasks/audio/utils.ts +2 -1
- package/src/tasks/custom/request.ts +0 -2
- package/src/tasks/custom/streamingRequest.ts +0 -2
- package/src/tasks/cv/imageClassification.ts +3 -7
- package/src/tasks/cv/imageSegmentation.ts +3 -8
- package/src/tasks/cv/imageToImage.ts +3 -6
- package/src/tasks/cv/imageToText.ts +3 -6
- package/src/tasks/cv/objectDetection.ts +3 -18
- package/src/tasks/cv/textToImage.ts +9 -137
- package/src/tasks/cv/textToVideo.ts +11 -62
- package/src/tasks/cv/zeroShotImageClassification.ts +3 -7
- package/src/tasks/index.ts +6 -6
- package/src/tasks/multimodal/documentQuestionAnswering.ts +3 -19
- package/src/tasks/multimodal/visualQuestionAnswering.ts +3 -11
- package/src/tasks/nlp/chatCompletion.ts +5 -20
- package/src/tasks/nlp/chatCompletionStream.ts +1 -2
- package/src/tasks/nlp/featureExtraction.ts +3 -18
- package/src/tasks/nlp/fillMask.ts +3 -16
- package/src/tasks/nlp/questionAnswering.ts +3 -22
- package/src/tasks/nlp/sentenceSimilarity.ts +3 -7
- package/src/tasks/nlp/summarization.ts +3 -6
- package/src/tasks/nlp/tableQuestionAnswering.ts +3 -27
- package/src/tasks/nlp/textClassification.ts +3 -8
- package/src/tasks/nlp/textGeneration.ts +12 -79
- package/src/tasks/nlp/tokenClassification.ts +3 -18
- package/src/tasks/nlp/translation.ts +3 -6
- package/src/tasks/nlp/zeroShotClassification.ts +3 -16
- package/src/tasks/tabular/tabularClassification.ts +3 -6
- package/src/tasks/tabular/tabularRegression.ts +3 -6
- package/src/types.ts +3 -14
package/src/types.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface Options {
|
|
|
34
34
|
billTo?: string;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export type InferenceTask = Exclude<PipelineType, "other"
|
|
37
|
+
export type InferenceTask = Exclude<PipelineType, "other"> | "conversational";
|
|
38
38
|
|
|
39
39
|
export const INFERENCE_PROVIDERS = [
|
|
40
40
|
"black-forest-labs",
|
|
@@ -101,14 +101,6 @@ export type RequestArgs = BaseArgs &
|
|
|
101
101
|
parameters?: Record<string, unknown>;
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
export interface ProviderConfig {
|
|
105
|
-
makeBaseUrl: ((task?: InferenceTask) => string) | (() => string);
|
|
106
|
-
makeBody: (params: BodyParams) => Record<string, unknown>;
|
|
107
|
-
makeHeaders: (params: HeaderParams) => Record<string, string>;
|
|
108
|
-
makeUrl: (params: UrlParams) => string;
|
|
109
|
-
clientSideRoutingOnly?: boolean;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
104
|
export type AuthMethod = "none" | "hf-token" | "credentials-include" | "provider-key";
|
|
113
105
|
|
|
114
106
|
export interface HeaderParams {
|
|
@@ -118,15 +110,12 @@ export interface HeaderParams {
|
|
|
118
110
|
|
|
119
111
|
export interface UrlParams {
|
|
120
112
|
authMethod: AuthMethod;
|
|
121
|
-
baseUrl: string;
|
|
122
113
|
model: string;
|
|
123
114
|
task?: InferenceTask;
|
|
124
|
-
chatCompletion?: boolean;
|
|
125
115
|
}
|
|
126
116
|
|
|
127
|
-
export interface BodyParams {
|
|
128
|
-
args:
|
|
129
|
-
chatCompletion?: boolean;
|
|
117
|
+
export interface BodyParams<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
118
|
+
args: T;
|
|
130
119
|
model: string;
|
|
131
120
|
task?: InferenceTask;
|
|
132
121
|
}
|