Represents a configured HuggingFace Inference client.
Holds the access token and default options that are merged with per-call options.
Creating a client
client = HuggingfaceClient.Client.new("hf_your_token")
# With defaults
client = HuggingfaceClient.Client.new("hf_your_token",
provider: "groq",
bill_to: "my-org"
)Using with an inference endpoint
client = HuggingfaceClient.Client.endpoint(
"hf_token",
"https://xyz.eu-west-1.aws.endpoints.huggingface.cloud/gpt2"
)Option schema
| Option | Type | Description |
|---|---|---|
:provider | string | Default provider (e.g. "groq", "together") |
:bill_to | string | HF organisation to bill the request to |
:endpoint_url | string | Custom endpoint URL (overrides provider routing) |
:retry_on_503 | boolean | Auto-retry on 503 responses (default: true) |
:req_opts | keyword | Extra options forwarded to Req |
Summary
Functions
Creates a Client tied to a specific inference endpoint URL.
Merges client defaults with per-call options.
Creates a new Client with the given access token and options.
Validates and returns the NimbleOptions schema for documentation.
Types
Functions
Creates a Client tied to a specific inference endpoint URL.
Equivalent to calling client.endpoint(url) in the JS package.
Merges client defaults with per-call options.
Per-call options always take precedence.
Creates a new Client with the given access token and options.
Raises InputError if options are invalid.
@spec options_schema() :: NimbleOptions.t()
Validates and returns the NimbleOptions schema for documentation.