# SelfHostedHuggingFaceEmbeddings

> **Class** in `langchain_community`

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

HuggingFace embedding 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
SelfHostedHuggingFaceEmbeddings(
    self,
    **kwargs: Any = {},
)
```

## Description

**Example:**

.. code-block:: python

from langchain_community.embeddings import SelfHostedHuggingFaceEmbeddings
import runhouse as rh
model_id = "sentence-transformers/all-mpnet-base-v2"
gpu = rh.cluster(name="rh-a10x", instance_type="A100:1")
hf = SelfHostedHuggingFaceEmbeddings(model_id=model_id, hardware=gpu)

## Extends

- `SelfHostedEmbeddings`

## Constructors

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


## Properties

- `client`
- `model_id`
- `model_reqs`
- `hardware`
- `model_load_fn`
- `load_fn_kwargs`
- `inference_fn`

---

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