Huggingface Inference Tools

Configuration File: huggingface_inference_tools.json Tool Type: Local Tools Count: 10

This page contains all tools defined in the huggingface_inference_tools.json configuration file.

Available Tools

HFInference_classify_image (Type: HuggingFaceInferenceTool)

Run image-classification on any HuggingFace-hosted vision model (serverless hf-inference provider…

HFInference_classify_image tool specification

Tool Information:

  • Name: HFInference_classify_image

  • Type: HuggingFaceInferenceTool

  • Description: Run image-classification on any HuggingFace-hosted vision model (serverless hf-inference provider) and return the top predicted labels with confidence scores, sorted high to low. Supply the image as image_url (a public http(s) URL) OR image_path (a local file); the raw image bytes are POSTed with the correct content-type. Example model_id ‘google/vit-base-patch16-224’ classifies into 1000 ImageNet classes. Serverless image inference requires HF_TOKEN. Returns {top_label, labels:[{label,score}]}.

Parameters:

  • operation (unknown) (required) Operation selector (fixed).

  • model_id (string) (required) HuggingFace repo id of an image-classification model, e.g. ‘google/vit-base-patch16-224’ or ‘microsoft/resnet-50’.

  • image_url ([‘string’, ‘null’]) (optional) Public http(s) URL of the image to classify. Provide exactly one of image_url or image_path.

  • image_path ([‘string’, ‘null’]) (optional) Local filesystem path to the image to classify. Provide exactly one of image_url or image_path.

  • wait_for_model ([‘boolean’, ‘null’]) (optional) If true, send x-wait-for-model so the server blocks until a cold model finishes loading instead of returning 503. Default false.

Example Usage:

query = {
    "name": "HFInference_classify_image",
    "arguments": {
        "operation": "example_value",
        "model_id": "example_value"
    }
}
result = tu.run(query)

HFInference_classify_text (Type: HuggingFaceInferenceTool)

Run text-classification on any HuggingFace-hosted model (serverless hf-inference provider) and re…

HFInference_classify_text tool specification

Tool Information:

  • Name: HFInference_classify_text

  • Type: HuggingFaceInferenceTool

  • Description: Run text-classification on any HuggingFace-hosted model (serverless hf-inference provider) and return labels with confidence scores, sorted high to low. Good for sentiment, emotion, topic, NLI. Example model_id ‘distilbert/distilbert-base-uncased-finetuned-sst-2-english’ returns POSITIVE/NEGATIVE for a sentence. Optional HF_TOKEN env var raises rate limits. Returns {top_label, labels:[{label,score}]}.

Parameters:

  • operation (unknown) (required) Operation selector (fixed).

  • model_id (string) (required) HuggingFace repo id of a text-classification model, e.g. ‘distilbert/distilbert-base-uncased-finetuned-sst-2-english’ or ‘cardiffnlp/twitter-roberta-base-sentiment-latest’.

  • text (string) (required) Input text to classify.

  • wait_for_model ([‘boolean’, ‘null’]) (optional) If true, send x-wait-for-model so the server blocks until a cold model finishes loading instead of returning 503. Default false.

Example Usage:

query = {
    "name": "HFInference_classify_text",
    "arguments": {
        "operation": "example_value",
        "model_id": "example_value",
        "text": "example_value"
    }
}
result = tu.run(query)

HFInference_detect_objects (Type: HuggingFaceInferenceTool)

Run object-detection on any HuggingFace-hosted vision model (serverless hf-inference provider) an…

HFInference_detect_objects tool specification

Tool Information:

  • Name: HFInference_detect_objects

  • Type: HuggingFaceInferenceTool

  • Description: Run object-detection on any HuggingFace-hosted vision model (serverless hf-inference provider) and return the detected objects, each with a label, confidence score, and bounding box (xmin,ymin,xmax,ymax in pixels), sorted by score. Supply the image as image_url (a public http(s) URL) OR image_path (a local file); the raw image bytes are POSTed with the correct content-type. Example model_id ‘facebook/detr-resnet-50’. Serverless image inference requires HF_TOKEN. Returns {object_count, objects:[{label,score,box}]}.

Parameters:

  • operation (unknown) (required) Operation selector (fixed).

  • model_id (string) (required) HuggingFace repo id of an object-detection model, e.g. ‘facebook/detr-resnet-50’ or ‘facebook/detr-resnet-101’.

  • image_url ([‘string’, ‘null’]) (optional) Public http(s) URL of the image to run detection on. Provide exactly one of image_url or image_path.

  • image_path ([‘string’, ‘null’]) (optional) Local filesystem path to the image to run detection on. Provide exactly one of image_url or image_path.

  • wait_for_model ([‘boolean’, ‘null’]) (optional) If true, send x-wait-for-model so the server blocks until a cold model finishes loading instead of returning 503. Default false.

Example Usage:

query = {
    "name": "HFInference_detect_objects",
    "arguments": {
        "operation": "example_value",
        "model_id": "example_value"
    }
}
result = tu.run(query)

HFInference_embed_text (Type: HuggingFaceInferenceTool)

Generate a dense embedding vector for text using any HuggingFace feature-extraction model (server…

HFInference_embed_text tool specification

Tool Information:

  • Name: HFInference_embed_text

  • Type: HuggingFaceInferenceTool

  • Description: Generate a dense embedding vector for text using any HuggingFace feature-extraction model (serverless hf-inference provider). Forces the feature-extraction pipeline so sentence-transformers models return a raw vector (not a similarity score); token-level outputs are mean-pooled to one vector. Example model_id ‘sentence-transformers/all-MiniLM-L6-v2’ -> 384-dim embedding. Verified-live biomedical model_ids: NeuML/pubmedbert-base-embeddings and pritamdeka/S-PubMedBert-MS-MARCO (literature similarity), cambridgeltl/SapBERT-from-PubMedBERT-fulltext (entity normalization), facebook/esm2_t33_650M_UR50D (protein embeddings). Pass the canonical ‘org/name’ id, not a bare alias. Returns {dimension, embedding:[float], preview}. Optional HF_TOKEN raises rate limits.

Parameters:

  • operation (unknown) (required) Operation selector (fixed).

  • model_id (string) (required) HuggingFace repo id of an embedding / feature-extraction model, e.g. ‘sentence-transformers/all-MiniLM-L6-v2’ or ‘BAAI/bge-small-en-v1.5’.

  • text (string) (required) Input text to embed.

  • wait_for_model ([‘boolean’, ‘null’]) (optional) If true, send x-wait-for-model so the server blocks until a cold model finishes loading instead of returning 503. Default false.

Example Usage:

query = {
    "name": "HFInference_embed_text",
    "arguments": {
        "operation": "example_value",
        "model_id": "example_value",
        "text": "example_value"
    }
}
result = tu.run(query)

HFInference_fill_mask (Type: HuggingFaceInferenceTool)

Predict the most likely token(s) for a masked position using any HuggingFace fill-mask (masked-LM…

HFInference_fill_mask tool specification

Tool Information:

  • Name: HFInference_fill_mask

  • Type: HuggingFaceInferenceTool

  • Description: Predict the most likely token(s) for a masked position using any HuggingFace fill-mask (masked-LM) model, including protein language models. Input text must contain the model’s mask token: ‘[MASK]’ for BERT-family, ‘<mask>’ for RoBERTa/ESM. Example: ‘facebook/esm2_t6_8M_UR50D’ with ‘MQIF<mask>KTLTGKTITLEV’ ranks amino-acid tokens. Verified-live biomedical model_ids: protein LMs facebook/esm2_t33_650M_UR50D (or t30_150M/t12_35M/t6_8M), biomedical text dmis-lab/biobert-base-cased-v1.2, clinical emilyalsentzer/Bio_ClinicalBERT, genomic InstaDeepAI/nucleotide-transformer-500m-human-ref. For proper missense variant scoring (log-likelihood ratio) use ESM2_score_missense_variant, not raw fill-mask. Pass the canonical ‘org/name’ id (e.g. ‘google-bert/bert-base-uncased’), not a bare alias, or hf-inference returns HTTP 400. Returns {top_token, predictions:[{token_str,score,sequence}]}. Optional HF_TOKEN raises rate limits.

Parameters:

  • operation (unknown) (required) Operation selector (fixed).

  • model_id (string) (required) HuggingFace repo id of a fill-mask model, e.g. ‘google-bert/bert-base-uncased’ (uses [MASK]) or ‘facebook/esm2_t6_8M_UR50D’ (protein LM, uses <mask>).

  • text (string) (required) Input text containing exactly the model’s mask token ([MASK] for BERT, <mask> for RoBERTa/ESM).

  • top_k ([‘integer’, ‘null’]) (optional) Number of top candidate tokens to return (default model-dependent, typically 5).

  • wait_for_model ([‘boolean’, ‘null’]) (optional) If true, send x-wait-for-model so the server blocks until a cold model finishes loading instead of returning 503. Default false.

Example Usage:

query = {
    "name": "HFInference_fill_mask",
    "arguments": {
        "operation": "example_value",
        "model_id": "example_value",
        "text": "example_value"
    }
}
result = tu.run(query)

HFInference_ner (Type: HuggingFaceInferenceTool)

Extract named entities (people, locations, organizations, etc.) from text using any HuggingFace t…

HFInference_ner tool specification

Tool Information:

  • Name: HFInference_ner

  • Type: HuggingFaceInferenceTool

  • Description: Extract named entities (people, locations, organizations, etc.) from text using any HuggingFace token-classification / NER model (serverless hf-inference provider). Example model_id ‘dslim/bert-base-NER’ tags PER/LOC/ORG/MISC spans with confidence scores and character offsets. Verified-live biomedical NER model_ids: d4data/biomedical-ner-all (drugs/diseases/dosage/symptoms) and OpenMed/OpenMed-NER-DiseaseDetect-BioMed-335M (diseases). Pass the canonical ‘org/name’ id, not a bare alias. Optional HF_TOKEN raises rate limits. Returns {entity_count, entities:[{entity_group,word,score,start,end}]}.

Parameters:

  • operation (unknown) (required) Operation selector (fixed).

  • model_id (string) (required) HuggingFace repo id of a token-classification / NER model, e.g. ‘dslim/bert-base-NER’ or ‘Jean-Baptiste/roberta-large-ner-english’.

  • text (string) (required) Input text to extract named entities from.

  • wait_for_model ([‘boolean’, ‘null’]) (optional) If true, send x-wait-for-model so the server blocks until a cold model finishes loading instead of returning 503. Default false.

Example Usage:

query = {
    "name": "HFInference_ner",
    "arguments": {
        "operation": "example_value",
        "model_id": "example_value",
        "text": "example_value"
    }
}
result = tu.run(query)

HFInference_question_answering (Type: HuggingFaceInferenceTool)

Answer a question by extracting the relevant span from a supplied context passage, using any Hugg…

HFInference_question_answering tool specification

Tool Information:

  • Name: HFInference_question_answering

  • Type: HuggingFaceInferenceTool

  • Description: Answer a question by extracting the relevant span from a supplied context passage, using any HuggingFace extractive question-answering model (serverless hf-inference provider). Example model_id ‘deepset/roberta-base-squad2’. Requires both a question and a context. Optional HF_TOKEN raises rate limits. Returns {answer, score, start, end} where start/end are character offsets into the context.

Parameters:

  • operation (unknown) (required) Operation selector (fixed).

  • model_id (string) (required) HuggingFace repo id of an extractive QA model, e.g. ‘deepset/roberta-base-squad2’ or ‘distilbert/distilbert-base-cased-distilled-squad’.

  • question (string) (required) The question to answer.

  • context (string) (required) The context passage that contains the answer.

  • wait_for_model ([‘boolean’, ‘null’]) (optional) If true, send x-wait-for-model so the server blocks until a cold model finishes loading instead of returning 503. Default false.

Example Usage:

query = {
    "name": "HFInference_question_answering",
    "arguments": {
        "operation": "example_value",
        "model_id": "example_value",
        "question": "example_value",
        "context": "example_value"
    }
}
result = tu.run(query)

HFInference_summarize (Type: HuggingFaceInferenceTool)

Summarize a passage of text using any HuggingFace summarization model (serverless hf-inference pr…

HFInference_summarize tool specification

Tool Information:

  • Name: HFInference_summarize

  • Type: HuggingFaceInferenceTool

  • Description: Summarize a passage of text using any HuggingFace summarization model (serverless hf-inference provider). Example model_id ‘facebook/bart-large-cnn’ condenses an article into a few sentences. Optional max_length/min_length cap the summary length (in tokens). Optional HF_TOKEN env var raises rate limits. Returns {summary_text}.

Parameters:

  • operation (unknown) (required) Operation selector (fixed).

  • model_id (string) (required) HuggingFace repo id of a summarization model, e.g. ‘facebook/bart-large-cnn’ or ‘sshleifer/distilbart-cnn-12-6’.

  • text (string) (required) Input text / article to summarize.

  • max_length ([‘integer’, ‘null’]) (optional) Maximum length of the generated summary, in tokens (model-dependent default).

  • min_length ([‘integer’, ‘null’]) (optional) Minimum length of the generated summary, in tokens (model-dependent default).

  • wait_for_model ([‘boolean’, ‘null’]) (optional) If true, send x-wait-for-model so the server blocks until a cold model finishes loading instead of returning 503. Default false.

Example Usage:

query = {
    "name": "HFInference_summarize",
    "arguments": {
        "operation": "example_value",
        "model_id": "example_value",
        "text": "example_value"
    }
}
result = tu.run(query)

HFInference_translate (Type: HuggingFaceInferenceTool)

Translate text from one language to another using any HuggingFace translation model (serverless h…

HFInference_translate tool specification

Tool Information:

  • Name: HFInference_translate

  • Type: HuggingFaceInferenceTool

  • Description: Translate text from one language to another using any HuggingFace translation model (serverless hf-inference provider). The source/target languages are fixed by the chosen model_id; example ‘Helsinki-NLP/opus-mt-en-fr’ translates English to French. Optional HF_TOKEN raises rate limits. Returns {translation_text}.

Parameters:

  • operation (unknown) (required) Operation selector (fixed).

  • model_id (string) (required) HuggingFace repo id of a translation model whose name encodes the language pair, e.g. ‘Helsinki-NLP/opus-mt-en-fr’ (English->French) or ‘Helsinki-NLP/opus-mt-de-en’ (German->English).

  • text (string) (required) Input text to translate (in the model’s source language).

  • wait_for_model ([‘boolean’, ‘null’]) (optional) If true, send x-wait-for-model so the server blocks until a cold model finishes loading instead of returning 503. Default false.

Example Usage:

query = {
    "name": "HFInference_translate",
    "arguments": {
        "operation": "example_value",
        "model_id": "example_value",
        "text": "example_value"
    }
}
result = tu.run(query)

HFInference_zero_shot_classify (Type: HuggingFaceInferenceTool)

Classify text against a caller-supplied set of candidate labels using any HuggingFace zero-shot-c…

HFInference_zero_shot_classify tool specification

Tool Information:

  • Name: HFInference_zero_shot_classify

  • Type: HuggingFaceInferenceTool

  • Description: Classify text against a caller-supplied set of candidate labels using any HuggingFace zero-shot-classification (NLI) model, without task-specific training. Example model_id ‘facebook/bart-large-mnli’ scores each candidate_label by entailment. Pass candidate_labels as a list of strings. Optional multi_label allows independent per-label probabilities. Optional HF_TOKEN raises rate limits. Returns {top_label, labels:[{label,score}]} sorted high to low.

Parameters:

  • operation (unknown) (required) Operation selector (fixed).

  • model_id (string) (required) HuggingFace repo id of a zero-shot-classification / NLI model, e.g. ‘facebook/bart-large-mnli’ or ‘MoritzLaurer/mDeBERTa-v3-base-mnli-xnli’.

  • text (string) (required) Input text to classify.

  • candidate_labels (array) (required) Non-empty list of candidate label strings to score the text against, e.g. [‘refund’,’shipping’,’billing’].

  • multi_label ([‘boolean’, ‘null’]) (optional) If true, each label is scored independently (probabilities need not sum to 1). Default false (single best label).

  • wait_for_model ([‘boolean’, ‘null’]) (optional) If true, send x-wait-for-model so the server blocks until a cold model finishes loading instead of returning 503. Default false.

Example Usage:

query = {
    "name": "HFInference_zero_shot_classify",
    "arguments": {
        "operation": "example_value",
        "model_id": "example_value",
        "text": "example_value",
        "candidate_labels": ["item1", "item2"]
    }
}
result = tu.run(query)