feat: add Hugging Face as a first-class inference provider#1171
Open
davanstrien wants to merge 2 commits intoNousResearch:mainfrom
Open
feat: add Hugging Face as a first-class inference provider#1171davanstrien wants to merge 2 commits intoNousResearch:mainfrom
davanstrien wants to merge 2 commits intoNousResearch:mainfrom
Conversation
davanstrien
commented
Mar 13, 2026
| ), | ||
| "huggingface": ProviderConfig( | ||
| id="huggingface", | ||
| name="Hugging Face", |
Author
There was a problem hiding this comment.
maybe HuggingFace Inference Providers
Register Hugging Face Inference Providers (https://router.huggingface.co/v1) as a named provider alongside existing ones like Z.AI, Kimi, and MiniMax. Users can now: - `hermes chat --provider huggingface` - Use `hf:model-name` syntax (e.g. `hf:Qwen/Qwen3-235B-A22B-Thinking-2507`) - Set HF_TOKEN in ~/.hermes/.env - Select from 18 curated models via `hermes model` picker Curated model list sourced from models.dev. Users can also type any model name manually — it validates against the live /v1/models endpoint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ce5223f to
f0a24cf
Compare
Author
|
cc @hanouticelina @Wauplin for viz |
Per feedback from @Wauplin — HUGGING_FACE_HUB_TOKEN is outdated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
teknium1
pushed a commit
that referenced
this pull request
Mar 17, 2026
Register Hugging Face Inference Providers (router.huggingface.co/v1) as a named provider alongside existing ones. Users can now: - hermes chat --provider huggingface - Use hf:model-name syntax (e.g. hf:Qwen/Qwen3-235B-A22B-Thinking-2507) - Set HF_TOKEN in ~/.hermes/.env - Select from 18 curated models via hermes model picker OpenAI-compatible endpoint with automatic failover across providers (Groq, Together, SambaNova, etc.), free tier included. Files changed: - hermes_cli/auth.py: ProviderConfig + aliases (hf, hugging-face, huggingface-hub) - hermes_cli/models.py: _PROVIDER_MODELS, _PROVIDER_LABELS, _PROVIDER_ALIASES, _PROVIDER_ORDER - hermes_cli/main.py: provider_labels, providers list, --provider choices, dispatch - hermes_cli/setup.py: provider_choices, setup flow with token prompt - hermes_cli/config.py: HF_TOKEN + HF_BASE_URL in OPTIONAL_ENV_VARS - agent/model_metadata.py: context window entries for all curated HF models - .env.example: HF_TOKEN documentation Based on PR #1171 by @davanstrien. Salvaged onto current main with additional completeness: setup.py flow, config.py env vars, auth.py aliases, model_metadata context windows, .env.example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Register Hugging Face Inference Providers (
https://router.huggingface.co/v1) as a named provider alongside existing ones like Z.AI, Kimi, and MiniMax.Users can now:
hermes chat --provider huggingfacehf:model-namesyntax (e.g.hf:Qwen/Qwen3-235B-A22B-Thinking-2507)HF_TOKENin~/.hermes/.envhermes modelpickerCurated model list sourced from models.dev. Users can also type any model name manually — it validates against the live
/v1/modelsendpoint (120+ models available).Type of Change
Changes Made
hermes_cli/auth.py— AddedhuggingfacetoPROVIDER_REGISTRYwithHF_TOKEN/HUGGING_FACE_HUB_TOKENenv vars andhttps://router.huggingface.co/v1base URLhermes_cli/models.py— Added curated model list (from models.dev), label,hfalias, and provider order entryhermes_cli/main.py— Added HF to provider menu, dispatch,--providerCLI choices, and curated model picker listHow to Test
HF_TOKENin~/.hermes/.env(get one at https://huggingface.co/settings/tokens)hermes model, select "Hugging Face Inference Providers"Qwen/Qwen3-235B-A22B-Thinking-2507)Or directly:
hermes chat --provider huggingface --model Qwen/Qwen3-235B-A22B-Thinking-2507Tested locally
validate_requested_model()accepts curated models against live APIrouter.huggingface.co/v1Checklist
Code
pytest tests/ -qand all tests passDocumentation & Housekeeping
cli-config.yaml.exampleif I added/changed config keys — can addHF_TOKENexampleOnce merged, we'll add Hermes Agent to the HF Inference Providers integrations page as well.