Skip to content

feat: add HuggingFace provider support #6127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Jul 23, 2025

This PR adds support for HuggingFace as an AI provider in Roo Code.

Summary

Implements HuggingFace provider integration as requested in #6124. This allows users to use HuggingFace models through their OpenAI-compatible API endpoint.

Changes

  • Added HuggingFace to provider types and schemas
  • Implemented HuggingFace API handler using OpenAI-compatible format
  • Created HuggingFace models service for dynamic model fetching from HuggingFace API
  • Added webview message handlers for HuggingFace model requests
  • Created HuggingFace UI component with model selection and inference provider options
  • Updated ApiOptions to include HuggingFace provider
  • Added translations for HuggingFace provider

Features

  • Dynamic model fetching from HuggingFace API with caching
  • Support for both text-generation and image-text-to-text models
  • Inference provider selection (auto, SambaNova, Fireworks, Together AI, etc.)
  • OpenAI-compatible API integration through HuggingFace router endpoint

Testing

  • Linting passes
  • Type checking passes
  • Provider tests pass
  • Webview component tests pass

Closes #6124

Co-authored-by: TGlide tglide@users.noreply.github.com


Important

Adds HuggingFace provider support, enabling model interaction via an OpenAI-compatible API, with UI updates for model selection and configuration.

  • Behavior:
    • Adds HuggingFace as a provider in provider-settings.ts and providers/index.ts.
    • Implements HuggingFaceHandler in huggingface.ts for API interaction.
    • Supports text-generation and image-text-to-text models.
  • API:
    • Adds getHuggingFaceModels() in huggingface-models.ts for model fetching.
    • Updates webviewMessageHandler.ts to handle requestHuggingFaceModels messages.
  • UI:
    • Adds HuggingFace component in HuggingFace.tsx for model and provider selection.
    • Updates ApiOptions.tsx to include HuggingFace in provider options.
    • Adds translations for HuggingFace in settings.json.

This description was created by Ellipsis for 6f3921f. You can customize this summary. It will automatically update as commits are pushed.

- Add HuggingFace to provider types and schemas
- Implement HuggingFace API handler using OpenAI-compatible format
- Create HuggingFace models service for dynamic model fetching
- Add webview message handlers for HuggingFace model requests
- Create HuggingFace UI component with model selection
- Update ApiOptions to include HuggingFace provider
- Add translations for HuggingFace provider

Implements #6124
@roomote roomote bot requested review from mrubens, cte and jr as code owners July 23, 2025 16:33
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Jul 23, 2025
@roomote roomote bot mentioned this pull request Jul 23, 2025
4 tasks
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 23, 2025
@mrubens mrubens closed this Jul 23, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 23, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add HuggingFace fprovider
3 participants