| Property | Value |
|---|---|
| Provider id | huggingface |
| Plugin | bundled (enabled by default, no install step) |
| Auth env var | HUGGINGFACE_HUB_TOKEN or HF_TOKEN (fine-grained token) |
| API | OpenAI-compatible (https://router.huggingface.co/v1) |
| Billing | Single HF token; pricing follows provider rates with a free tier |
Getting started
Create a fine-grained token
Go to Hugging Face Settings Tokens and create a new fine-grained token.
Select a default model
In the Default Hugging Face model dropdown, pick a model. The list loads from the Inference API when your token is valid; otherwise OpenClaw shows the built-in catalog below. Your choice is saved as
agents.defaults.model.primary:Non-interactive setup
huggingface/deepseek-ai/DeepSeek-R1 as the default model.
Model IDs
Model refs use the formhuggingface/<org>/<model> (Hub-style IDs). OpenClaw’s built-in catalog:
| Model | Ref (prefix with huggingface/) |
|---|---|
| DeepSeek R1 | deepseek-ai/DeepSeek-R1 |
| DeepSeek V3.1 | deepseek-ai/DeepSeek-V3.1 |
| GPT-OSS 120B | openai/gpt-oss-120b |
| Llama 3.3 70B Instruct Turbo | meta-llama/Llama-3.3-70B-Instruct-Turbo |
Advanced configuration
Model discovery and onboarding dropdown
Model discovery and onboarding dropdown
OpenClaw discovers models with:The response is OpenAI-style:
{ "object": "list", "data": [ { "id": "Qwen/Qwen3-8B", "owned_by": "Qwen", ... }, ... ] }.With a configured key (onboarding, HUGGINGFACE_HUB_TOKEN, or HF_TOKEN), the Default Hugging Face model dropdown during interactive setup is populated from this endpoint. Gateway startup repeats the same call to refresh the catalog. Discovered models are merged with the built-in catalog above (used for metadata like context window and cost when an id matches). If the request fails, returns no data, or no key is set, OpenClaw falls back to the built-in catalog only.Disable discovery without removing the provider:Model names, aliases, and policy suffixes
Model names, aliases, and policy suffixes
- Name from API: discovered models use the API’s
name,title, ordisplay_namewhen present; otherwise OpenClaw derives a name from the model id (e.g.deepseek-ai/DeepSeek-R1becomes “DeepSeek R1”). - Override display name: set a custom label per model in config:
- Policy suffixes:
:fastestand:cheapestare HF router conventions, not something OpenClaw rewrites: the suffix is sent verbatim as part of the model id and HF’s router picks the matching inference provider. Add each variant as its own entry undermodels.providers.huggingface.models(or inmodel.primary) if you want a distinct alias per suffix. - Config merge: existing entries in
models.providers.huggingface.models(e.g. inmodels.json) are kept on config merge, so any customname,alias, or model options you set there persist across restarts.
Environment and daemon setup
Environment and daemon setup
If the Gateway runs as a daemon (launchd/systemd), make sure
HUGGINGFACE_HUB_TOKEN or HF_TOKEN is available to that process (for example, in ~/.openclaw/.env or via env.shellEnv).OpenClaw accepts both
HUGGINGFACE_HUB_TOKEN and HF_TOKEN. If both are set, HUGGINGFACE_HUB_TOKEN takes precedence.Config: DeepSeek R1 with fallback
Config: DeepSeek R1 with fallback
Config: DeepSeek with cheapest and fastest variants
Config: DeepSeek with cheapest and fastest variants
Config: DeepSeek + Llama + GPT-OSS with aliases
Config: DeepSeek + Llama + GPT-OSS with aliases
Related
Model selection
Overview of all providers, model refs, and failover behavior.
Model selection
How to choose and configure models.
Inference Providers docs
Official Hugging Face Inference Providers documentation.
Configuration
Full config reference.