embedding
Function
This function is defined in the embed module.Generate embeddings for text using LiteLLM. This is the primary embedding function that supports all LiteLLM embedding providers (OpenAI, Azure, Cohere, Voyage, etc.).
Signature
Parameters
Text or list of texts to embed
Model name (e.g., “text-embedding-3-small”, “text-embedding-3-large”)
Optional output dimensions (for models that support it)
“float” or “base64”
Request timeout in seconds
Optional API key override
Optional API base URL override
Optional metadata for tracing **kwargs: Additional arguments passed to litellm.embedding()
Returns
EmbeddingResult with embeddings list, model, usage, and metadata

