Skip to content

fix(deps): move @huggingface/transformers to optionalDependencies#248

Merged
efenocchi merged 1 commit into
mainfrom
feat/optional-embed-deps
Jun 9, 2026
Merged

fix(deps): move @huggingface/transformers to optionalDependencies#248
efenocchi merged 1 commit into
mainfrom
feat/optional-embed-deps

Conversation

@efenocchi

@efenocchi efenocchi commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Moves @huggingface/transformers from dependencies to optionalDependencies
  • sharp (transitive dep via @huggingface/transformers) has no prebuilt binary for Node v26 on macOS and requires node-gyp to build from source, causing npm install -g @deeplake/hivemind to fail
  • Embeddings are already opt-in (hivemind embeddings install) and the code already handles the package being absent gracefully — this aligns the package.json with runtime behavior

Test plan

  • npm install -g @deeplake/hivemind succeeds on Node v26 macOS without node-gyp installed
  • hivemind embeddings install still works and downloads @huggingface/transformers on demand
  • Existing tests pass (no logic changed, only package.json metadata)

Summary by CodeRabbit

  • Chores
    • Hugging Face Transformers library is now marked as an optional dependency, allowing for smaller installations for users who don't require this functionality.

sharp (pulled in by @huggingface/transformers) has no prebuilt binary for
Node v26 on macOS and requires node-gyp to build from source. Since
embeddings are already opt-in (hivemind embeddings install), marking the
dep optional prevents install failures on unsupported Node versions.
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 519c977b-99e7-419b-9168-7d0ffdeeb831

📥 Commits

Reviewing files that changed from the base of the PR and between a83a1c6 and 1ef8acf.

📒 Files selected for processing (1)
  • package.json

📝 Walkthrough

Walkthrough

The pull request moves @huggingface/transformers from the main dependencies section to optionalDependencies in package.json, allowing the package to be installed on-demand rather than as a core requirement.

Changes

Dependency Management

Layer / File(s) Summary
Move @huggingface/transformers to optional
package.json
@huggingface/transformers is reclassified from a required dependency to an optional dependency, enabling flexible installation and reducing core dependency requirements.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~3 minutes

Poem

🐰 A dependency light as morning dew,
Now optional, a choice for you!
From required chains to freedom's call,
Transformers skip—or not at all!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and clearly summarizes the main change: moving @huggingface/transformers from dependencies to optionalDependencies.
Description check ✅ Passed The description covers the summary, rationale, and test plan well; however, the Version Bump section is not addressed (no version number change indicated).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/optional-embed-deps

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

No src/*.ts files changed in this PR.

Generated for commit 7f61481.

@efenocchi efenocchi merged commit 267bd46 into main Jun 9, 2026
10 checks passed
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