feat(sdk): optional embedding runtime for ~85% lighter installs — v3.4.0 - #398
Merged
Conversation
Move @huggingface/transformers to optionalDependencies. SqliteStore
already degrades gracefully at every embed call site (vector insert and
vector search both fall back to keyword), so the only thing missing was
the escape hatch and visibility:
- default install unchanged: 273 packages / ~818MB, full offline
semantic search (verified on the packed tarball)
- npm install --omit=optional: 225 packages / ~107MB, keyword-only
local search — MCP store→recall round-trip verified working
- clude status now reports search mode explicitly ("semantic (local
embeddings) + keyword" vs a keyword-only warning with the install
hint) so degradation is never silent
- side benefit: platforms where onnxruntime fails to build no longer
fail the entire install
- light-install documented in the npm README and llms-full.txt;
changelog entry; 3.4.0 in both manifests
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwNsqpJeG9ntin2HJsDfsK
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What changed
The last big first-impression complaint from the install audit was the ~818MB footprint — ~700MB of which is onnxruntime via
@huggingface/transformers, the local embedding runtime. This PR makes it anoptionalDependency:require.resolve('@huggingface/transformers')succeeds.npm install @clude/sdk --omit=optional: 225 packages, ~107MB. Local mode falls back to keyword search — a full MCP stdio store→recall round-trip verified working on the light install.clude statusnow reports search mode —semantic (local embeddings) + keywordnormally, or a keyword-only warning with the install hint.Safe because
SqliteStorealready guards everyembedder.embed()call site with keyword fallback (vector insert and vector search) — this PR adds the escape hatch and the visibility, not new degradation paths.Also documents the light install in the npm README + llms-full.txt, adds the changelog entry, and bumps both manifests to 3.4.0 (publish-ready).
How to test
pnpm --filter @clude/brain test src/cli/__tests__— 14/14;tsc --noEmitclean.npm pack, then in a clean dir: default install → 273 pkgs + transformers present;--omit=optionalinstall → 225 pkgs/107MB + MCP store/recall works +clude statusshows the keyword-only warning. All done during development.Checklist
npm run build:sdk)tsc --noEmit)🤖 Generated with Claude Code
https://claude.ai/code/session_01WwNsqpJeG9ntin2HJsDfsK
Generated by Claude Code