Instructions to use suryatmodulus/rampart with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use suryatmodulus/rampart with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('token-classification', 'suryatmodulus/rampart');
| import { createGuard } from "../index.ts"; | |
| const guard = await createGuard(); | |
| const safe = await guard.protect("My name is Alex Rivera. My SSN is 472-81-0094."); | |
| const reply = await llm(safe.text); | |
| console.log(guard.reveal(reply)); | |
| async function llm(text: string): Promise<string> { | |
| return "Got it, [GIVEN_NAME_1]."; | |
| } |