Git Product home page Git Product logo

guardrails-llm's Introduction

AI Safety for local LLMs

Evaluate the options for implementing safety guardrails for locally run LLMs.

Guardrail requirements

  • Does not involve fine tuning of models.
  • Must be run locally and offline.
  • Low latency
    • Less than 0.8 seconds?
  • Accuracy
    • False Positives can lead to the app's unusability and missing information.
    • False Negatives can lead to vulnerabilities.
    • If the ideal balance cannot be achieved, the FP-FN tradeoff can be decided based on the LLM use-case.
  • Low memory footprint
    • Less that 800 MB?

Key Vulnerabilities

  • Profanity and toxic content
  • Prompt Injection
  • PII
    • Should certain PII's be allowed? E.g. In a RAG application, extracting email ids of the authors from a whitepaper.

Guardrail options

  1. Guardrails-AI
  2. NeMo-Guardrails
  3. Safety-System-Prompts

Model Evaluation options

  1. Model-Safety
  2. PyRit

Guardrail Design Recommendation

  1. Use non-LLM, lightweight models from Guardrails-AI to validate the user input and LLM output.
  2. Use system prompt engineering similar to Safety-System-Prompts to instruct the LLM itself to behave in a safe manner.

AI Safety Design

guardrails-llm's People

Contributors

reaganlo avatar

Stargazers

Dominik Antal 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.