
gittech. site
for different kinds of informations and explorations.
Eunomia, Open Source Data Governance for LLM-Based Applications
Published at
Dec 26, 2024
Main Article
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.