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:
- Email: lorenzo@glaider.it
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
Built Distribution
File details
Details for the file glaider-0.2.0.tar.gz
.
File metadata
- Download URL: glaider-0.2.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 777dfc1325c97598fbf77e92427af7492ce3b98758191e54e2c52864b8de9e5e |
|
MD5 | 77513dd64125b2dee0c9e98b5b284a67 |
|
BLAKE2b-256 | 6b8e7cf928ad1784c1b127954ca7e6105bd00c6b4ca090807e01200862e9b92b |
File details
Details for the file glaider-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: glaider-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 335c4702c98d0479209a4344b3a2438634e85d4a245d3469380409e8c6d585d0 |
|
MD5 | c4e9935322d50e67e5b1cebeb3c144ff |
|
BLAKE2b-256 | faa13f7824ef72b4fb27a95c88c29f8b7a759dfe7c5f6e6c0210d7a016512fdd |