Inference Endpoints provides a secure production solution to easily deploy models on a dedicated and autoscaling infrastructure managed by Hugging Face. An Inference Endpoint…
Inference Endpoints
Inference Endpoints provides a secure production solution to easily deploy models on a dedicated and autoscaling infrastructure managed by Hugging Face. An Inference Endpoint is built from a model from the Hub. This page is a reference for huggingface_hub's integration with Inference Endpoints. For more information about the Inference Endpoints product, check out its official documentation.
Tip Check out the related guide to learn how to use
huggingface_hubto manage your Inference Endpoints programmatically.
Inference Endpoints can be fully managed via API. The endpoints are documented with Swagger. The InferenceEndpoint class is a simple wrapper built on top on this API.
Methods
A subset of the Inference Endpoint features are implemented in HfApi:
get_inference_endpointandlist_inference_endpointsto get information about your Inference Endpointslist_inference_endpoints_hardwareto list the hardware you can deploy an Inference Endpoint oncreate_inference_endpoint,update_inference_endpointanddelete_inference_endpointto deploy and manage Inference Endpointslist_inference_catalogandcreate_inference_endpoint_from_catalogto browse and deploy the curated Model Catalogpause_inference_endpointandresume_inference_endpointto pause and resume an Inference Endpointscale_to_zero_inference_endpointto manually scale an Endpoint to 0 replicas
InferenceEndpoint
The main dataclass is InferenceEndpoint. It contains information about a deployed InferenceEndpoint, including its configuration and current state. Once deployed, you can run inference on the Endpoint using the InferenceEndpoint.client and InferenceEndpoint.async_client properties that respectively return an InferenceClient and an AsyncInferenceClient object.
[[autodoc]] InferenceEndpoint
- from_raw
- client
- async_client
- all
InferenceEndpointHardware
[[autodoc]] InferenceEndpointHardware
InferenceCatalogModel
[[autodoc]] InferenceCatalogModel
InferenceCatalogRecipe
[[autodoc]] InferenceCatalogRecipe
InferenceEndpointStatus
[[autodoc]] InferenceEndpointStatus
InferenceEndpointType
[[autodoc]] InferenceEndpointType
InferenceEndpointError
[[autodoc]] InferenceEndpointError
Source and license
Source: Hub Python Library documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.