# SelfHostedHuggingFaceInstructEmbeddings

> **Class** in `langchain_community`

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

HuggingFace InstructEmbedding models on self-hosted remote hardware.

Supported hardware includes auto-launched instances on AWS, GCP, Azure,
and Lambda, as well as servers specified
by IP address and SSH credentials (such as on-prem, or another
cloud like Paperspace, Coreweave, etc.).

To use, you should have the ``runhouse`` python package installed.

## Signature

```python
SelfHostedHuggingFaceInstructEmbeddings(
    self,
    **kwargs: Any = {},
)
```

## Description

**Example:**

.. code-block:: python

from langchain_community.embeddings import SelfHostedHuggingFaceInstructEmbeddings
import runhouse as rh
model_name = "hkunlp/instructor-large"
gpu = rh.cluster(name='rh-a10x', instance_type='A100:1')
hf = SelfHostedHuggingFaceInstructEmbeddings(
    model_name=model_name, hardware=gpu)

## Extends

- `SelfHostedHuggingFaceEmbeddings`

## Constructors

```python
__init__(
    self,
    **kwargs: Any = {},
)
```


## Properties

- `model_id`
- `embed_instruction`
- `query_instruction`
- `model_reqs`

## Methods

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

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/embeddings/self_hosted_hugging_face.py#L102)