To use a model hosted on HuggingFace, specify the huggingface.co path in the from field and, when needed, the files to include.
fromThe from key takes the form of huggingface:model_path. Below shows 2 common example of from key configuration.
huggingface:username/modelname: Implies the latest version of modelname hosted by username.huggingface:huggingface.co/username/modelname:revision: Specifies a particular revision of modelname by username, including the optional domain.The from key follows the following regex format.
The from key consists of five components:
huggingface:.huggingface.co/ immediately after the prefix. Currently no other Huggingface compatible services are supported.org)./, the model name (model).:) followed by the git-like revision identifier (revision).nameThe model name. This will be used as the model ID within Spice and Spice's endpoints (i.e. http://localhost:8090/v1/models). This can be set to the same value as the model ID in the from field.
params| Param | Description | Default |
|---|---|---|
huggingface_token | The Huggingface access token. Spelled huggingface_token on this release line — see the note under Access Tokens (opens in a new tab). | - |
model_type | The architecture to load the model as. Supported text architectures: mistral, gemma, mixtral, llama, phi2, phi3, qwen2, gemma2, starcoder2, phi3.5moe, deepseekv2, deepseekv3, qwen3, glm4, glm4moelite, glm4moe, qwen3moe, smollm3, granitemoehybrid, gpt_oss, qwen3next. Supported multimodal architectures: phi3v, idefics2, llava_next, llava, vllama, qwen2vl, idefics3, minicpmo, phi4mm, qwen2_5vl, gemma3, mistral3, llama4, gemma3n, gemma4, qwen3vl, qwen3vlmoe, qwen3_5, qwen3_5moe, voxtral. | - |
tools | Which [tools] should be made available to the model. Set to auto to use all available tools. | - |
system_prompt | An additional system prompt used for all chat completions to this model. | - |
filesThe specific file path for Huggingface model. For example, GGUF model formats require a specific file path, other varieties (e.g. .safetensors) are inferred.
:::warning[huggingface_token on v2.2.0 and v2.2.1]
On this release line the parameter is spelled huggingface_token. hf_token is rejected: the runtime drops it with
and loads the model anonymously, so a gated or private repository fails with an HTTP 401 that names no cause. A bare token is rejected too, with a warning that it must be prefixed with huggingface_. This affects from: huggingface: models only — the hf_token documented for embeddings (opens in a new tab) and rerankers is read correctly on this release.
Spelling reverted in v2.3.0: hf_token is the parameter again, and huggingface_token is kept as an alias so a Spicepod written against v2.2.x keeps loading. See spiceai/spiceai#13932 (opens in a new tab).
:::
Access tokens can be provided for Huggingface models in two ways:
~/.cache/huggingface/token). Default.For more details on authentication, see access tokens (opens in a new tab).
:::warning[Limitations]
:::