> ## Documentation Index
> Fetch the complete documentation index at: https://llm-tools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Hugging Face

Hugging face needs no introduction. They host a variety of open source LLMs and you can use most of them for free. To run hugging face inference based LLMs with this library, you will need a free hugging face token.

You can get an API Token by signing up for hugging face and generate a token from [this page](https://huggingface.co/settings/tokens). Once you get the token, set it to the environment like so -

```bash theme={null}
HUGGINGFACEHUB_API_KEY="<Your hf key>"
```

## Install Huggingface addon

```bash theme={null}
npm install @llm-tools/embedjs-huggingface
```

## Usage

```ts theme={null}
import { RAGApplicationBuilder } from '@llm-tools/embedjs';
import { HuggingFace } from '@llm-tools/embedjs-huggingface';

const app = await new RAGApplicationBuilder()
.setModel(new HuggingFace({ modelName: "..." }))
```
