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

ParameterTypeDescriptionDefault
idstrThe model ID to use for embeddings"intfloat/multilingual-e5-large"
dimensionsOptional[int]Expected vector width; metadata only, not sent to the provider and does not resize output1536
api_keyOptional[str]Huggingface API keyEnvironment variable HUGGINGFACE_API_KEY
client_paramsOptional[Dict[str, Any]]Additional parameters for client initializationNone
huggingface_clientOptional[InferenceClient]Pre-configured Huggingface clientNone
async_clientOptional[AsyncInferenceClient]Pre-configured async Huggingface clientNone
enable_batchboolHas no effect. Batch embedding is unsupported and the flag is reset to FalseFalse
batch_sizeintNumber of texts per batch. Unused by this embedder100

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.