# Endpoints de Inferência

Inference Endpoints oferece uma solução de produção segura para implantar modelos com facilidade em uma infraestrutura dedicada e com escala automática gerenciada pela Hugging Face. Um Inference Endpoint é construído a partir de um modelo do [Hub](https://huggingface.co/models). Esta página é uma referência para a integração do `huggingface_hub` com o Inference Endpoints. Para mais informações sobre o produto Inference Endpoints, consulte sua [documentação oficial](https://huggingface.co/docs/inference-endpoints/index).

> [!TIP]
> Confira o [guia relacionado](../guides/inference_endpoints) para aprender a usar o `huggingface_hub` para gerenciar seus Inference Endpoints programaticamente.

Os Inference Endpoints podem ser totalmente gerenciados via API. Os endpoints são documentados com [Swagger](https://api.endpoints.huggingface.cloud/). A classe [InferenceEndpoint](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint) é um wrapper simples construído sobre essa API.

## Métodos

Um subconjunto dos recursos do Inference Endpoint é implementado em [HfApi](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi):

- [get_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.get_inference_endpoint) e [list_inference_endpoints()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.list_inference_endpoints) para obter informações sobre seus Inference Endpoints
- [list_inference_endpoints_hardware()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.list_inference_endpoints_hardware) para listar o hardware em que você pode implantar um Inference Endpoint
- [create_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.create_inference_endpoint), [update_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.update_inference_endpoint) e [delete_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.delete_inference_endpoint) para implantar e gerenciar Inference Endpoints
- [list_inference_catalog()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.list_inference_catalog) e [create_inference_endpoint_from_catalog()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.create_inference_endpoint_from_catalog) para navegar e implantar o Model Catalog curado
- [pause_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.pause_inference_endpoint) e [resume_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.resume_inference_endpoint) para pausar e retomar um Inference Endpoint
- [scale_to_zero_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.scale_to_zero_inference_endpoint) para escalar manualmente um Endpoint para 0 réplicas

## InferenceEndpoint[[huggingface_hub.InferenceEndpoint]]

A dataclass principal é [InferenceEndpoint](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint). Ela contém informações sobre um `InferenceEndpoint` implantado, incluindo sua configuração e estado atual. Uma vez implantado, você pode executar inferência no Endpoint usando as propriedades [InferenceEndpoint.client](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.client) e [InferenceEndpoint.async_client](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.async_client), que retornam, respectivamente, um objeto [InferenceClient](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_client#huggingface_hub.InferenceClient) e um objeto [AsyncInferenceClient](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_client#huggingface_hub.AsyncInferenceClient).

#### huggingface_hub.InferenceEndpoint[[huggingface_hub.InferenceEndpoint]]

```python
huggingface_hub.InferenceEndpoint(namespace: str, raw: dict, _token: str | bool | None, _api: HfApi)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L116)

**Parâmetros:**

name (`str`) : O nome exclusivo do Inference Endpoint.

namespace (`str`) : O namespace onde o Inference Endpoint está localizado.

repository (`str`) : O nome do repositório do modelo implantado neste Inference Endpoint.

status ([InferenceEndpointStatus](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointStatus)) : O status atual do Inference Endpoint.

url (`str`, *opcional*) : A URL do Inference Endpoint, se disponível. Apenas um Inference Endpoint implantado terá uma URL.

framework (`str`) : O framework de aprendizado de máquina usado para o modelo.

revision (`str`) : A revisão específica do modelo implantada no Inference Endpoint.

task (`str`) : A tarefa associada ao modelo implantado.

created_at (`datetime.datetime`) : O timestamp de quando o Inference Endpoint foi criado.

updated_at (`datetime.datetime`) : O timestamp da última atualização do Inference Endpoint.

type ([InferenceEndpointType](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointType)) : O tipo do Inference Endpoint (público, autenticado, privado).

raw (`dict`) : Os dados brutos do dicionário retornados pela API.

token (`str` ou `bool`, *opcional*) : Token de autenticação para o Inference Endpoint, se definido ao solicitar a API. Se não for fornecido, o token salvo localmente será usado por padrão. Passe `token=False` se você não quiser enviar seu token ao servidor.

Contém informações sobre um Inference Endpoint implantado.

Exemplo:
```python
>>> from huggingface_hub import get_inference_endpoint
>>> endpoint = get_inference_endpoint("my-text-to-image")
>>> endpoint
InferenceEndpoint(name='my-text-to-image', ...)

# Get status
>>> endpoint.status
'running'
>>> endpoint.url
'https://68a0f3b5c6ee5c9dcc0e0a01.endpoints.huggingface.cloud'

# Run inference
>>> endpoint.client.text_to_image(...)

# Pause endpoint to save $$$
>>> endpoint.pause()

# ...
# Resume and wait for deployment
>>> endpoint.resume()
>>> endpoint.wait()
>>> endpoint.client.text_to_image(...)
```

#### from_raw[[huggingface_hub.InferenceEndpoint.from_raw]]

```python
from_raw(raw: dict, namespace: str, token: str | bool | None = None, api: typing.Optional[ForwardRef('HfApi')] = None)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L199)

Inicializa o objeto a partir de um dicionário bruto.

#### client[[huggingface_hub.InferenceEndpoint.client]]

```python
client()
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L220)

**Retorna:** [InferenceClient](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_client#huggingface_hub.InferenceClient)

um cliente de inferência apontando para o endpoint implantado.

**Exceções:** [InferenceEndpointError](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError)

- [InferenceEndpointError](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError) -- Se o Inference Endpoint ainda não estiver implantado.

Retorna um cliente para fazer previsões neste Inference Endpoint.

#### async_client[[huggingface_hub.InferenceEndpoint.async_client]]

```python
async_client()
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L242)

**Retorna:** [AsyncInferenceClient](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_client#huggingface_hub.AsyncInferenceClient)

um cliente de inferência compatível com asyncio apontando para o endpoint implantado.

**Exceções:** [InferenceEndpointError](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError)

- [InferenceEndpointError](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError) -- Se o Inference Endpoint ainda não estiver implantado.

Retorna um cliente para fazer previsões neste Inference Endpoint.

#### excluir[[huggingface_hub.InferenceEndpoint.delete]]

```python
delete()
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L487)

Exclua o Inference Endpoint.

Esta operação não é reversível. Se você não deseja ser cobrado por um Inference Endpoint, é preferível pausá-lo com [InferenceEndpoint.pause()](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.pause) ou dimensioná-lo para zero com [InferenceEndpoint.scale_to_zero()](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.scale_to_zero).

Este é um alias para [HfApi.delete_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.delete_inference_endpoint).

#### fetch[[huggingface_hub.InferenceEndpoint.fetch]]

```python
fetch()
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L317)

**Retorna:** [InferenceEndpoint](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint)

o mesmo Inference Endpoint, mutado no local com os dados mais recentes.

Obtenha as informações mais recentes sobre o Inference Endpoint.

#### pausa[[huggingface_hub.InferenceEndpoint.pause]]

```python
pause()
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L430)

**Retorna:** [InferenceEndpoint](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint)

o mesmo Inference Endpoint, mutado no local com os dados mais recentes.

Pare o Inference Endpoint.

Um Inference Endpoint pausado não será cobrado. Ele pode ser retomado a qualquer momento usando [InferenceEndpoint.resume()](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.resume). Isso é diferente de escalar o Inference Endpoint para zero com [InferenceEndpoint.scale_to_zero()](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.scale_to_zero), o que resultaria em sua reinicialização automática quando uma solicitação fosse feita a ele.

Este é um alias para [HfApi.pause_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.pause_inference_endpoint). O objeto atual é mutado no local com os dados mais recentes do servidor.

#### retomar[[huggingface_hub.InferenceEndpoint.resume]]

```python
resume(running_ok: bool = True)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L448)

**Parâmetros:**

running_ok (`bool`, *opcional*) : Se `True`, o método não lançará um erro se o Inference Endpoint já estiver em execução. O valor padrão é `True`.

**Retorna:** [InferenceEndpoint](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint)

o mesmo Inference Endpoint, mutado no local com os dados mais recentes.

Resuma o Inference Endpoint.

Este é um alias para [HfApi.resume_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.resume_inference_endpoint). O objeto atual é mutado no local com os dados mais recentes do servidor.

#### scale_to_zero[[huggingface_hub.InferenceEndpoint.scale_to_zero]]

```python
scale_to_zero()
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L469)

**Retorna:** [InferenceEndpoint](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint)

o mesmo Inference Endpoint, mutado no local com os dados mais recentes.

Escale o Endpoint de Inferência para zero.

Um Inference Endpoint escalado para zero não será cobrado. Ele será retomado na próxima solicitação a ele, com um atraso de inicialização a frio. Isso é diferente de pausar o Inference Endpoint com [InferenceEndpoint.pause()](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.pause), o que exigiria uma retomada manual com [InferenceEndpoint.resume()](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.resume).

Este é um alias para [HfApi.scale_to_zero_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.scale_to_zero_inference_endpoint). O objeto atual é mutado no local com os dados mais recentes do servidor.

#### atualizar[[huggingface_hub.InferenceEndpoint.update]]

```python
update(accelerator: str | None = None, instance_size: str | None = None, instance_type: str | None = None, min_replica: int | None = None, max_replica: int | None = None, scale_to_zero_timeout: int | None = None, repository: str | None = None, framework: str | None = None, revision: str | None = None, task: str | None = None, custom_image: dict | None = None, container_command: list[str] | None = None, container_args: list[str] | None = None, tensor_parallel_size: int | None = None, data_parallel_size: int | None = None, secrets: dict[str, str] | None = None)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L328)

**Parâmetros:**

accelerator (`str`, *opcional*) : O acelerador de hardware a ser usado para inferência (por exemplo, `"cpu"`).

instance_size (`str`, *opcional*) : O tamanho ou o tipo da instância a ser usada para hospedar o modelo (por exemplo, `"x4"`).

instance_type (`str`, *opcional*) : O tipo de instância na nuvem onde o Inference Endpoint será implantado (por exemplo, `"intel-icl"`).

min_replica (`int`, *opcional*) : O número mínimo de réplicas (instâncias) a manter em execução para o Inference Endpoint.

max_replica (`int`, *opcional*) : O número máximo de réplicas (instâncias) para as quais o Inference Endpoint deve ser dimensionado.

scale_to_zero_timeout (`int`, *opcional*) : A duração, em minutos, antes de um endpoint inativo ser reduzido para zero.

repository (`str`, *opcional*) : O nome do repositório do modelo associado ao Inference Endpoint (por exemplo, `"gpt2"`).

framework (`str`, *opcional*) : O framework de aprendizado de máquina usado para o modelo (por exemplo, `"custom"`).

revision (`str`, *opcional*) : A revisão específica do modelo a ser implantada no Inference Endpoint (por exemplo, `"6c0e6080953db56375760c0471a8c5f2929baf11"`).

task (`str`, *opcional*) : A tarefa na qual o modelo será implantado (por exemplo, `"text-classification"`).

custom_image (`dict`, *opcional*) : A imagem de contêiner para executar. Pode ser um dicionário com chaves por variante de imagem (por exemplo, `{"vLLM": {"url": "vllm/vllm-openai:v0.23.0", "port": 8000}}`, também `sGLang`, `tgi`, `tei`, `llamacpp`, `hfServe`, ...), que é encaminhado como está, ou um dicionário simples descrevendo um contêiner personalizado (por exemplo, `{"url": ..., "port": ...}`), que é enviado como `{"custom": ...}`.

container_command (`list[str]`, *opcional*) : Substitui o comando de entrada do contêiner (corresponde a `model.command` no payload da API). Funciona tanto com imagens de engine gerenciadas (por exemplo, vLLM, SGLang) quanto com imagens personalizadas.

container_args (`list[str]`, *opcional*) : Argumentos adicionados ao entrypoint do container (corresponde a `model.args` no payload da API). Funciona tanto com imagens de engine gerenciadas (por exemplo, vLLM, SGLang) quanto com imagens personalizadas.

tensor_parallel_size (`int`, *opcional*) : Número de aceleradores para dividir uma única cópia do modelo entre eles (imagens vLLM e SGLang). Quando `custom_image` não é fornecido, a imagem atualmente configurada no endpoint é obtida e atualizada no local, pois a API requer `model.image` como um todo.

data_parallel_size (`int`, *opcional*) : Número de cópias do modelo a serem executadas, uma por acelerador (imagens do vLLM).

secrets (`dict[str, str]`, *opcional*) : Valores secretos para injetar no ambiente do contêiner.

**Retorna:** [InferenceEndpoint](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint)

o mesmo Inference Endpoint, mutado no local com os dados mais recentes.

Atualize o Inference Endpoint.

Este método permite a atualização da configuração de computação, do modelo implantado ou de ambos. Todos os argumentos são opcionais, mas pelo menos um deve ser fornecido.

Este é um alias para [HfApi.update_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.update_inference_endpoint). O objeto atual é mutado no local com os dados mais recentes do servidor.

#### aguarde[[huggingface_hub.InferenceEndpoint.wait]]

```python
wait(timeout: int | None = None, refresh_every: int = 5)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L264)

**Parâmetros:**

timeout (`int`, *opcional*) : O tempo máximo a ser aguardado para que o Inference Endpoint seja implantado, em segundos. Se `None`, aguardará indefinidamente.

refresh_every (`int`, *opcional*) : O tempo de espera entre cada consulta do status do Inference Endpoint, em segundos. O padrão é 5s.

**Retorna:** [InferenceEndpoint](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint)

o mesmo Inference Endpoint, mutado no local com os dados mais recentes.

**Exceções:** [InferenceEndpointError](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError) ou `InferenceEndpointTimeoutError`

- [InferenceEndpointError](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError) -- Se o Inference Endpoint terminou em um estado de falha.
- `InferenceEndpointTimeoutError` -- Se o Inference Endpoint não for implantado após `timeout` segundos.

Aguarde a implantação do Inference Endpoint.

As informações do servidor serão obtidas a cada 1s. Se o Inference Endpoint não for implantado após `timeout` segundos, um `InferenceEndpointTimeoutError` será lançado. O [InferenceEndpoint](/docs/huggingface_hub/v2.4.0/pt/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint) será modificado no local com os dados mais recentes.

## InferenceEndpointHardware[[huggingface_hub.InferenceEndpointHardware]]

#### huggingface_hub.InferenceEndpointHardware[[huggingface_hub.InferenceEndpointHardware]]

```python
huggingface_hub.InferenceEndpointHardware(id: str, vendor: str, region: str, accelerator: str, instance_type: str, instance_size: str, architecture: str, num_accelerators: int, num_cpus: int | None, memory_gb: float, gpu_memory_gb: int | None, price_per_hour: float, status: str, max_accelerators: int, used_accelerators: int)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L519)

**Parâmetros:**

id (`str`) : Identificador único de hardware, por exemplo, `"aws-us-east-1-nvidia-l4-x1"`.

vendor (`str`) : O provedor de nuvem que hospeda o hardware, por exemplo, `"aws"`.

region (`str`) : A região da nuvem em que o hardware está disponível, por exemplo, `"us-east-1"`.

accelerator (`str`) : O tipo de acelerador de hardware, por exemplo, `"cpu"`, `"gpu"` ou `"neuron"`.

instance_type (`str`) : O tipo de instância na nuvem, por exemplo, `"nvidia-l4"`.

instance_size (`str`) : O multiplicador do tamanho da instância, por exemplo, `"x1"`.

architecture (`str`) : Descrição de hardware legível por humanos, por exemplo, `"Nvidia L4"`.

num_accelerators (`int`) : Número de unidades de acelerador por réplica.

num_cpus (`int`, *opcional*) : Número de vCPUs por réplica.

memory_gb (`float`) : RAM por réplica, em GB.

gpu_memory_gb (`int`, *opcional*) : Memória total da GPU por réplica, em GB (ou seja, somada sobre `num_accelerators`). `None` para hardware não-GPU.

price_per_hour (`float`) : Custo por réplica por hora, em USD.

status (`str`) : Disponibilidade do hardware: `"available"`, `"low_availability"`, `"not_available"`, `"reserved"` ou `"deprecated"`.

max_accelerators (`int`) : Número máximo de aceleradores deste tipo que o namespace está autorizado a executar.

used_accelerators (`int`) : Número de aceleradores deste tipo atualmente usados pelo namespace.

Contém informações sobre uma configuração de hardware disponível para Inference Endpoints.

Os campos `vendor`, `region`, `accelerator`, `instance_type` e `instance_size` são exatamente os valores a serem passados para [create_inference_endpoint()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.create_inference_endpoint) (ou `hf endpoints deploy`) para implantar neste hardware.

Exemplo:
```python
>>> from huggingface_hub import list_inference_endpoints_hardware
>>> hardware = list_inference_endpoints_hardware()
>>> hardware[0]
InferenceEndpointHardware(id='aws-us-east-1-nvidia-l4-x1', vendor='aws', region='us-east-1', ...)
```

#### from_raw[[huggingface_hub.InferenceEndpointHardware.from_raw]]

```python
from_raw(raw: dict, vendor: str, region: str)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L584)

Inicializa um objeto a partir de um dicionário de computação bruto, aninhado sob um fornecedor e uma região na resposta da API.

## InferenceCatalogModel[[huggingface_hub.InferenceCatalogModel]]

#### huggingface_hub.InferenceCatalogModel[[huggingface_hub.InferenceCatalogModel]]

```python
huggingface_hub.InferenceCatalogModel(repo_id: str, name: str, author: str, license: str, task: str, created_at: datetime, recipes: list)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L647)

**Parâmetros:**

repo_id (`str`) : O id do repositório do modelo no Hub, por exemplo, `"meta-llama/Llama-3.1-8B-Instruct"`.

name (`str`) : O nome do modelo, ou seja, a parte de `repo_id` após o autor, por exemplo, `"Llama-3.1-8B-Instruct"`.

author (`str`) : O autor do repositório do modelo, por exemplo, `"meta-llama"`.

license (`str`) : A licença do modelo, por exemplo, `"Apache 2.0"`.

task (`str`) : A tarefa na qual o modelo é implantado, por exemplo, `"text-generation"`.

created_at (`datetime`) : A data em que o modelo foi adicionado ao catálogo.

recipes (`list[InferenceCatalogRecipe]`) : As formas testadas de implantar este modelo.

Contém informações sobre um modelo disponível no Inference Catalog.

Exemplo:
```python
>>> from huggingface_hub import list_inference_catalog
>>> catalog = list_inference_catalog(engine="vllm")
>>> catalog[0]
InferenceCatalogModel(repo_id='Qwen/Qwen2.5-Coder-7B-Instruct', name='Qwen2.5-Coder-7B-Instruct', ...)
```

#### from_raw[[huggingface_hub.InferenceCatalogModel.from_raw]]

```python
from_raw(raw: dict)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L684)

Inicializa um objeto a partir de um dicionário de item de catálogo bruto.

## InferenceCatalogRecipe[[huggingface_hub.InferenceCatalogRecipe]]

#### huggingface_hub.InferenceCatalogRecipe[[huggingface_hub.InferenceCatalogRecipe]]

```python
huggingface_hub.InferenceCatalogRecipe(id: str, accelerator: str, engine: str, gguf_file: str | None, revision: str | None)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L608)

**Parâmetros:**

id (`str`) : O id público da receita, para passar a [create_inference_endpoint_from_catalog()](/docs/huggingface_hub/v2.4.0/pt/package_reference/hf_api#huggingface_hub.HfApi.create_inference_endpoint_from_catalog) como `recipe_id`.

accelerator (`str`) : O tipo de acelerador de hardware no qual a receita é executada, por exemplo, `"cpu"`, `"gpu"` ou `"neuron"`.

engine (`str`) : O mecanismo de inferência que a receita executa, por exemplo, `"vllm"`, `"llamacpp"`, `"tei"` ou `"sglang"`.

gguf_file (`str`, *opcional*) : O arquivo GGUF implantado pela receita. Definido apenas para receitas `"llamacpp"`.

revision (`str`, *opcional*) : A revisão do modelo à qual a receita está fixada, se houver.

Contém informações sobre uma maneira pré-testada de implantar um modelo do Inference Catalog.

Uma receita é uma combinação de hardware e motor que a equipe de Inference Endpoints testou para um determinado modelo. Um modelo geralmente possui uma receita, mas pode ter várias (por exemplo, uma para GPU e outra para Neuron, ou uma para cada quantização GGUF).

#### from_raw[[huggingface_hub.InferenceCatalogRecipe.from_raw]]

```python
from_raw(raw: dict)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L634)

Inicialize o objeto a partir de um dicionário de receita bruto, aninhado sob um modelo na resposta da API.

## InferenceEndpointStatus[[huggingface_hub.InferenceEndpointStatus]]

#### huggingface_hub.InferenceEndpointStatus[[huggingface_hub.InferenceEndpointStatus]]

```python
huggingface_hub.InferenceEndpointStatus(value, names = None, module = None, qualname = None, type = None, start = 1)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L93)

Uma enumeração.

## InferenceEndpointType[[huggingface_hub.InferenceEndpointType]]

#### huggingface_hub.InferenceEndpointType[[huggingface_hub.InferenceEndpointType]]

```python
huggingface_hub.InferenceEndpointType(value, names = None, module = None, qualname = None, type = None, start = 1)
```

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/_inference_endpoints.py#L104)

Uma enumeração.

## InferenceEndpointError[[huggingface_hub.InferenceEndpointError]]

#### huggingface_hub.InferenceEndpointError[[huggingface_hub.InferenceEndpointError]]

[Fonte](https://github.com/huggingface/huggingface_hub/blob/v2.4.0/src/huggingface_hub/errors.py#L162)

Exceção genérica ao lidar com Inference Endpoints.

