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

@qvac/dl-filesystem

v0.2.1

Published

`@qvac/dl-filesystem` is a data loading library designed to load model weights and other resources from a local filesystem. It provides a simple and efficient way to retrieve files required for AI model inference, training, and other operations directly f

Readme

@qvac/dl-filesystem

@qvac/dl-filesystem is a data loading library designed to load model weights and other resources from a local filesystem. It provides a simple and efficient way to retrieve files required for AI model inference, training, and other operations directly from a specified directory.

Usage

FilesystemDL Class

FilesystemDL extends BaseDL to provide a unified interface for loading files from a local directory. It is designed to integrate seamlessly with other QVAC AI Runtime libraries and classes.

Constructor:

const FilesystemDL = require('@qvac/dl-filesystem');

const fsDL = new FilesystemDL({ dirPath: '/path/to/your/models' });
  • dirPath: A string representing the local path to the directory containing model files or resources.

Methods:

  • getStream(path): Asynchronously retrieves a readable stream for a specified file path in the local directory.

    const stream = await fsDL.getStream('model_weights.bin');
  • list(directoryPath = '.'): Lists the files in a directory relative to the base directory. If no directory is specified, it lists the files in the base directory.

    const files = await fsDL.list();
    console.log(files); // Output: ['file1.bin', 'file2.bin']

Examples

Loading Models with QVAC Runtime

Below is an example of how FilesystemDL can be used within the QVAC AI Runtime to dynamically load models:

const Qvac = require('@qvac/rt');
const FilesystemDL = require('@qvac/dl-filesystem');
const Whisper = require('@qvac/transcription-whispercpp');

const qvac = new Qvac({ /* runtime options */ });

// Create an inference instance for Whisper using the local filesystem to load weights
const whisper = qvac.inference.add(new Whisper({
  weights: new FilesystemDL({ dirPath: '/path/to/your/models' }),
  params: { /* model parameters */ }
}));

// Load model weights
await whisper.load();

FilesystemDL in AI Models

The FilesystemDL class can be integrated directly within model classes to dynamically fetch and load model files from a local directory.

class MyModel {
  constructor(loader) {
    this.loader = loader;
  }

  async load() {
    const weightsStream = await this.loader.getStream('model_weights.bin');
    // Process all the required files from the stream...
  }

  async listFiles() {
    const files = await this.loader.list();
    console.log('Available model files:', files);
  }
}

Development

  1. Install dependencies:

    npm install
  2. Run unit tests:

    npm test

Notes

  • Ensure that the provided directory path exists and contains the necessary model files.
  • The loader will throw an error if the directory or the specified file does not exist.
  • The list method can be used to enumerate the files available in the directory.