bluefly / marketplace_integration
Marketplace integration module for AI modules with certification engine, built on the LLM platform. Provides test-driven development and commerce capabilities.
Requires
- php: >=8.1
- drupal/commerce: ^2.0
- drupal/core: ^10.0 || ^11.0
- drupal/eca: ^2.0
- drupal/search_api: ^1.0
- drupal/views: ^1.0
Requires (Dev)
- drupal/core-dev: ^10.0 || ^11.0
- phpunit/phpunit: ^9.0 || ^10.0
Suggests
- drupal/metatag: For SEO metadata management
- drupal/pathauto: For automatic URL alias generation
- drupal/queue_ui: For queue management interface
- drupal/schema_metatag: For structured data markup
This package is auto-updated.
Last update: 2025-06-02 20:19:12 UTC
README
Overview
The Marketplace Integration module provides a comprehensive platform for AI model certification, validation, discovery, benchmarking, and management in Drupal. It enables organizations to create and manage their own AI model marketplace with enterprise-grade security, performance validation, and discovery capabilities.
Features
- AI Model Certification: Validate and certify AI models against platform standards
- Model Submission and Management: Submit, update, and manage AI models in the marketplace
- Security Scanning: Perform security scans on AI models to detect vulnerabilities
- Performance Benchmarking: Run performance benchmarks to evaluate model efficiency
- Model Discovery: Search and recommend AI models based on various criteria
- Real-time Analytics: Monitor usage, performance, and error metrics in real-time
- Comprehensive API: Full-featured RESTful API for marketplace operations
- Webhook Integration: Event-based notifications for asynchronous operations
Requirements
- Drupal 9.3 or higher
- PHP 8.1 or higher
- Composer
- llm module
- secure_drupal module
- mcp_client_extras module (optional)
Installation
Using Composer
composer require drupal/marketplace_integration
drush en marketplace_integration
Manual Installation
- Download and extract the module to your Drupal modules directory
- Enable the module using Drush or the Drupal UI:
drush en marketplace_integration
Configuration
- Visit
/admin/config/services/marketplace
to configure the module - Set up API authentication options
- Configure certification levels and criteria
- Set up security scanning and performance benchmarking parameters
- Configure marketplace analytics and monitoring
Architecture
The Marketplace Integration module follows a service-oriented architecture:
Services Layer: Core business logic implemented as Drupal services
MarketplaceManager
: Central service for marketplace operationsCertificationEngine
: Handles model validation and certificationSecurityScanner
: Performs security scanning on modelsBenchmarkEngine
: Runs performance benchmarksDiscoveryEngine
: Powers search and recommendation capabilitiesAnalyticsManager
: Collects and processes analytics data
API Layer: RESTful API endpoints for marketplace operations
- Implemented using Drupal's REST API system
- Comprehensive OpenAPI documentation
- Authentication via session, basic auth, or OAuth 2.0
Data Layer: Structured data storage
- Custom entities for models, certifications, security scans, and benchmarks
- Integration with Drupal's entity API
- Support for field-based extensions
API Documentation
The module provides a comprehensive API for interacting with the marketplace:
- API Documentation: Detailed API reference
- Integration Examples: Practical code examples
- OpenAPI Specification: OpenAPI 3.0.3 specification
Usage Examples
Managing AI Models via UI
- Visit
/admin/marketplace/models
to view all models - Click "Add Model" to submit a new model
- Use the action buttons to manage existing models:
- View details
- Edit properties
- Run security scan
- Perform benchmarks
- Delete model
Certification Workflow
- Submit a model for validation
- Review validation results
- Approve or reject certification
- Verify certification status
- Revalidate when needed
Using the API
See Integration Examples for detailed API usage examples.
Extending the Module
Custom Certification Criteria
Create a custom plugin implementing CertificationCriteriaInterface
:
/**
* @CertificationCriteria(
* id = "custom_criteria",
* label = @Translation("Custom Criteria"),
* description = @Translation("Custom certification criteria"),
* )
*/
class CustomCriteria extends CertificationCriteriaBase {
/**
* {@inheritdoc}
*/
public function validate(ModelInterface $model) {
// Custom validation logic
return new ValidationResult(TRUE, 95, 'Passed custom validation');
}
}
Custom Security Scanners
Create a custom plugin implementing SecurityScannerInterface
:
/**
* @SecurityScanner(
* id = "custom_scanner",
* label = @Translation("Custom Scanner"),
* description = @Translation("Custom security scanner"),
* )
*/
class CustomScanner extends SecurityScannerBase {
/**
* {@inheritdoc}
*/
public function scan(ModelInterface $model) {
// Custom scanning logic
return new ScanResult(TRUE, [], 'No vulnerabilities found');
}
}
Custom Benchmark Tests
Create a custom plugin implementing BenchmarkTestInterface
:
/**
* @BenchmarkTest(
* id = "custom_benchmark",
* label = @Translation("Custom Benchmark"),
* description = @Translation("Custom benchmark test"),
* )
*/
class CustomBenchmark extends BenchmarkTestBase {
/**
* {@inheritdoc}
*/
public function run(ModelInterface $model) {
// Custom benchmark logic
return new BenchmarkResult(TRUE, ['latency' => 0.2], 'Benchmark completed');
}
}
Drupal Recipe Integration
The module can be installed as part of a recipe:
# recipe.yml
name: AI Marketplace Recipe
description: Sets up an AI model marketplace
modules:
- marketplace_integration
- llm
- secure_drupal
config:
marketplace_integration.settings:
certification_levels:
- basic
- standard
- enterprise
default_validation_level: standard
enable_security_scanning: true
enable_performance_benchmarking: true
Testing
The module includes comprehensive tests:
# Run all tests
phpunit
# Run specific test suite
phpunit --testsuite=Unit
# Run with coverage report
phpunit --coverage-html=coverage
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature
) - Write tests for your feature
- Implement your feature following Drupal coding standards
- Run tests to ensure everything passes
- Submit a pull request
Troubleshooting
- Check the Drupal log for errors (
/admin/reports/dblog
) - Enable development mode for more detailed error messages
- Review the Troubleshooting Guide
License
GPL-2.0-or-later
See Also
- llm: LLM integration module
- secure_drupal: Security and compliance module
- mcp_client_extras: MCP client extensions
- recipe_onboarding: Recipe-based module onboarding
Version: 1.0.0
Dependencies: drupal:^9.3, llm, secure_drupal, mcp_client_extras
Certification Status: Certified Enterprise
Release Date: 2025-06-01
Built with ❤️ by the Bluefly AI Platform Team