bluefly/marketplace_integration

Marketplace integration module for AI modules with certification engine, built on the LLM platform. Provides test-driven development and commerce capabilities.

dev-main 2025-06-02 20:19 UTC

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

Installation

Using Composer

composer require drupal/marketplace_integration
drush en marketplace_integration

Manual Installation

  1. Download and extract the module to your Drupal modules directory
  2. Enable the module using Drush or the Drupal UI:
    drush en marketplace_integration
    

Configuration

  1. Visit /admin/config/services/marketplace to configure the module
  2. Set up API authentication options
  3. Configure certification levels and criteria
  4. Set up security scanning and performance benchmarking parameters
  5. 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 operations
    • CertificationEngine: Handles model validation and certification
    • SecurityScanner: Performs security scanning on models
    • BenchmarkEngine: Runs performance benchmarks
    • DiscoveryEngine: Powers search and recommendation capabilities
    • AnalyticsManager: 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:

Usage Examples

Managing AI Models via UI

  1. Visit /admin/marketplace/models to view all models
  2. Click "Add Model" to submit a new model
  3. Use the action buttons to manage existing models:
    • View details
    • Edit properties
    • Run security scan
    • Perform benchmarks
    • Delete model

Certification Workflow

  1. Submit a model for validation
  2. Review validation results
  3. Approve or reject certification
  4. Verify certification status
  5. 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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Write tests for your feature
  4. Implement your feature following Drupal coding standards
  5. Run tests to ensure everything passes
  6. 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

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