brainy/brainy-models-package/CONTRIBUTING.md
David Snelling c677b561d7 **docs(brainy-models): add Code of Conduct and Contributing Guide**
- Added `CODE_OF_CONDUCT.md` to establish community standards for behavior and inclusivity.
- Added `CONTRIBUTING.md` with detailed guidelines for contributing to the `brainy-models-package`:
  - Model quality, testing, and optimization requirements.
  - Development setup instructions, including build and test scripts.
  - Pull request and commit message conventions.
  - Package-specific utility scripts and file structure overview.

**Purpose**: Provide clear contribution and community guidelines to foster collaboration and maintain project quality standards.
2025-08-01 17:15:50 -07:00

3.1 KiB

Contributing to @soulcraft/brainy-models

Thank you for your interest in contributing to the Brainy Models package! This package provides pre-bundled TensorFlow models for the Brainy vector database.

Overview

The @soulcraft/brainy-models package is part of the larger Brainy ecosystem. For general contribution guidelines, please refer to the main Brainy Contributing Guide.

Package-Specific Guidelines

Model Contributions

When contributing to the models package, please consider:

  • Model Quality: Ensure models are properly tested and validated
  • Model Size: Be mindful of package size impact (current package is ~25MB)
  • Compatibility: Ensure models work with the target TensorFlow.js versions
  • Documentation: Update README.md with new model information

Development Setup

  1. Fork and clone the main repository
  2. Navigate to the models package: cd brainy-models-package
  3. Install dependencies: npm install
  4. Download models: npm run download-models
  5. Build the package: npm run build
  6. Run tests: npm test

Testing Models

Before submitting changes:

# Test model functionality
npm test

# Test model compression
npm run compress-models

# Verify package integrity
npm run pack

Model Scripts

The package includes several utility scripts:

  • download-models - Download the Universal Sentence Encoder model
  • compress-models - Create optimized model variants
  • test - Verify model functionality

Commit Guidelines

Follow the same commit message conventions as the main Brainy project:

  • Use conventional commit format
  • Keep first line under 50 characters
  • Use imperative mood ("Add model" not "Added model")
  • Reference issues where appropriate

Pull Request Process

  1. Ensure your changes don't break existing functionality
  2. Update documentation if you're adding new models or features
  3. Test model loading and embedding generation
  4. Verify package size impact is acceptable
  5. Submit PR to the main Brainy repository

Model Optimization

When working with models:

  • Float16: For balanced performance and size
  • Int8: For memory-constrained environments
  • Original: For maximum accuracy

File Structure

brainy-models-package/
├── models/                 # Model files
├── src/                   # TypeScript source
├── dist/                  # Compiled output
├── scripts/               # Utility scripts
└── test/                  # Test files

Code of Conduct

This project follows the same Code of Conduct as the main Brainy project.

Questions and Support

For questions specific to the models package:

For general Brainy questions, refer to the main repository.

License

By contributing to this project, you agree that your contributions will be licensed under the MIT License.