# Model2vecEmbeddings

> **Class** in `langchain_community`

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

Model2Vec embedding models.

Install model2vec first, run 'pip install -U model2vec'.
The github repository for model2vec is : https://github.com/MinishLab/model2vec

## Signature

```python
Model2vecEmbeddings(
    self,
    model: str,
)
```

## Description

**Example:**

.. code-block:: python

from langchain_community.embeddings import Model2vecEmbeddings

embedding = Model2vecEmbeddings("minishlab/potion-base-8M")
embedding.embed_documents([
    "It's dangerous to go alone!",
    "It's a secret to everybody.",
])
embedding.embed_query(
    "Take this with you."
)

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `model` | `str` | Yes | Model name. |

## Extends

- `Embeddings`

## Constructors

```python
__init__(
    self,
    model: str,
)
```

| Name | Type |
|------|------|
| `model` | `str` |


## Methods

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

---

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