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.1.0.tar.gz
.
File metadata
- Download URL: glaider-0.1.0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27675eebaade2934f01422e00dc6e981869ffb34ed891340cc16ec2446aa2175 |
|
MD5 | 2dba861d396f7742949a863627d1a031 |
|
BLAKE2b-256 | d1b633121d37f8b40b72eef278a32ddb292535aff5bff8d6300da568352b4268 |
File details
Details for the file glaider-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: glaider-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.1 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 | 6c1a3a8e7c8b88610289ee3dd483c606fda62588a0d3dcf67da674d4cb1980b8 |
|
MD5 | 5b0259d7a19d78483257c91f60b0431b |
|
BLAKE2b-256 | 8baead15dd1c8ab479e3db240799f5b3bc80cca4d6d498cf12ae877892089ef2 |