gittech. site

for different kinds of informations and explorations.

Eunomia, Open Source Data Governance for LLM-Based Applications

Published at
Dec 26, 2024

Eunomia Logo

Open Source Data Governance for LLM-based Applications

Made with ❀ by the team at What About You.

Read the docs Β· Join the Discord

Get Started

eunomia is a framework that makes it easy to enforce data governance policies in LLM-based applications by working at the token level.

Installation

Install the eunomia package via pip:

pip install eunomia-ai

Basic Usage

eunomia is built in a modular way, where each module is a separate instrument. Multiple instruments can be combined together to create a custom orchestration.

For instance, we can use the PiiInstrument to identify and replace PII in the text.

from eunomia.instruments import PiiInstrument

eunomia = Orchestra(
    instruments=[
        PiiInstrument(entities=["EMAIL_ADDRESS", "PERSON"], edit_mode="replace"),
    ]
)

text = "Hello, my name is John Doe and my email is [email protected]."

eunomia.run(text)
# Output: "Hello, my name is <PERSON> and my email is <EMAIL_ADDRESS>."

Documentation

For more examples and detailed usage, check out the documentation.