Skip to content

modelop/moc_governance_scores

Repository files navigation

ModelOp Logo

Use Case Governance Score Reporter

This script automates the retrieval of governance compliance scores for all Use Cases in your ModelOp Center inventory. It produces a simple CSV file showing the pass/fail rates for every model.


Prerequisites

Before running the script, you must configure your environment to access the private ModelOp SDK.

1. Configure Pip for Private SDK Access

The modelop-sdk is hosted on ModelOp's private PyPi server. You must configure your local pip to access it before installation.

Step 1: Upgrade Pip Run this command in your terminal:

python3 -m pip install --upgrade pip

Step 2: Create Configuration File

  • Mac/Linux: Run these commands to create the ~/.pip/pip.conf file:

    mkdir -p ~/.pip
    cat << 'EOF' > ~/.pip/pip.conf
    [global]
    extra-index-url = https://modelop:opendatagroup@pypi.modelop.center/modelop/staging https://modelop:opendatagroup@pypi.modelop.center/modelop/stable
    EOF
  • Windows: Create a file named pip.ini in your user's AppData folder (e.g., C:\Users\YourName\AppData\Roaming\pip\pip.ini) with the following content:

    [global]
    extra-index-url = [https://modelop:opendatagroup@pypi.modelop.center/modelop/staging](https://modelop:opendatagroup@pypi.modelop.center/modelop/staging)
                    [https://modelop:opendatagroup@pypi.modelop.center/modelop/stable](https://modelop:opendatagroup@pypi.modelop.center/modelop/stable)
    
  1. Install Public Dependencies: Once the SDK is configured, install the remaining libraries:
    pip install pandas requests modelop-sdk

Setup & Usage

  1. Open the Script: Open moc_governance_scores.py in any text editor (Notepad, VS Code, etc.).

  2. Configuration: Update the MOC_INSTANCE_URL variable with your specific ModelOp Center environment URL (e.g., https://your-company.modelop.center).

    Authentication:

    • Obtain Token: Obtain a valid Access Token for your environment using your organization's standard method (e.g., SSO, LDAP, or your internal API gateway). You may already be familiar with this process - for assistance, reach out to your organization's ModelOp Center System Admin for assistance.
    • Update Script: Modify the authenticate() function to accept your token directly. The script requires a valid session to proceed.
  3. Run the Script: Open your terminal or command prompt and run:

    python moc_governance_scores.py

Output

A file named use_case_governance_scores.csv will be created in the same folder.

Example Output:

UUID Use Case Name Governance Score
18bd00b1... Probability of Default 87.5% (7/8)
20385b24... LLM Chatbot 100.0% (5/5)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages