feat: add Hugging Face as a first-class inference provider#1747
Open
feat: add Hugging Face as a first-class inference provider#1747
Conversation
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.
- quickstart.md: add to provider table - configuration.md: add to provider table, add dedicated section with usage examples, config.yaml snippet, routing suffixes, and token info; also fix pre-existing duplicate Alibaba Cloud entry - environment-variables.md: add HF_TOKEN + HF_BASE_URL, add huggingface to HERMES_INFERENCE_PROVIDER values - fallback-providers.md: add to supported providers table and auto-detection chain
f3b6c9d to
11c926c
Compare
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.
Summary
Salvage of PR #1171 by @davanstrien onto current main.
Registers Hugging Face Inference Providers (
router.huggingface.co/v1) as a named provider. Users can now:hermes chat --provider huggingfacehf:model-namesyntax (e.g.hf:Qwen/Qwen3-235B-A22B-Thinking-2507)HF_TOKENin~/.hermes/.envhermes modelpickerOpenAI-compatible endpoint with automatic failover across providers (Groq, Together, SambaNova, etc.), free tier included ($0.10/month, no markup).
Changes vs original PR #1171
The original PR touched 3 files (auth.py, models.py, main.py). This salvage adds the missing integration points required by our current provider checklist:
hermes_cli/auth.pyhermes_cli/models.pyhermes_cli/main.pyhermes_cli/setup.pyhermes_cli/config.pyagent/model_metadata.py.env.exampleHow to test
HF_TOKENin~/.hermes/.env(get one at https://huggingface.co/settings/tokens)hermes model, select "Hugging Face Inference Providers"Or directly:
hermes chat --provider huggingface --model Qwen/Qwen3-235B-A22B-Thinking-2507Test results
5081 passed, 32 failed (all pre-existing on main), 164 skipped. Zero regressions introduced.
Attribution
Contributor commit preserved with original authorship. Closes #1171.