npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@llvs/mcpack-embeddings

v1.1.0

Published

Local MiniLM embedding adapter for @llvs/mcpack

Readme

@llvs/mcpack-embeddings

Local MiniLM embedding adapter for @llvs/mcpack.

@llvs/mcpack-embeddings provides a single factory — createMiniLMProvider() — that returns an EmbeddingProvider backed by the locally-cached Xenova/all-MiniLM-L6-v2 ONNX model via @huggingface/transformers ^4.0.0. Pair it with @llvs/mcpack to enable hybrid semantic + keyword ranking on search_tools.

Install

npm install @llvs/mcpack @llvs/mcpack-embeddings

@llvs/mcpack is declared as a peer dependency at ^1.1.0. Install both packages together; the adapter is opt-in and is NOT a runtime dependency of core.

Usage

import { mcpack } from '@llvs/mcpack';
import { createMiniLMProvider } from '@llvs/mcpack-embeddings';

const handle = await mcpack(server, {
  embeddings: { provider: await createMiniLMProvider() },
});

That's the full surface. createMiniLMProvider() returns a function typed as EmbeddingProvider: (texts: string[]) => Promise<number[][]>. Pass it to MCPackConfig.embeddings.provider and @llvs/mcpack handles the rest — startup index build, hybrid scoring, build-pending fallback, error handling.

Performance characteristics

  • Model: Xenova/all-MiniLM-L6-v2 (default; configurable via createMiniLMProvider({ model })).
  • Library: @huggingface/transformers ^4.0.0. The @xenova/transformers package was renamed and is no longer maintained — DEC-v11-03 locks @huggingface/transformers as the canonical replacement.
  • Embedding dimension: 384 (float32). Each tool vector is 1,536 bytes (Float32Array(384)); a 50-tool engine occupies ~75 KB of vector store memory.
  • First-run cost: one-time ~25–90 MB ONNX model download to node_modules/@huggingface/transformers/.cache/. Approximately 30 seconds on cold cache; instant on subsequent loads.
  • Warm-cache embedding: sub-second per batch on commodity hardware. Plan 10-01's perf bench measured a 50-tool batched index build at 216.6 ms.
  • Output: mean-pooled and L2-normalized. Cosine similarity reduces to dot product, and MCPack's hybrid scorer uses min-max normalization across the candidate set per query.

Notes

  • Pipeline singleton scoped inside the factory return. The cached extractor is closure-scoped — re-calling createMiniLMProvider() returns a new closure (and a new singleton), so module-scope leaks across vitest test files are avoided.
  • Type re-export policy. The EmbeddingProvider type is exported from @llvs/mcpack only. Do NOT import the type from this adapter package — keeping the type's source-of-truth in the core package preserves the locked v1.1 contract.
  • Adapter is opt-in. Without configuring embeddings, @llvs/mcpack runs the v1.0 keyword-only path unchanged. The MiniLM model is downloaded only when the operator opts in.
  • Optional cacheDir override: createMiniLMProvider({ cacheDir: '/path/to/cache' }) forwards the path to @huggingface/transformers's global env.cacheDir. Useful for containerized deployments that want a writable, predictable cache location.
  • No persistent vector cache yet — vectors are recomputed on every process start. v1.2 candidate per the project roadmap.

License

MIT (same license as @llvs/mcpack).