# LiteLLMEmbeddings

> **Class** in `langchain_litellm`

📖 [View in docs](https://reference.langchain.com/python/langchain-litellm/embeddings/litellm/LiteLLMEmbeddings)

LiteLLM embedding model.

Uses `litellm.embedding()` to support 100+ providers through a unified
interface. All provider configuration (api_key, api_base, etc.) can be
passed explicitly—no environment variables required.

## Signature

```python
LiteLLMEmbeddings()
```

## Description

**Example:**

.. code-block:: python

from langchain_litellm import LiteLLMEmbeddings

embeddings = LiteLLMEmbeddings(
    model="openai/text-embedding-3-small",
    api_key="sk-...",
)
vectors = embeddings.embed_documents(["hello", "world"])

For providers that distinguish document vs query embeddings (Cohere,
Voyage, Vertex AI, etc.), set ``document_input_type`` and
``query_input_type``:

    .. code-block:: python

        embeddings = LiteLLMEmbeddings(
            model="cohere/embed-english-v3.0",
            api_key="...",
            document_input_type="search_document",
            query_input_type="search_query",
        )

## Extends

- `BaseModel`
- `Embeddings`

## Properties

- `model`
- `api_key`
- `api_base`
- `api_version`
- `custom_llm_provider`
- `organization`
- `request_timeout`
- `max_retries`
- `extra_headers`
- `model_kwargs`
- `dimensions`
- `encoding_format`
- `document_input_type`
- `query_input_type`

## Methods

- [`embed_documents()`](https://reference.langchain.com/python/langchain-litellm/embeddings/litellm/LiteLLMEmbeddings/embed_documents)
- [`embed_query()`](https://reference.langchain.com/python/langchain-litellm/embeddings/litellm/LiteLLMEmbeddings/embed_query)
- [`aembed_documents()`](https://reference.langchain.com/python/langchain-litellm/embeddings/litellm/LiteLLMEmbeddings/aembed_documents)
- [`aembed_query()`](https://reference.langchain.com/python/langchain-litellm/embeddings/litellm/LiteLLMEmbeddings/aembed_query)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-litellm/blob/fddedd74fc6d400ff396ee48f40797f1b35fb002/langchain_litellm/embeddings/litellm.py#L28)