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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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