Skip to main content

Plugin interface for the AISC evaluation framework

Project description

AISC Plugin Interface

This repository provides the base interface for writing evaluation plugins.

If you are new to the platform, start here:

That guide covers:

  • the plugin contract and discovery model
  • how to create a plugin project
  • how to implement configuration, inputs, metrics, and progress reporting
  • optional integration hooks and current extension points
  • common failure modes and architectural feedback areas

Quick Start

Create a new plugin project:

mkdir my-aisc-plugin
cd my-aisc-plugin
uv init --lib
uv add git+https://github.com/lux-ai-factory/aisc-plugin-interface

Implement a plugin class that inherits from BaseEvaluationPlugin[T], then export it from your package __init__.py.

Minimal example:

from typing import Any

from aisc_plugin_interface.models.measure import Measure
from aisc_plugin_interface.base_evaluation_plugin import metric, BaseEvaluationPlugin
from pydantic import BaseModel, Field

from aisc_plugin_interface import BaseEvaluationPlugin, Measure, metric


class ConfigFormSchema(BaseModel):
    threshold: float = Field(default=0.5, ge=0.0, le=1.0)


class MyPlugin(BaseEvaluationPlugin[ConfigFormSchema]):
    def evaluate(self, config_data: dict) -> Any:
        # Dependencies only used during evaluation should be imported locally here
        import numpy as np

        # Access configuration form data
        config: ConfigFormSchema = self.validate_config_form_data(config_data)
        threshold: float = config.threshold
        
        # Your evaluation logic here

        # Use self.logger for logging
        self.logger.info("Evaluation completed successfully")
        
        return {"MyMetric": [0.99, 0.5, 0.67], "OtherMetric": [0.01, 0.22, 0.77]}


    @metric("MyMetric")
    def my_metric(self, evaluation_output: Any) -> list[Measure]:
        values = evaluation_output.get("MyMetric", [])
        return [Measure(name="MyMetric", score=value) for value in values]

Export it:

from .plugin import MyPlugin

__all__ = ["MyPlugin"]

For the full development workflow, use the guide above.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aisc_plugin_interface-0.2.5.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aisc_plugin_interface-0.2.5-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file aisc_plugin_interface-0.2.5.tar.gz.

File metadata

File hashes

Hashes for aisc_plugin_interface-0.2.5.tar.gz
Algorithm Hash digest
SHA256 c92ede7312afaa12b3eda8a6aebed2198b28bb2cef298b0afa8df8d0fb77ddc0
MD5 cff81f96277131544c3d732dc093cc19
BLAKE2b-256 0309d9775f935f1772e8e9901834e787799c55ee2067bc65590b3c3ced1cff81

See more details on using hashes here.

File details

Details for the file aisc_plugin_interface-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for aisc_plugin_interface-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b530b1c1fbbad93ecde0fa17d476ac24e6a566108b03e38fd86a5ca587c040b1
MD5 9f6b51411a605c958ed32be9312e514b
BLAKE2b-256 ca47fd08be8c161607dd6853edcbe9d17f1a628d687a4b3e9004fd460668c156

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page