% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/llama.R
\name{llama_set_causal_attn}
\alias{llama_set_causal_attn}
\title{Set causal attention mode}
\usage{
llama_set_causal_attn(ctx, causal)
}
\arguments{
\item{ctx}{Context handle returned by [llama_new_context]}

\item{causal}{Logical; \code{TRUE} for causal (autoregressive) attention,
\code{FALSE} for full bidirectional attention}
}
\value{
No return value, called for side effects.
}
\description{
When disabled, the model uses full (bidirectional) attention.
This is useful for embedding models.
}
\examples{
\dontrun{
model <- llama_load_model("model.gguf")
ctx <- llama_new_context(model)
llama_set_causal_attn(ctx, FALSE)  # for embeddings
}
}
