% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_llamacpp.R
\name{llamacpp_embedding}
\alias{llamacpp_embedding}
\title{Generate Embeddings Using a llama.cpp Server}
\usage{
llamacpp_embedding(
  .input,
  .model = "local-model",
  .server = Sys.getenv("LLAMACPP_SERVER", "http://localhost:8080"),
  .api_key = Sys.getenv("LLAMACPP_API_KEY", ""),
  .timeout = 120,
  .dry_run = FALSE,
  .max_tries = 3
)
}
\arguments{
\item{.input}{A character vector of texts to embed, or an \code{LLMMessage} object.}

\item{.model}{The model name (default: \code{"local-model"}). llama.cpp ignores this
and serves the loaded embedding model.}

\item{.server}{Base URL of the llama.cpp server. Defaults to the \code{LLAMACPP_SERVER}
environment variable, falling back to \code{"http://localhost:8080"}.}

\item{.api_key}{API key for the server (default: \code{LLAMACPP_API_KEY} env var).}

\item{.timeout}{Request timeout in seconds (default: 120).}

\item{.dry_run}{If TRUE, returns the request object without executing it (default: FALSE).}

\item{.max_tries}{Maximum retries (default: 3).}
}
\value{
A tibble with columns \code{input} (text) and \code{embeddings} (list of numeric vectors).
}
\description{
Sends text to the \verb{/v1/embeddings} endpoint of a running llama.cpp server
and returns embedding vectors.
}
