Skip to contents

Authentication

Set up and verify your Hugging Face API token.

hf_set_token()
Set Hugging Face API Token
hf_whoami()
Get Current Hugging Face User Information

Text Classification

Classify text using pre-trained models or custom label sets.

hf_classify()
Text Classification
hf_classify_zero_shot()
Zero-Shot Classification

Text Tasks

Summarize, translate, extract entities, and answer questions over text and tables.

hf_summarize()
Summarize Text
hf_translate()
Translate Text
hf_ner()
Named Entity Recognition (Token Classification)
hf_question_answer()
Extractive Question Answering
hf_table_question_answer()
Table Question Answering

Embeddings and Similarity

Generate vector representations and measure semantic relatedness.

hf_embed()
Generate Text Embeddings
hf_similarity()
Compute Pairwise Similarity
hf_embed_umap()
Dimensionality Reduction with UMAP

Tidytext Integration

Embed, search, cluster, and extract topics from data frames.

hf_embed_text()
Embed Text with Tidytext Compatibility
hf_nearest_neighbors()
Find Nearest Neighbors by Semantic Similarity
hf_cluster_texts()
Cluster Texts by Semantic Similarity
hf_extract_topics()
Extract Semantic Topics from Text

Batch Processing

Process large datasets with parallel requests and disk checkpointing.

hf_embed_batch()
Batch Embedding Generation (In-Memory)
hf_embed_chunks()
Chunked Embedding Generation (Disk Checkpoints)
hf_classify_batch()
Batch Text Classification (In-Memory)
hf_classify_chunks()
Chunked Text Classification (Disk Checkpoints)
hf_classify_zero_shot_batch()
Batch Zero-Shot Classification (In-Memory)
hf_read_chunks()
Read All Chunks from Directory

Chat and Conversations

Interact with open-source language models, tools, streaming, and vision.

hf_chat()
LLM Chat Interface
hf_tool()
Define a Chat Tool
hf_run_tools()
Run Tool Calls in a Conversation
hf_describe_image()
Describe an Image
hf_conversation()
Multi-turn Conversation
chat()
Continue a Conversation

Structured Output & Tools

Extract typed fields and connect model tool calls to R functions.

hf_extract()
Extract Structured Data from Text
hf_tool()
Define a Chat Tool
hf_run_tools()
Run Tool Calls in a Conversation

Text Generation

Generate and complete text with language models.

hf_generate()
Text Generation
hf_fill_mask()
Fill Mask

Multimodal Inference

Transcribe audio, generate images, and analyze image collections.

hf_transcribe()
Transcribe Audio
hf_text_to_image()
Generate an Image from Text
hf_text_to_speech()
Convert Text to Speech
hf_classify_image()
Classify Images
hf_caption_image()
Caption Images
hf_detect_objects()
Detect Objects in Images

Hub Discovery

Search Hub assets, inspect providers, download files, and manage repositories.

hf_default_model()
Default Models for Hugging Face Tasks
hf_search_models()
Search Models on Hugging Face Hub
hf_search_spaces()
Search Spaces on Hugging Face Hub
hf_search_papers()
Search Papers on Hugging Face
hf_model_info()
Get Model Information
hf_check_inference()
Check Inference API Availability
hf_list_providers()
List Inference Providers for a Model
hf_list_repo_files()
List Files in a Hub Repository
hf_hub_download()
Download a File from the Hub
hf_create_repo()
Create a Hub Repository
hf_upload_file()
Upload a File to a Hub Repository
hf_push_dataset()
Push a Data Frame as a Dataset File
hf_delete_repo()
Delete a Hub Repository
hf_list_tasks()
List Available Tasks
hf_search_datasets()
Search Datasets on Hugging Face Hub
hf_dataset_info()
Get Dataset Information

Datasets

Load dataset rows from the Hub into tibbles.

hf_load_dataset()
Load Dataset via Hugging Face Datasets Server API

Tidymodels

Use embeddings as features in tidymodels recipes.

Legacy Functions

Functions from earlier versions. These may require Python/reticulate.

hf_ez_conversational()
Create a Conversational Agent
hf_ez_conversational_api_inference()
Conversational API Inference
hf_ez_conversational_local_inference()
Conversational Local Inference
hf_ez_fill_mask()
Perform Fill-in-the-Blank Tasks
hf_ez_fill_mask_api_inference()
Fill Mask API Inference
hf_ez_fill_mask_local_inference()
Fill Mask Local Inference
hf_ez_question_answering()
Answer Questions about a Text based on Context
hf_ez_question_answering_api_inference()
Question Answering API Inference
hf_ez_question_answering_local_inference()
Question Answering Local Inference
hf_ez_sentence_similarity()
Compare Sentence Similarity Semantically
hf_ez_sentence_similarity_api_inference()
Sentence Similarity API Inference
hf_ez_sentence_similarity_local_inference()
Sentence Similarity Local Inference
hf_ez_summarization()
Summarize a Text
hf_ez_summarization_api_inference()
Summarization API Inference
hf_ez_summarization_local_inference()
Summarization Local Inference
hf_ez_table_question_answering()
Answer Questions about a Data Table
hf_ez_table_question_answering_api_inference()
Table Question Answering API Inference
hf_ez_table_question_answering_local_inference()
Table Question Answering Local Inference
hf_ez_text2text_generation()
Answer General Questions
hf_ez_text2text_generation_api_inference()
Text2Text Generation API Inference
hf_ez_text2text_generation_local_inference()
Text2Text Generation Local Inference
hf_ez_text_classification()
Classify Texts into Pre-trained Categories
hf_ez_text_classification_api_inference()
Text Classification API Inference
hf_ez_text_classification_local_inference()
Text Classification Local Inference
hf_ez_text_generation()
Generate Text from a Prompt
hf_ez_text_generation_api_inference()
Text Generation API Inference
hf_ez_text_generation_local_inference()
Text Generation Local Inference
hf_ez_token_classification()
Classify parts of a Text
hf_ez_token_classification_api_inference()
Token Classification API Inference
hf_ez_token_classification_local_inference()
Token Classification Local Inference
hf_ez_translation()
Translate between Languages
hf_ez_translation_api_inference()
Translation API Inference
hf_ez_translation_local_inference()
Translation Local Inference
hf_ez_zero_shot_classification()
Perform Text Classification with No Context Required
hf_ez_zero_shot_classification_api_inference()
Zero Shot Classification API Inference
hf_ez_zero_shot_classification_local_inference()
Zero Shot Classification Local Inference
hf_load_tokenizer()
Load an AutoTokenizer from a pre-tained model
hf_load_model()
Load a pre-trained AutoModel object from Hugging Face
hf_load_AutoModel_for_task()
Import a pre-trained AutoModel object for a specific task.
hf_load_pipeline()
Load a pipeline object from Hugging Face - pipelines usually include a model, tokenizer and task.
hf_load_sentence_model()
Load a Sentence Transformers model to extract sentence/document embeddings
hf_list_authors()
List Authors
hf_list_datasets()
List Datasets
hf_list_languages()
List Languages
hf_list_libraries()
List Libraries
hf_list_licenses()
List Licenses
hf_list_models()
List Models
hf_inference()
Inference using a downloaded Hugging Face model or pipeline, or using the Inference API
hf_sentence_encode()
Use a Sentence Transformers pipeline to extract document(s)/sentence(s) embedding(s)
hf_set_device()
Try to set device to GPU for accelerated computation
hf_python_depends()
Install Python Dependencies
hf_fill_mask_payload()
Fill Mask Task Payload
hf_question_answering_payload()
Question Answering Payload
hf_sentence_similarity_payload()
Sentence Similarity Payload
hf_summarization_payload()
Summarization Task Payload
hf_table_question_answering_payload()
Table Question Answering Payload
hf_text2text_generation_payload()
Text2Text Generation Payload
hf_text_classification_payload()
Text Classification Payload
hf_text_generation_payload()
Text Generation Payload
hf_token_classification_payload()
Token Classification Payload
hf_translation_payload()
Translation Payload
hf_zero_shot_classification_payload()
Zero Shot Classification Payload
models_with_downloads
Dataset of model names, tasks & download info
`%>%`
Pipe operator