Skip to contents

huggingfaceR 2.1.0

New features

Improvements

  • Centralized default models. A new exported helper, hf_default_model(), is the single source of truth for every task’s default model. All hf_* functions now resolve their model default through it (no behavior change — the resolved values are identical), so defaults can be audited or updated in one place. Call hf_default_model() to see the whole registry, or hf_default_model("translate") for a single task’s default.

  • hf_whoami() now returns billing/pro status and token-role metadata so users can check whether their token is read-only or write-capable before Hub write operations.

  • Beginner-friendly default translation model. hf_translate() now defaults to Helsinki-NLP/opus-mt-en-fr (English to French) instead of facebook/nllb-200-distilled-600M. The Helsinki-NLP opus-mt-* family encodes the translation direction in the model ID, so hf_translate("Hello") works with no FLORES-200 language codes — a smoother first experience. NLLB remains fully supported for multilingual translation via the model, source, and target arguments.

  • Unified request engine with inference-provider routing. Internal request construction is consolidated in R/request.R (hf_parse_model(), hf_inference_url(), hf_error_body(), hf_is_transient(), hf_task_request()). As a result, the model = "id:provider" suffix now selects an inference provider for all serverless tasks — including embeddings, classification, and the new text tasks — not just chat. Retries now back off only on genuinely transient status codes (429/5xx), and error messages are consistent across every inference function.

huggingfaceR 2.0.0

Breaking changes

  • The package no longer requires Python or reticulate for core functionality. All inference is handled through the Hugging Face Inference API via httr2. Legacy functions that depend on Python/reticulate remain available but are not required for new workflows.

  • Default chat and generation model changed from HuggingFaceTB/SmolLM3-3B to meta-llama/Llama-3.1-8B-Instruct, which has broader provider support.

New features

Improvements

  • All functions return tibbles and accept character vectors, enabling natural composition with dplyr, tidyr, and the rest of the tidyverse.

  • Improved error messages for 404 responses explain that the model may exist on the Hub but not be available for serverless inference, and suggest using hf_check_inference().

  • Documentation updated to clarify that the Inference API serves a curated subset of the Hub’s 500,000+ models, not all of them.