File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed
llm_router_services/guardrails Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1- 0.0.1
1+ 0.0.2
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ The services are **stateless**; they load their models once at start‑up and th
2222
2323## 🛡️ Guardrails
2424
25+ Full documentation for the guardrails sub‑package is available
26+ in [ guardrail-readme] ( llm_router_services/guardrails/README.md ) .
27+
2528The ** guardrail** sub‑package implements safety‑checking services that can be queried via HTTP:
2629
2730| Service | Model | Endpoint | Description |
Original file line number Diff line number Diff line change 1+ # Guardrails Package
2+
3+ ` guardrails ` provides the core safety‑checking and masking services used by ** llm‑router** . Each service runs as a small
4+ Flask application exposing a simple HTTP API that can be called by the corresponding plugin.
5+
6+ ## Sub‑packages
7+
8+ | Sub‑package | Purpose |
9+ | ---------------------------------------| ---------------------------------------------------------------------------------------------------------|
10+ | ** guardrails/guardrails/** | Abstract base classes, factory, configuration objects and payload handling logic. |
11+ | ** guardrails/guardrails/nask/** | NASK‑PIB safety model (Polish text classification). |
12+ | ** guardrails/guardrails/speakleash/** | Sojka (Bielik‑Guard) safety model (multi‑category). |
13+ | ** guardrails/maskers/** | ** UNDER DEVELOPMENT** Token‑classification based anonymiser (BANonymizer). |
14+ | ** run_ * .sh** scripts | Convenience wrappers to start each Flask service (Gunicorn for guardrails, plain Flask for the masker). |
15+
16+ ## HTTP API
17+
18+ All guardrail endpoints share the same request format:
19+
20+ ``` json
21+ {
22+ "payload" : <any
23+ JSON
24+ value>
25+ }
26+ ```
27+
28+ * ` payload ` may be a string, object, list, or any JSON‑serialisable type.
29+ * The service extracts all textual elements longer than 8 characters and runs them through the model.
30+ * The response contains an overall ` safe ` flag and a ` detailed ` list with per‑chunk (or per‑category) scores.
31+
32+ ## Guardrail Services Documentation
33+
34+ - ** NASK‑PIB Guardrail** – detailed usage, examples, and licensing information:
35+ [ guardrails/nask/README.md] ( nask/README.md )
36+
37+ - ** Sojka Guardrail** – detailed usage, examples, and licensing information:
38+ [ guardrails/speakleash/README.md] ( speakleash/README.md )
You can’t perform that action at this time.
0 commit comments