> For the complete documentation index, see [llms.txt](https://docs.skydeck.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.skydeck.ai/da/integrations/llms-and-databases/huggingface-integration.md).

# HuggingFace Integration

Efter at have implementeret din inferens-endpoint på HuggingFace, bør du se følgende brugergrænseflade:

<figure><img src="/files/d6YQVYmwpBfEqaCGmAxG" alt="huggingface deploy interface"><figcaption></figcaption></figure>

På denne side skal du bruge følgende information:

* Endpoint URL
* Model Repository
* API-token. Du kan se dette ved at tjekke boksen "Add API token" i Call Examples kodeblok.

Udover disse skal du også bruge kontekstvinduet for din model. Dette kan findes på modellens informationsside.

Efter at have indsamlet disse oplysninger, skal du formatere dem til JSON som vist i eksemplet nedenfor:

```json
{
    "api_key":"your_api_key",
    "endpoint": "your_api_endpoint",
    "model_name": "meta-llama/Llama-2-7b-chat-hf",
    "context_window": 4096
}
```

Næste skridt er at indsætte dette i Credential-feltet for din integration.

<figure><img src="/files/awV2DD5KaSaMllYKVx7V" alt="credential field"><figcaption></figcaption></figure>

Når credentialet er blevet valideret med succes, bør du se din HuggingFace-model opført i GenStudio's modeliste:

<figure><img src="/files/ZqS9gCecc2ituZuTBEcO" alt="huggingface model as genstudio model"><figcaption></figcaption></figure>

### Skalering af HuggingFace Endpoints til Zero

Skalering til 0 er en dynamisk funktion, der tilbydes af Inference Endpoints, designet til at optimere ressourceudnyttelse og omkostninger. Ved intelligent at overvåge anmodningsmønstre og reducere antallet af replikaer til ingen i inaktive perioder, sikrer det, at du kun bruger ressourcer, når det er nødvendigt.

Dog introducerer dette en kold startperiode, når trafikken genoptages, og der er nogle overvejelser, man skal være opmærksom på. For en dybdegående gennemgang af, hvordan denne funktion fungerer, dens fordele og potentielle udfordringer, henvises der til [HuggingFace's guide til Autoscaling](https://huggingface.co/docs/inference-endpoints/autoscaling).

### Understøttede modeller

I øjeblikket understøtter vi kun slutpunkter for modeller med et `text-generation` tag, der er implementeret som `text-generation-inference` containere. Vi arbejder på at udvide vores liste over understøttede modeller.

<figure><img src="/files/v4kqmfjDXqT4d8Cxt2wg" alt="image (48)"><figcaption><p>LLaMA 2 er en model med Text Generation tag</p></figcaption></figure>

<figure><img src="/files/ESgnMUNXkRwn79Q9Vizy" alt="image (49)"><figcaption><p>Sørg for at vælge Text Generation Inference som container type under implementeringen</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.skydeck.ai/da/integrations/llms-and-databases/huggingface-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
