% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/unload.R
\name{lms_unload}
\alias{lms_unload}
\title{Unload a model from memory via REST API}
\usage{
lms_unload(model, host = "http://localhost:1234", ...)
}
\arguments{
\item{model}{Character. Unique identifier (\code{instance_id}) of the model
instance to unload.}

\item{host}{Character. The host address of the local server. Defaults to
"http://localhost:1234".}

\item{...}{Additional arguments passed to the API request body.}
}
\value{
Invisibly returns a character string representing the unloaded
\code{instance_id} upon success.
}
\description{
Unload a model from memory via REST API
}
\note{
If you have loaded multiple instances of the same model using
\code{force = TRUE} in \code{lms_load()}, the server assigns them unique
instance identifiers (e.g., \code{"google/gemma-3-1b"} and
\code{"google/gemma-3-1b:2"}). Passing the base model name to
\code{lms_unload()} will only unload the primary instance. To unload
duplicate instances, you must provide their exact \code{instance_id}, or
use \code{lms_unload_all()} to clear everything.
}
\examples{
\dontrun{
lms_server_start()
lms_download("google/gemma-3-1b")
lms_load("google/gemma-3-1b")

# Unload a single specific model
lms_unload("google/gemma-3-1b")
}
}
\seealso{
\href{https://lmstudio.ai/docs/developer/rest/unload}{LM Studio Unload Model API}
}
