Module Validator is a Rust-based application that manages the installation, execution, and validation of various modules, including inference modules and subnet modules. It provides a flexible system for dynamically managing Python modules within a Rust environment.
- Dynamic installation of Python modules (inference modules and subnet modules)
- Automatic creation of Python virtual environments for each module
- Module management through a registry system
- Database integration for persistent module information
- Command-line interface for easy interaction
- Subnet module validation
- Cross-platform support (Linux, macOS, Windows)
- Rust (latest stable version)
- Python 3.7+
- PostgreSQL
- Git (for cloning subnet repositories)
-
Clone the repository:
git clone https://github.com/yourusername/module-validator.git cd module-validator
-
Set up the database:
- Create a PostgreSQL database
- Set the
DATABASE_URL
environment variable in a.env
file:DATABASE_URL=postgres://username:password@localhost/database_name
-
Build the project:
cargo build --release
Run the application using:
cargo run --release -- COMMAND
Available commands:
install <url>
: Install a new module (inference or subnet)list
: List all installed modulesrun-inference <name> <input>
: Run an inference moduleuninstall <name>
: Uninstall a moduleparse-config <name>
: Parse and display the configuration of an installed modulelaunch-validator <name> [args]
: Launch a validator for a subnet module
For more details on each command, use:
cargo run --release -- help
src/
: Contains the Rust source codemain.rs
: Entry point of the applicationlib.rs
: Library root, exports public modulescli.rs
: Defines the command-line interfaceconfig.rs
: Handles configuration loading and savingconfig_parser.rs
: Parses module configurationsdatabase.rs
: Manages database operationsregistry.rs
: Implements the ModuleRegistry for managing modulesutils.rs
: Contains utility functionsvalidator.rs
: Implements the Validator for subnet modulesmodules/
: Contains module implementationsinference_module.rs
: Implements the InferenceModulesubnet_module.rs
: Implements the SubnetModule
inference/
: Contains inference-related implementationspython_executor.rs
: Manages Python execution environmentsinference_requests.rs
: Defines structures for inference requests
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details.