Code Monkey home page Code Monkey logo

guardchain's Introduction

🛡️🔗 GuardChain

License Python 3.7+ Code style: black

plot

Guardchain is a lightweight toolkit for developers to evaluate, benchmark, and safeguard your AI agents and chains.

Features

  • 🛠️ evaluate and track prompts and LLM outputs with automated text and NLP metrics
  • 🤖 benchmark domain-specific tasks with automated agent simulated conversations
  • 🛡️ safeguard LLMs with our customizable firewall and enforce policies with guardrails

Quickstart

Open In Colab

Installation 💻

To install guardchain, use the Python Package Index (PyPI) as follows:

pip install guardrail-ml

Usage 🛡️🔗

from guardrail.client import run_metrics
from guardrail.client import run_simple_metrics
from guardrail.client import create_dataset

# Output/Prompt Metrics
run_metrics(output="Guardrail is an open-source toolkit for building domain-specific language models with confidence. From domain-specific dataset creation and custom     evaluations to safeguarding and redteaming aligned with policies, our tools accelerates your LLM workflows to systematically derisk deployment.",
            prompt="What is guardrail-ml?",
            model_uri="llama-v2-guanaco")

# View Logs
con = sqlite3.connect("logs.db")
df = pd.read_sql_query("SELECT * from logs", con)
df.tail(20)

# Generate Dataset from PDF
create_dataset(model="OpenAssistant/falcon-7b-sft-mix-2000",
               tokenizer="OpenAssistant/falcon-7b-sft-mix-2000",
               file_path="example-docs/Medicare Appeals Paper FINAL.pdf",
               output_path="./output.json",
               load_in_4bit=True)

More Colab Notebooks

4-bit QLoRA of llama-v2-7b with dolly-15k (07/21/23): Open In Colab

Fine-Tuning Dolly 2.0 with LoRA: Open In Colab

Inferencing Dolly 2.0: Open In Colab

Related AI Papers & Resources:

guardchain's People

Contributors

kw2828 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.