Coder Social home page Coder Social logo

declark1 / fms-guardrails-orchestrator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from foundation-model-stack/fms-guardrails-orchestrator

0.0 0.0 0.0 3.1 MB

Orchestrator server for invocation of detectors and application of various guardrails detections on text generation input and output

License: Apache License 2.0

Rust 98.63% Dockerfile 1.02% HTML 0.35%

fms-guardrails-orchestrator's Introduction

FMS Guardrails Orchestrator

Orchestrator server for invocation of detectors on text generation input and output [name subject to change]

LLM Orchestration diagram

Getting Started

Make sure Rust and Cargo are installed. Make sure you install protobuf.

Instructions for Fedora

# Install system dependencies
sudo dnf install git rustup gcc perl

# Install protoc
PROTOC_VERSION=26.0
cd /tmp
curl -L -O https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip
unzip protoc-*.zip -d /usr/local && rm protoc-*.zip

# Install Rust tools
rustup-init -y
. ~/.bashrc # If you're on bash, so commands rustc and cargo become available.

To build and install the binary locally:
```sh
cargo install --path .

To run the server locally:

cargo run --bin fms-guardrails-orchestr8

To run tests:

cargo test

To build documenation:

cargo doc

If you wish to contribute to the project, make sure you install pre-commit hooks to have automated checks for Rust before every commit (requires pre-commit to be installed in the system).

# You can skip this step if you already have it installed.
pip install pre-commit

Once you have pre-commit installed, run the following command on the project folder to install the pre-commit hooks:

pre-commit install

Sample requests

  1. Guardrails with text generation
curl -v -H "Content-Type: application/json" --request POST --data '{"model_id": "dummy_model_id", "inputs": "dummy input"}' http://localhost:8033/api/v1/task/classification-with-text-generation
  1. Guardrails with streaming text generation
curl -v -H "Content-Type: application/json" --request POST --data '{"model_id": "dummy_model_id", "inputs": "dummy input"}' http://localhost:8033/api/v1/task/server-streaming-classification-with-text-generation
  1. Health Probe
curl -v http://localhost:8034/health

Server configuration

Server configuration args can also be provided through environment variables.

  • For TLS, provide TLS_KEY_PATH and TLS_CERT_PATH for paths to the server key and cert respectively.
  • For mTLS, additionally provide TLS_CLIENT_CA_CERT_PATH for the path to the client CA (certificate authority).
  • To configure log levels, adjust RUST_LOG to debug, info, warn, error, etc.

fms-guardrails-orchestrator's People

Contributors

gkumbhat avatar evaline-ju avatar mdevino avatar declark1 avatar alanbraz avatar flaviabeo avatar pmcjr 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.