Giter Site home page Giter Site logo

jeevanssp / sherlogs-client Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 29 KB

Tool to monitor AI services, enhancing safety and security

Home Page: https://genshield.cydratech.com

Python 54.19% Shell 45.81%
gen-ai llm logging monitoring python safety

sherlogs-client's Introduction

GenShield Client App

Description

genshield is an innovative application designed to intercept and analyze network traffic between client applications and various LLM services like OpenAI and Google. This analysis helps ensure the safety and compliance of data exchanged. genshield utilizes MitmProxy, a versatile tool for inspecting, modifying, and decrypting HTTP and HTTPS traffic.

Setup

Installation

  1. Clone the repository: (to /home/app directory) git clone https://github.com/JeevansSP/genshield-client
  2. Navigate to the project directory: cd genshield-client
  3. Make sure python is installed by checking python3 --version
  4. Run the installation script: ./install.sh This script will handle the installation of MitmProxy, configure your environment, and set up necessary certificates based on your operating system.

Configuration and Running

  1. Ensure your environment is configured to use the proxy:
  • Ubuntu: Add the following to your sudoers file to preserve environment variables:
    Defaults env_keep += "http_proxy https_proxy HTTP_PROXY HTTPS_PROXY"
    
  • macOS: Set HTTP and HTTPS proxies to http://localhost:8080 in Network Preferences wifi settings> Advanced > Proxies.
  1. Start the application by running:
    ./run.sh <your_api_key> Replace <your_api_key> with your actual API key. This script sets the API key as an environment variable and starts MitmProxy to intercept traffic.
    Visit GenShield to generate an api key.

Features

  • Automatic interception and decryption of traffic using MitmProxy.
  • Seamless integration with various LLM services without requiring specific frameworks.
  • Detailed logging and analysis of intercepted data for compliance and safety checks.

Certificate Installation

If you encounter any issues with HTTPS connections after setup, you may need to manually trust the MitmProxy certificate:

  • Access the generated certificate at ~/.mitmproxy/mitmproxy-ca-cert.pem.
  • Follow the OS-specific instructions to install and trust the certificate in your system and Python environment.

If You are running python scripts in a virtual env you will have to append the mitm cert to your venv's certifi chain cat /.mitmproxy/mitmproxy-ca-cert.pem >> <path_to_venv>/<venv_folder_name>/libs/python3.xx/site-packages/certifi/<certificate_bundle>.pem

Usage

To use genshield:

  1. Ensure the proxy settings are correctly configured.
  2. Run the script with your API key to start intercepting and analyzing LLM service traffic: ./run.sh your_api_key_here
    (nohup ./run.sh your_api_key_here > /dev/null 2>&1 & if you want to run it in the background)

Additional Notes

  • For detailed command usage and troubleshooting, refer to the comprehensive comments in the install.sh and run.sh scripts.
  • Visit our support page for more help and FAQs about genshield setup and operations.

Todo

  • Implement interceptor logic for LLM services such as Ollama, Llama.cpp, HuggingFace, Anthropic, and Gorq. Most of these services follow an OpenAI-compatible pattern, and parsers for many are already implemented server-side.

sherlogs-client's People

Contributors

jeevanssp avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.