Hugging Face
Parameters for HuggingfaceCustomEmbedder, which embeds documents through Hugging Face's InferenceClient.
HuggingfaceCustomEmbedder calls Hugging Face's InferenceClient. Choose a model available through a feature-extraction provider, or configure a compatible deployed endpoint; a Hub repository alone does not guarantee hosted inference.
Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
id | str | The model ID to use for embeddings | "intfloat/multilingual-e5-large" |
dimensions | Optional[int] | Expected vector width; metadata only, not sent to the provider and does not resize output | 1536 |
api_key | Optional[str] | Huggingface API key | Environment variable HUGGINGFACE_API_KEY |
client_params | Optional[Dict[str, Any]] | Additional parameters for client initialization | None |
huggingface_client | Optional[InferenceClient] | Pre-configured Huggingface client | None |
async_client | Optional[AsyncInferenceClient] | Pre-configured async Huggingface client | None |
enable_batch | bool | Has no effect. Batch embedding is unsupported and the flag is reset to False | False |
batch_size | int | Number of texts per batch. Unused by this embedder | 100 |
The inherited dimensions default is 1536, but the default multilingual-e5-large model produces 1,024-dimensional vectors. Set dimensions=1024 when using that model so vector-store configuration matches its output. For another model, set its actual output width.