To use an embedding model from HuggingFace with Spice, specify the huggingface path in the from field of your configuration. The model and its related files will be automatically downloaded, loaded, and served locally by Spice.
The following parameters are specific to HuggingFace models:
| Parameter | Description | Default |
|---|---|---|
hf_token | The Huggingface access token. | - |
pooling | The pooling method (opens in a new tab) for embedding models. Supported values are cls, mean, splade, last_token | - |
Here is an example configuration in spicepod.yaml:
Supported models include:
Spice downloads the repository's safetensors weights. When a repository publishes none, it falls back to pytorch_model.bin and logs a warning at startup:
A repository that publishes neither format fails to load. Prefer a repository with safetensors weights where one is available.
With the same semantics as language models (opens in a new tab), spice can run private HuggingFace embedding models: