Skip to content

chore: improve huggingface provider support - #2322

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.0from
backryun:release/v3.8.0
May 17, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.0from
backryun:release/v3.8.0

Conversation

@backryun

Copy link
Copy Markdown
Contributor

Summary

  • Updated the HuggingFace provider to use the current Hugging Face router OpenAI-compatible chat endpoint.
  • Added HuggingFace /v1/models discovery support so “Import from /models” fetches chat models from the Hugging Face router instead of falling back to unrelated local audio models.
  • Refreshed HuggingFace ASR/TTS model catalog entries.

Validation

  • npm run lint
  • npm run test:unit
  • npm run test:coverage
  • Coverage is still >= 60% for statements, lines, functions, and branches
  • SonarQube PR analysis is green or any remaining issues are explicitly documented below

Validation performed:

  • npx prettier --write open-sse/config/audioRegistry.ts open-sse/config/providerRegistry.ts 'src/app/api/providers/[id]/models/route.ts'
  • node --import tsx/esm -e "await import('./open-sse/config/audioRegistry.ts'); await import('./open-sse/config/providerRegistry.ts'); console.log('changed registry imports ok')"
  • Commit hook passed prettier, eslint --fix, docs sync, any-budget, env/docs sync, CLI i18n, and UI i18n coverage checks.
  • npm run typecheck:core -- --pretty false was attempted but failed on existing open-sse/services/contextManager.ts never type errors unrelated to this change.

Tests Added Or Updated

  • No automated test files changed.

Coverage Notes

  • This PR changes open-sse/ provider registry data and a provider model-discovery route under src/.
  • No production logic tests were added; validation was manual/runtime-oriented around registry importability and the dashboard “Import from /models” behavior.
  • Coverage was not re-run, so no coverage movement was measured.

Reviewer Notes

  • HuggingFace chat now targets https://router.huggingface.co/v1/chat/completions.
  • HuggingFace model import now targets https://router.huggingface.co/v1/models.
  • HuggingFace audio ASR/TTS remains on the separate HF Inference task API path, which is distinct from the OpenAI-compatible chat router.

@backryun
backryun requested a review from diegosouzapw as a code owner May 17, 2026 05:55
@backryun

backryun commented May 17, 2026 •

Copy link
Copy Markdown
Contributor Author

The existing huggingface configuration was completely incorrect, and we confirmed that it works very well after modification.
Some model lists were reconfigured to include only supported models by manually querying them via the API.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the HuggingFace provider configuration to support dynamic model discovery and refreshes the audio registry with newer ASR and TTS models. Feedback suggests retaining a few 'seed' models in the configuration to provide a fallback if remote discovery fails and highlights the need for automated tests to comply with the repository's style guide for production code changes.

Comment thread open-sse/config/providerRegistry.ts Resolved
@backryun
backryun changed the base branch from release/v3.8.0 to main May 17, 2026 06:30
@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.8.0 May 17, 2026 22:36
@diegosouzapw
diegosouzapw merged commit 1f27c34 into cheaper-inference:release/v3.8.0 May 17, 2026
1 of 2 checks passed
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Obrigado @backryun pela contribuição! 🙌

O fix do HuggingFace foi integrado na release/v3.8.0. A migração para router.huggingface.co/v1/chat/completions com discovery dinâmico de modelos via /v1/models é uma melhoria significativa — agora os usuários podem importar modelos diretamente em vez de depender de uma lista estática desatualizada.

Este fix estará no OmniRoute v3.8.0. 🚀

HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
Integrated into release/v3.8.0 — migrates HuggingFace to router.huggingface.co/v1 endpoint, adds dynamic model discovery, refreshes ASR/TTS catalog
Poid-ZA pushed a commit to Poid-ZA/OmniRoute that referenced this pull request Aug 5, 2026
Integrated into release/v3.8.0 — migrates HuggingFace to router.huggingface.co/v1 endpoint, adds dynamic model discovery, refreshes ASR/TTS catalog
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
Integrated into release/v3.8.0 — migrates HuggingFace to router.huggingface.co/v1 endpoint, adds dynamic model discovery, refreshes ASR/TTS catalog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants