Skip to main content
Use LiteLLM to generate embeddings from models across multiple providers with a unified interface. LiteLLM supports OpenAI, Azure, AWS Bedrock, Google Vertex AI, Hugging Face, and 100+ other providers. You use this function to:
  • Define the embedding model to use (from any supported provider)
  • Specify the dimensionality of the embeddings
  • Configure optional, provider-specific parameters
  • Set the name of the environment variable that holds your API key

Samples

Hugging Face model

Azure OpenAI

AWS Bedrock

Arguments

Returns

A JSON configuration object for use in create_vectorizer().

Supported providers

LiteLLM supports 100+ providers including:
  • OpenAI and Azure OpenAI
  • AWS Bedrock
  • Google Vertex AI
  • Hugging Face
  • Cohere
  • Anthropic
  • And many more
See the LiteLLM documentation for the complete list.