nat.llm.huggingface_inference_llm#
Classes#
HuggingFace Inference API LLM provider for remote model inference. |
Functions#
|
Register HuggingFace Inference API as an LLM provider. |
Module Contents#
- class HuggingFaceInferenceLLMConfig(/, **data: Any)#
Bases:
nat.data_models.llm.LLMBaseConfig,nat.data_models.retry_mixin.RetryMixin,nat.data_models.optimizable.OptimizableMixin,nat.data_models.thinking_mixin.ThinkingMixinHuggingFace Inference API LLM provider for remote model inference.
Supports: - Serverless Inference API (default) - Dedicated Inference Endpoints (via endpoint_url) - Self-hosted TGI servers (via endpoint_url)
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- api_key: nat.data_models.common.OptionalSecretStr = None#
- async huggingface_inference_provider(
- config: HuggingFaceInferenceLLMConfig,
- _builder: nat.builder.builder.Builder,
Register HuggingFace Inference API as an LLM provider.