# Getting the Hugging Face API Key

Before deploying the LLaMA model, you need to obtain an API key from Hugging Face. Follow these steps to get your API key.

{% hint style="info" %}
Make sure you already have an account on Hugging Face.
{% endhint %}

Go to the [Hugging Face](https://huggingface.co/login) website and enter the "Username/Email address" and "password" you use. Click the Login button to enter Hugging Face.

<figure><img src="/files/PXoBUwpqNRPP5h30ZC2G" alt=""><figcaption><p>Login Hugging Face</p></figcaption></figure>

After entering the Hugging Face page, press profile at the top right and select Access Token.

<figure><img src="/files/3jkAxaGmxRg3Lin6rDOH" alt=""><figcaption><p>Access Token</p></figcaption></figure>

On the Access Tokens page press the "+ Create new token" button.

<figure><img src="/files/lXEEOQ0gW5J0fDFHF2uT" alt=""><figcaption><p>Create New Token</p></figcaption></figure>

In this guide, the token type used is Write, enter the token name. Click the **Create Token** button to create a new token for Hugging Face.

<figure><img src="/files/xC8dOheeT1kHVwmZ2qts" alt=""><figcaption><p>Create Token</p></figcaption></figure>

Once you have generated the token, save it securely. You will need it to authenticate your requests to Hugging Face models.

<figure><img src="/files/hu9OUdUGzzn53cjOhFu7" alt=""><figcaption><p>Token</p></figcaption></figure>

## Encoding the Hugging Face API Token to Base64

To convert your Hugging Face API token into a text format represented by Base64 characters. You can run the following syntax according to the operating system your computer uses.

### Linux

On computers using the Linux operating system, you can follow the following steps. Open a terminal on your computer. Run the following command to encode your Hugging Face token to base64.

```bash
echo -n 'your-hugging-face-token' | base64
```

Replace `your-hugging-face-token` with your actual Hugging Face token. The command will output the base64-encoded token.

```bash
aGZfQUZiV0phb2RTR1RqUXhReENQUXhRekV5c1VIenp4d1hNWA==
```

### Windows

On computers using the Windows operating system, use PowerShell. Open PowerShell on your computer.

<figure><img src="/files/3MmaK89Ywpja3XZXYPcF" alt="" width="375"><figcaption><p>Open Powershell</p></figcaption></figure>

Use the following command to encode your token using Base64 in PowerShell.

```bash
[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("your-hugging-face-token"))
```

<figure><img src="/files/cXR9qW5AOR79CC1bYIww" alt=""><figcaption><p>Encode Token</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudeka.ai/reference/deployment-llama-3.1-70b-with-vllm-on-kubernetes/getting-the-hugging-face-api-key.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
