Skip to main content

Anonymizes personally identifiable information for Large Language Model APIs

Project description

anonLLM: Anonymize Personally Identifiable Information (PII) for Large Language Model APIs

License: MIT

anonLLM is a Python package designed to anonymize personally identifiable information (PII) in text data before it's sent to Language Model APIs like GPT-3. The goal is to protect user privacy by ensuring that sensitive data such as names, email addresses, and phone numbers are anonymized.

Features

Anonymize names Anonymize email addresses Anonymize phone numbers Support for multiple country-specific phone number formats Reversible anonymization (de-anonymization) Installation

To install anonLLM, run:

pip install anonLLM

Quick Start

Here's how to get started with anonLLM:

from anonLLM.llm import OpenaiLanguageModel
from dotenv import load_dotenv

load_dotenv()

# Anonymize a text
text = "Write a CV for me: My name is Alice Johnson, "\
    "email: alice.johnson@example.com, phone: +1 234-567-8910."\
    "I am a machine learning engineer."

# Anonymization is handled under the hood
llm = OpenaiLanguageModel()

response = llm.generate(text)

print(response)

In this example, the response will contain the correct name provided. At the same time, no PII will be sent to OpenAI.

Contributing

We welcome contributions!

License

This project is licensed under the MIT License.

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

anonLLM-0.1.7.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

anonLLM-0.1.7-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file anonLLM-0.1.7.tar.gz.

File metadata

  • Download URL: anonLLM-0.1.7.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for anonLLM-0.1.7.tar.gz
Algorithm Hash digest
SHA256 a408aab0129a241f2bac3c2bcbd958cd12f1bc56c7aaa6f664cc58f608336713
MD5 dc7c29096ade993697633145420bb8f9
BLAKE2b-256 8a31a50acbb961061981bd0b45b8efe6ad6f8bcd13decc39f41b61b1c62b6ae2

See more details on using hashes here.

File details

Details for the file anonLLM-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: anonLLM-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for anonLLM-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 406d7b66acd5f1329d92b9c541a58ca6de603d5c9a9312533f1f840c6f3d6a5e
MD5 f9bb9d8104266fb009aef558667704df
BLAKE2b-256 183a25eedbec9fece9e119370edc34005aa26910faeb85c00950a9c86b2594e9

See more details on using hashes here.

Supported by

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