% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hf.R
\name{llama_hf_download}
\alias{llama_hf_download}
\title{Download a GGUF model from Hugging Face}
\usage{
llama_hf_download(
  repo_id,
  filename = NULL,
  pattern = NULL,
  tag = NULL,
  token = NULL,
  cache_dir = NULL,
  revision = "main",
  force = FALSE
)
}
\arguments{
\item{repo_id}{Character. Hugging Face repository in \code{"org/repo"} format.}

\item{filename}{Character or \code{NULL}. Exact filename to download.}

\item{pattern}{Character or \code{NULL}. Glob pattern for filename matching
(case-insensitive). If multiple files match, an error is thrown listing
the matches.}

\item{tag}{Character or \code{NULL}. Ollama-style tag. First tries the
Ollama manifest API; on failure, falls back to pattern matching
with \code{*\{tag\}*}.}

\item{token}{Character or \code{NULL}. Hugging Face API token.
If \code{NULL}, uses the \code{HF_TOKEN} environment variable.}

\item{cache_dir}{Character or \code{NULL}. Custom cache directory.
Defaults to \code{\link{llama_hf_cache_dir}()}.}

\item{revision}{Character. Git revision (branch/tag/commit). Defaults to
\code{"main"}.}

\item{force}{Logical. If \code{TRUE}, re-download even if cached.
Defaults to \code{FALSE}.}
}
\value{
A character string containing the absolute path to the downloaded
  (or cached) GGUF model file.
}
\description{
Downloads a GGUF model file from a Hugging Face repository. Files are
cached locally so subsequent calls return the cached path without
re-downloading.
}
\details{
Exactly one of \code{filename}, \code{pattern}, or \code{tag} must be
specified to identify which file to download.
}
\examples{
\dontrun{
path <- llama_hf_download("TheBloke/Llama-2-7B-GGUF",
                          pattern = "*q2_k*")
print(path)
}
}
