embed
Computes the embedding of text on a dedicated embedding context (created on first use, separate from the generation session, so embeddings never disturb it). The vector is pooled with LlamaContextConfig.embeddingPooling (for causal LMs usually the last token's hidden state).
Parameters
normalize
L2-normalize the vector (unit length), e.g. for cosine similarity.
Throws
if text is empty or longer than LlamaContextConfig.embeddingContextLength tokens.