Ƭ AudioClassificationArgs: BaseArgs & AudioClassificationInput | LegacyAudioInput
inference/src/tasks/audio/audioClassification.ts:8
Ƭ AudioToAudioArgs: BaseArgs & { inputs: Blob } | LegacyAudioInput
inference/src/tasks/audio/audioToAudio.ts:7
Ƭ AutomaticSpeechRecognitionArgs: BaseArgs & AutomaticSpeechRecognitionInput | LegacyAudioInput
inference/src/tasks/audio/automaticSpeechRecognition.ts:10
Ƭ DocumentQuestionAnsweringArgs: BaseArgs & DocumentQuestionAnsweringInput & { inputs: DocumentQuestionAnsweringInputData & { image: Blob } }
inference/src/tasks/multimodal/documentQuestionAnswering.ts:14
Ƭ FeatureExtractionArgs: BaseArgs & FeatureExtractionInput
inference/src/tasks/nlp/featureExtraction.ts:6
Ƭ FeatureExtractionOutput: (number | number[] | number[][])[]
Returned values are a multidimensional array of floats (dimension depending on if you sent a string or a list of string, and if the automatic reduction, usually mean_pooling for instance was applied for you or not. This should be explained on the model’s README).
inference/src/tasks/nlp/featureExtraction.ts:11
Ƭ FillMaskArgs: BaseArgs & FillMaskInput
inference/src/tasks/nlp/fillMask.ts:6
Ƭ ImageClassificationArgs: BaseArgs & ImageClassificationInput | LegacyImageInput
inference/src/tasks/cv/imageClassification.ts:7
Ƭ ImageSegmentationArgs: BaseArgs & ImageSegmentationInput | LegacyImageInput
inference/src/tasks/cv/imageSegmentation.ts:7
Ƭ ImageToImageArgs: BaseArgs & ImageToImageInput
inference/src/tasks/cv/imageToImage.ts:7
Ƭ ImageToTextArgs: BaseArgs & ImageToTextInput | LegacyImageInput
inference/src/tasks/cv/imageToText.ts:8
Ƭ InferenceProvider: typeof INFERENCE_PROVIDERS[number]
Ƭ InferenceTask: Exclude\<PipelineType, "other">
Ƭ ModelId: string
HF model id, like “meta-llama/Llama-3.3-70B-Instruct”
Ƭ ObjectDetectionArgs: BaseArgs & ObjectDetectionInput | LegacyImageInput
inference/src/tasks/cv/objectDetection.ts:7
Ƭ QuestionAnsweringArgs: BaseArgs & QuestionAnsweringInput
inference/src/tasks/nlp/questionAnswering.ts:6
Ƭ RequestArgs: BaseArgs & { data: Blob | ArrayBuffer } | { inputs: unknown } | { prompt: string } | { text: string } | { audio_url: string } | ChatCompletionInput & { parameters?: Record\<string, unknown> }
Ƭ SentenceSimilarityArgs: BaseArgs & SentenceSimilarityInput
inference/src/tasks/nlp/sentenceSimilarity.ts:7
Ƭ SummarizationArgs: BaseArgs & SummarizationInput
inference/src/tasks/nlp/summarization.ts:6
Ƭ TableQuestionAnsweringArgs: BaseArgs & TableQuestionAnsweringInput
inference/src/tasks/nlp/tableQuestionAnswering.ts:6
Ƭ TabularClassificationArgs: BaseArgs & { inputs: { data: Record\<string, string[]> } }
inference/src/tasks/tabular/tabularClassification.ts:5
Ƭ TabularClassificationOutput: number[]
A list of predicted labels for each row
inference/src/tasks/tabular/tabularClassification.ts:17
Ƭ TabularRegressionArgs: BaseArgs & { inputs: { data: Record\<string, string[]> } }
inference/src/tasks/tabular/tabularRegression.ts:5
Ƭ TabularRegressionOutput: number[]
a list of predicted values for each row
inference/src/tasks/tabular/tabularRegression.ts:17
Ƭ TextClassificationArgs: BaseArgs & TextClassificationInput
inference/src/tasks/nlp/textClassification.ts:6
Ƭ TextGenerationStreamFinishReason: "length" | "eos_token" | "stop_sequence"
inference/src/tasks/nlp/textGenerationStream.ts:46
Ƭ TextToImageArgs: BaseArgs & TextToImageInput
inference/src/tasks/cv/textToImage.ts:8
Ƭ TextToVideoArgs: BaseArgs & TextToVideoInput
inference/src/tasks/cv/textToVideo.ts:9
Ƭ TextToVideoOutput: Blob
inference/src/tasks/cv/textToVideo.ts:11
Ƭ TokenClassificationArgs: BaseArgs & TokenClassificationInput
inference/src/tasks/nlp/tokenClassification.ts:7
Ƭ TranslationArgs: BaseArgs & TranslationInput
inference/src/tasks/nlp/translation.ts:6
Ƭ VisualQuestionAnsweringArgs: BaseArgs & VisualQuestionAnsweringInput & { inputs: VisualQuestionAnsweringInputData & { image: Blob } }
inference/src/tasks/multimodal/visualQuestionAnswering.ts:12
Ƭ ZeroShotClassificationArgs: BaseArgs & ZeroShotClassificationInput
inference/src/tasks/nlp/zeroShotClassification.ts:7
Ƭ ZeroShotImageClassificationArgs: BaseArgs & ZeroShotImageClassificationInput | LegacyZeroShotImageClassificationInput
inference/src/tasks/cv/zeroShotImageClassification.ts:15
• Const INFERENCE_PROVIDERS: readonly ["black-forest-labs", "cerebras", "cohere", "fal-ai", "fireworks-ai", "hf-inference", "hyperbolic", "nebius", "novita", "openai", "replicate", "sambanova", "together"]
▸ audioClassification(args, options?): Promise\<AudioClassificationOutput>
This task reads some audio input and outputs the likelihood of classes. Recommended model: superb/hubert-large-superb-er
| Name | Type |
|---|---|
args | AudioClassificationArgs |
options? | Options |
Promise\<AudioClassificationOutput>
inference/src/tasks/audio/audioClassification.ts:14
▸ audioToAudio(args, options?): Promise\<AudioToAudioOutput[]>
This task reads some audio input and outputs one or multiple audio files. Example model: speechbrain/sepformer-wham does audio source separation.
| Name | Type |
|---|---|
args | AudioToAudioArgs |
options? | Options |
Promise\<AudioToAudioOutput[]>
inference/src/tasks/audio/audioToAudio.ts:38
▸ automaticSpeechRecognition(args, options?): Promise\<AutomaticSpeechRecognitionOutput>
This task reads some audio input and outputs the said words within the audio files. Recommended model (english language): facebook/wav2vec2-large-960h-lv60-self
| Name | Type |
|---|---|
args | AutomaticSpeechRecognitionArgs |
options? | Options |
Promise\<AutomaticSpeechRecognitionOutput>
inference/src/tasks/audio/automaticSpeechRecognition.ts:15
▸ chatCompletion(args, options?): Promise\<ChatCompletionOutput>
Use the chat completion endpoint to generate a response to a prompt, using OpenAI message completion API no stream
| Name | Type |
|---|---|
args | BaseArgs & ChatCompletionInput |
options? | Options |
Promise\<ChatCompletionOutput>
inference/src/tasks/nlp/chatCompletion.ts:9
▸ chatCompletionStream(args, options?): AsyncGenerator\<ChatCompletionStreamOutput>
Use to continue text from a prompt. Same as textGeneration but returns generator that can be read one token at a time
| Name | Type |
|---|---|
args | BaseArgs & ChatCompletionInput |
options? | Options |
AsyncGenerator\<ChatCompletionStreamOutput>
inference/src/tasks/nlp/chatCompletionStream.ts:8
▸ documentQuestionAnswering(args, options?): Promise\<DocumentQuestionAnsweringOutput[number]>
Answers a question on a document image. Recommended model: impira/layoutlm-document-qa.
| Name | Type |
|---|---|
args | DocumentQuestionAnsweringArgs |
options? | Options |
Promise\<DocumentQuestionAnsweringOutput[number]>
inference/src/tasks/multimodal/documentQuestionAnswering.ts:20
▸ featureExtraction(args, options?): Promise\<FeatureExtractionOutput>
This task reads some text and outputs raw float values, that are usually consumed as part of a semantic database/semantic search.
| Name | Type |
|---|---|
args | FeatureExtractionArgs |
options? | Options |
Promise\<FeatureExtractionOutput>
inference/src/tasks/nlp/featureExtraction.ts:16
▸ fillMask(args, options?): Promise\<FillMaskOutput>
Tries to fill in a hole with a missing word (token to be precise). That’s the base task for BERT models.
| Name | Type |
|---|---|
args | FillMaskArgs |
options? | Options |
Promise\<FillMaskOutput>
inference/src/tasks/nlp/fillMask.ts:11
▸ imageClassification(args, options?): Promise\<ImageClassificationOutput>
This task reads some image input and outputs the likelihood of classes. Recommended model: google/vit-base-patch16-224
| Name | Type |
|---|---|
args | ImageClassificationArgs |
options? | Options |
Promise\<ImageClassificationOutput>
inference/src/tasks/cv/imageClassification.ts:13
▸ imageSegmentation(args, options?): Promise\<ImageSegmentationOutput>
This task reads some image input and outputs the likelihood of classes & bounding boxes of detected objects. Recommended model: facebook/detr-resnet-50-panoptic
| Name | Type |
|---|---|
args | ImageSegmentationArgs |
options? | Options |
Promise\<ImageSegmentationOutput>
inference/src/tasks/cv/imageSegmentation.ts:13
▸ imageToImage(args, options?): Promise\<Blob>
This task reads some text input and outputs an image. Recommended model: lllyasviel/sd-controlnet-depth
| Name | Type |
|---|---|
args | ImageToImageArgs |
options? | Options |
Promise\<Blob>
inference/src/tasks/cv/imageToImage.ts:13
▸ imageToText(args, options?): Promise\<ImageToTextOutput>
This task reads some image input and outputs the text caption.
| Name | Type |
|---|---|
args | ImageToTextArgs |
options? | Options |
Promise\<ImageToTextOutput>
inference/src/tasks/cv/imageToText.ts:12
▸ objectDetection(args, options?): Promise\<ObjectDetectionOutput>
This task reads some image input and outputs the likelihood of classes & bounding boxes of detected objects. Recommended model: facebook/detr-resnet-50
| Name | Type |
|---|---|
args | ObjectDetectionArgs |
options? | Options |
Promise\<ObjectDetectionOutput>
inference/src/tasks/cv/objectDetection.ts:13
▸ questionAnswering(args, options?): Promise\<QuestionAnsweringOutput[number]>
Want to have a nice know-it-all bot that can answer any question?. Recommended model: deepset/roberta-base-squad2
| Name | Type |
|---|---|
args | QuestionAnsweringArgs |
options? | Options |
Promise\<QuestionAnsweringOutput[number]>
inference/src/tasks/nlp/questionAnswering.ts:11
▸ request\<T>(args, options?): Promise\<T>
Primitive to make custom calls to the inference provider
| Name |
|---|
T |
| Name | Type |
|---|---|
args | RequestArgs |
options? | Options & { chatCompletion?: boolean ; task?: InferenceTask } |
Promise\<T>
inference/src/tasks/custom/request.ts:7
▸ sentenceSimilarity(args, options?): Promise\<SentenceSimilarityOutput>
Calculate the semantic similarity between one text and a list of other sentences by comparing their embeddings.
| Name | Type |
|---|---|
args | SentenceSimilarityArgs |
options? | Options |
Promise\<SentenceSimilarityOutput>
inference/src/tasks/nlp/sentenceSimilarity.ts:12
▸ streamingRequest\<T>(args, options?): AsyncGenerator\<T>
Primitive to make custom inference calls that expect server-sent events, and returns the response through a generator
| Name |
|---|
T |
| Name | Type |
|---|---|
args | RequestArgs |
options? | Options & { chatCompletion?: boolean ; task?: InferenceTask } |
AsyncGenerator\<T>
inference/src/tasks/custom/streamingRequest.ts:9
▸ summarization(args, options?): Promise\<SummarizationOutput>
This task is well known to summarize longer text into shorter text. Be careful, some models have a maximum length of input. That means that the summary cannot handle full books for instance. Be careful when choosing your model.
| Name | Type |
|---|---|
args | SummarizationArgs |
options? | Options |
Promise\<SummarizationOutput>
inference/src/tasks/nlp/summarization.ts:11
▸ tableQuestionAnswering(args, options?): Promise\<TableQuestionAnsweringOutput[number]>
Don’t know SQL? Don’t want to dive into a large spreadsheet? Ask questions in plain english! Recommended model: google/tapas-base-finetuned-wtq.
| Name | Type |
|---|---|
args | TableQuestionAnsweringArgs |
options? | Options |
Promise\<TableQuestionAnsweringOutput[number]>
inference/src/tasks/nlp/tableQuestionAnswering.ts:11
▸ tabularClassification(args, options?): Promise\<TabularClassificationOutput>
Predicts target label for a given set of features in tabular form. Typically, you will want to train a classification model on your training data and use it with your new data of the same format. Example model: vvmnnnkv/wine-quality
| Name | Type |
|---|---|
args | TabularClassificationArgs |
options? | Options |
Promise\<TabularClassificationOutput>
inference/src/tasks/tabular/tabularClassification.ts:24
▸ tabularRegression(args, options?): Promise\<TabularRegressionOutput>
Predicts target value for a given set of features in tabular form. Typically, you will want to train a regression model on your training data and use it with your new data of the same format. Example model: scikit-learn/Fish-Weight
| Name | Type |
|---|---|
args | TabularRegressionArgs |
options? | Options |
Promise\<TabularRegressionOutput>
inference/src/tasks/tabular/tabularRegression.ts:24
▸ textClassification(args, options?): Promise\<TextClassificationOutput>
Usually used for sentiment-analysis this will output the likelihood of classes of an input. Recommended model: distilbert-base-uncased-finetuned-sst-2-english
| Name | Type |
|---|---|
args | TextClassificationArgs |
options? | Options |
Promise\<TextClassificationOutput>
inference/src/tasks/nlp/textClassification.ts:11
▸ textGeneration(args, options?): Promise\<TextGenerationOutput>
Use to continue text from a prompt. This is a very generic task. Recommended model: gpt2 (it’s a simple model, but fun to play with).
| Name | Type |
|---|---|
args | BaseArgs & TextGenerationInput |
options? | Options |
Promise\<TextGenerationOutput>
inference/src/tasks/nlp/textGeneration.ts:34
▸ textGenerationStream(args, options?): AsyncGenerator\<TextGenerationStreamOutput>
Use to continue text from a prompt. Same as textGeneration but returns generator that can be read one token at a time
| Name | Type |
|---|---|
args | BaseArgs & TextGenerationInput |
options? | Options |
AsyncGenerator\<TextGenerationStreamOutput>
inference/src/tasks/nlp/textGenerationStream.ts:88
▸ textToImage(args, options?): Promise\<string>
This task reads some text input and outputs an image. Recommended model: stabilityai/stable-diffusion-2
| Name | Type |
|---|---|
args | TextToImageArgs |
options? | TextToImageOptions & { outputType: "url" } |
Promise\<string>
inference/src/tasks/cv/textToImage.ts:50
▸ textToImage(args, options?): Promise\<Blob>
| Name | Type |
|---|---|
args | TextToImageArgs |
options? | TextToImageOptions & { outputType?: "blob" } |
Promise\<Blob>
inference/src/tasks/cv/textToImage.ts:54
▸ textToSpeech(args, options?): Promise\<Blob>
This task synthesize an audio of a voice pronouncing a given text. Recommended model: espnet/kan-bayashi_ljspeech_vits
| Name | Type |
|---|---|
args | TextToSpeechArgs |
options? | Options |
Promise\<Blob>
inference/src/tasks/audio/textToSpeech.ts:15
▸ textToVideo(args, options?): Promise\<TextToVideoOutput>
| Name | Type |
|---|---|
args | TextToVideoArgs |
options? | Options |
Promise\<TextToVideoOutput>
inference/src/tasks/cv/textToVideo.ts:25
▸ tokenClassification(args, options?): Promise\<TokenClassificationOutput>
Usually used for sentence parsing, either grammatical, or Named Entity Recognition (NER) to understand keywords contained within text. Recommended model: dbmdz/bert-large-cased-finetuned-conll03-english
| Name | Type |
|---|---|
args | TokenClassificationArgs |
options? | Options |
Promise\<TokenClassificationOutput>
inference/src/tasks/nlp/tokenClassification.ts:12
▸ translation(args, options?): Promise\<TranslationOutput>
This task is well known to translate text from one language to another. Recommended model: Helsinki-NLP/opus-mt-ru-en.
| Name | Type |
|---|---|
args | TranslationArgs |
options? | Options |
Promise\<TranslationOutput>
inference/src/tasks/nlp/translation.ts:10
▸ visualQuestionAnswering(args, options?): Promise\<VisualQuestionAnsweringOutput[number]>
Answers a question on an image. Recommended model: dandelin/vilt-b32-finetuned-vqa.
| Name | Type |
|---|---|
args | VisualQuestionAnsweringArgs |
options? | Options |
Promise\<VisualQuestionAnsweringOutput[number]>
inference/src/tasks/multimodal/visualQuestionAnswering.ts:18
▸ zeroShotClassification(args, options?): Promise\<ZeroShotClassificationOutput>
This task is super useful to try out classification with zero code, you simply pass a sentence/paragraph and the possible labels for that sentence, and you get a result. Recommended model: facebook/bart-large-mnli.
| Name | Type |
|---|---|
args | ZeroShotClassificationArgs |
options? | Options |
Promise\<ZeroShotClassificationOutput>
inference/src/tasks/nlp/zeroShotClassification.ts:12
▸ zeroShotImageClassification(args, options?): Promise\<ZeroShotImageClassificationOutput>
Classify an image to specified classes. Recommended model: openai/clip-vit-large-patch14-336
| Name | Type |
|---|---|
args | ZeroShotImageClassificationArgs |
options? | Options |
Promise\<ZeroShotImageClassificationOutput>
inference/src/tasks/cv/zeroShotImageClassification.ts:44
< > Update on GitHub