Skip to content

feat(sdk): optional embedding runtime for ~85% lighter installs — v3.4.0 - #398

Merged
sebbsssss merged 1 commit into
mainfrom
claude/llms-txt-equivalent-qrvd64
Jul 14, 2026
Merged

feat(sdk): optional embedding runtime for ~85% lighter installs — v3.4.0#398
sebbsssss merged 1 commit into
mainfrom
claude/llms-txt-equivalent-qrvd64

Conversation

@sebbsssss

Copy link
Copy Markdown
Owner

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 an optionalDependency:

  • Default install: unchanged. 273 packages, full offline semantic search — verified identical on the packed tarball, 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.
  • Degradation is never silent: clude status now reports search mode — semantic (local embeddings) + keyword normally, or a keyword-only warning with the install hint.
  • Side benefit: platforms where onnxruntime's native bits fail no longer fail the entire install (optional deps are allowed to fail).

Safe because SqliteStore already guards every embedder.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

  1. pnpm --filter @clude/brain test src/cli/__tests__ — 14/14; tsc --noEmit clean.
  2. npm pack, then in a clean dir: default install → 273 pkgs + transformers present; --omit=optional install → 225 pkgs/107MB + MCP store/recall works + clude status shows the keyword-only warning. All done during development.

Checklist

  • Code compiles (npm run build:sdk)
  • TypeScript strict mode passes (tsc --noEmit)
  • Tested locally — both install variants exercised end-to-end on the packed tarball
  • Updated documentation (if applicable) — npm README, llms-full.txt, changelog

🤖 Generated with Claude Code

https://claude.ai/code/session_01WwNsqpJeG9ntin2HJsDfsK


Generated by Claude Code

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
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cluude Ready Ready Preview, Comment Jul 14, 2026 2:07am

Request Review

@sebbsssss
sebbsssss merged commit 611b21d into main Jul 14, 2026
3 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