Skip to main content
Generate vector embeddings from any LLM provider through LiteLLM’s unified interface. Switch between OpenAI, Azure, AWS Bedrock, Google Vertex AI, and 100+ other providers by simply changing the model name.

Samples

Use OpenAI

Use Azure OpenAI

Embed with Azure OpenAI deployment:

Use AWS Bedrock

Embed with Amazon Titan:

Use Google Vertex AI

Embed with Vertex AI:

Batch embeddings

Process multiple texts efficiently:

Store embeddings in a table

Arguments

Returns

For single text input:
  • vector: A pgvector compatible vector containing the embedding
For array input:
  • TABLE(index INT, embedding vector): A table with an index and embedding for each input text

Provider-specific configuration

Different providers require different configurations through the extra_options parameter:

Azure OpenAI

AWS Bedrock

Google Vertex AI

See LiteLLM providers documentation for complete configuration options.