Central registry of the default model used by each `huggingfaceR` inference function. Every `hf_*` function that takes a `model` argument resolves its default through this single function, so default models live in exactly one place and can be audited or updated without hunting through the codebase.
Arguments
- task
Character string naming the task, or `NULL`. One of: "chat", "generate", "fill_mask", "classify", "zero_shot", "embed", "summarize", "translate", "ner", "question_answer", "table_question_answer", "vision_chat", "transcribe", "text_to_speech", "text_to_image", "classify_image", "caption_image", "detect_objects". When `NULL` (the default), the full registry is returned as a tibble.
Value
When `task` is supplied, a single model-ID character string. When `task` is `NULL`, a tibble with columns `task` and `model` listing every default.
Details
Defaults are chosen to be **beginner-friendly**: broadly known, small and fast, low cost, and usable with no extra arguments — the goal is the quickest path to a working first call (think of `mtcars` in base R). Power users can always override any default by passing their own `model`.
Examples
# The default model for a given task
hf_default_model("translate")
#> [1] "Helsinki-NLP/opus-mt-en-fr"
# The whole registry at a glance
hf_default_model()
#> # A tibble: 18 × 2
#> task model
#> <chr> <chr>
#> 1 chat meta-llama/Llama-3.1-8B-Instruct
#> 2 generate meta-llama/Llama-3.1-8B-Instruct
#> 3 fill_mask google-bert/bert-base-uncased
#> 4 classify distilbert/distilbert-base-uncased-finetuned-sst-2-eng…
#> 5 zero_shot facebook/bart-large-mnli
#> 6 embed BAAI/bge-small-en-v1.5
#> 7 summarize facebook/bart-large-cnn
#> 8 translate Helsinki-NLP/opus-mt-en-fr
#> 9 ner dslim/bert-base-NER
#> 10 question_answer deepset/roberta-base-squad2
#> 11 table_question_answer google/tapas-base-finetuned-wtq
#> 12 vision_chat google/gemma-3-4b-it
#> 13 transcribe openai/whisper-large-v3
#> 14 text_to_speech facebook/mms-tts-eng
#> 15 text_to_image black-forest-labs/FLUX.1-schnell
#> 16 classify_image google/vit-base-patch16-224
#> 17 caption_image google/gemma-3-4b-it
#> 18 detect_objects facebook/detr-resnet-50