Skip to main content

Add your description here

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.4.tar.gz (1.8 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.4-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for aisc_plugin_interface-0.2.4.tar.gz
Algorithm Hash digest
SHA256 d62d3f93bfae411d0a50fd4eaf545dd00c0e8efae62af7120d595cacd7c1ac7a
MD5 6570ef3585dff99ba40429dbfbf50ad3
BLAKE2b-256 cb00e3da02def506a8eea7298a25adbb2d9ab31c79d80fb151e6770925e09891

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aisc_plugin_interface-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9c46d3eacd720ed6c34ef655d5dacb81fe3aa4d10771da02405d947ab4ee9767
MD5 d937546b3f37f6784072e441c3487c73
BLAKE2b-256 13ef32b5dccd08115fc10f77b7d9eeb34021ff36c2bf06969a9967e11779034e

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