Skip to main content

A Python library to interact with generative ai tools safely

Project description

Glaider

Glaider is a Python library designed to facilitate safe interactions with generative AI tools. It aims to empower developers by providing features that prevent the exposure of sensitive data, mitigate risks associated with large language models (LLMs), and ensure secure AI interactions.

Features

  • Data Protection: Ensures that sensitive data is not exposed during interactions with AI models.
  • Prompt Injection Prevention: Protects against malicious inputs that could manipulate AI behavior.
  • Interaction Monitoring: Keeps a record of all interactions to audit and review as needed.
  • Risk Mitigation: Implements strategies to reduce general risks in using LLMs.

Installation

Install Glaider using pip:

pip install glaider

Usage

Here's a quick example of how you can use Glaider to interact with generative AI models safely:

## Usage Example

Below is a practical example of how you can use the `glaider` package to interact securely with generative AI services like OpenAI and Cohere:

```python
import glaider
from glaider import openai
from glaider import cohere

# Initialize Glaider with an API key and anonymization enabled
glaider.init(api_key='', anonymize=True)

# Set the API key for Cohere
cohere.api_key = ""

# Generate a response from Cohere, handling sensitive information
chat = cohere.generate(message="my secret email is secret@gmail.com, and my ip is 192.168.1.1")

# Create a chat completion with OpenAI's GPT-3.5 Turbo
resp = openai.chat_completion_create(
    model="gpt-3.5-turbo",
    messages=[
        {
            "role": "system",
            "content": "You are an helpful assistant"
        },
        {
            "role": "user",
            "content": "Hello, my email is secret@gmail.com, whats my email?"
        }
    ],
)

Requirements

Glaider requires the following Python packages:

  • cohere==4.11.2
  • openai==0.27.8
  • pydantic==1.10.9
  • requests==2.31.0

Development Status

This project is currently in Alpha. It is still under development and more features and improvements are planned.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

If you have any questions or feedback, please contact Lorenzo Abati at:

We appreciate your interest in Glaider and look forward to improving it with your feedback!

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

glaider-0.1.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

glaider-0.1.1-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file glaider-0.1.1.tar.gz.

File metadata

  • Download URL: glaider-0.1.1.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.6

File hashes

Hashes for glaider-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2e7baccbcea556ab797df18b00928129ce68dfc850094fd5265e33717e86060a
MD5 d3da8ee659503bef30e099c39de590d7
BLAKE2b-256 3937e192caef948eae019deac9f94a55c8a0e603e001e9138264636f27031df1

See more details on using hashes here.

File details

Details for the file glaider-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: glaider-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.6

File hashes

Hashes for glaider-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70b80e7ee1b0f990004421527162fbe06ad55477797642bcbc44e75ec796bea2
MD5 db56769316a9c8bddefb872176af3bd2
BLAKE2b-256 8bdbaac96ba0c3d814121433e089c8ee9036bd64465a23cf2613b64847385e13

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