@super-protocol/model-analyzer
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Model Analyzer

This project is a TypeScript package designed to analyze model files and extract comprehensive metadata based on filenames and directory structures. The ModelAnalyzer class provides functionality to detect model architectures, tasks, training methods, and more from filenames.

Features

  • Analyze model filenames to extract metadata.
  • Determine storage requirements based on file types and folder structures.
  • Support for various model formats and architectures.
  • Utility functions for pattern matching in filenames.
  • Returns metadata as a ModelInfo instance with typed properties (using Sets internally, but serialized as arrays via toJSON).

Installation

Clone the repository and run:

npm install

Usage

To use the ModelAnalyzer, import it into your TypeScript files. For example:

import { ModelAnalyzer } from './src/analyzer';

const analyzer = new ModelAnalyzer();
const modelInfo = analyzer.analyzeModelFiles(['path/to/model/file1', 'path/to/model/file2']);

// Access metadata
console.log(modelInfo.format);
console.log(modelInfo.storageType);
// When serializing to JSON, collection properties become arrays:
console.log(JSON.stringify(modelInfo));

// Or to analyze a single filename:
const singleModel = analyzer.analyzeFilename('model.gguf');
console.log(singleModel);

Development

To run tests, use:

npm test

Make sure you have Jest (or your chosen test runner) properly configured for TypeScript.

Contributing

Contributions are welcome! Open an issue or submit a pull request for improvements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Package Sidebar

Install

npm i @super-protocol/model-analyzer

Weekly Downloads

15

Version

1.0.0

License

BSL-1.1

Unpacked Size

102 kB

Total Files

35

Last publish

Collaborators

  • dorianhost
  • villain88
  • vyuv
  • idris0v
  • yen
  • denisbezrukovsp
  • agentrx
  • denisbezrukov
  • galkinsden
  • nukri
  • dmitry_smv
  • serega_k
  • ichirkin
  • raskolnikofff
  • vksp