# OllamaEmbeddings

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/embeddings/ollama/OllamaEmbeddings)

Ollama locally runs large language models.

To use, follow the instructions at https://ollama.ai/.

## Signature

```python
OllamaEmbeddings()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.embeddings import OllamaEmbeddings
ollama_emb = OllamaEmbeddings(
    model="llama:7b",
)
r1 = ollama_emb.embed_documents(
    [
        "Alpha is the first letter of Greek alphabet",
        "Beta is the second letter of Greek alphabet",
    ]
)
r2 = ollama_emb.embed_query(
    "What is the second letter of Greek alphabet"
)

## Extends

- `BaseModel`
- `Embeddings`

## Properties

- `base_url`
- `model`
- `embed_instruction`
- `query_instruction`
- `mirostat`
- `mirostat_eta`
- `mirostat_tau`
- `num_ctx`
- `num_gpu`
- `num_thread`
- `repeat_last_n`
- `repeat_penalty`
- `temperature`
- `stop`
- `tfs_z`
- `top_k`
- `top_p`
- `show_progress`
- `headers`
- `model_kwargs`
- `model_config`

## Methods

- [`embed_documents()`](https://reference.langchain.com/python/langchain-community/embeddings/ollama/OllamaEmbeddings/embed_documents)
- [`embed_query()`](https://reference.langchain.com/python/langchain-community/embeddings/ollama/OllamaEmbeddings/embed_query)

## ⚠️ Deprecated

Deprecated since version 0.3.1.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/embeddings/ollama.py#L12)