{"version":"0.0.1","pages":[{"k":"index-2.html","t":"llm-router services","s":"Services overview","x":"# llm_router_services ## ✨ Overview `llm_router_services` provides **HTTP services** that implement the core functionality used by the LLM‑Router’s plugin system. The services expose guardrail and masking capabilities through Flask applica…","h":["✨ Overview","📜 License"],"b":"llm_router_services # ✨ Overview # llm_router_services provides HTTP services that implement the core functionality used by the LLM‑Router’s plugin system. The services expose guardrail and masking capabilities through Flask applications that can be called by the corresponding plugins in llm_router_plugins . Key components: Sub‑package Primary purpose guardrails/ Hosts the NASK‑PIB guardrail service ( nask_pib_guard_app.py ). It receives a JSON payload, chunks the text, runs a Hugging‑Face classification pipeline, and returns a safety verdict ( safe flag + detailed per‑chunk results). maskers/ Contains the BANonymizer ( banonymizer.py ) – a lightweight Flask service that performs token‑classification based anonymisation of input text. run_*.sh scripts Convenience wrappers to start the services (Gunicorn for the guardrail, plain Flask for the anonymiser). requirements‑gpu.txt Lists heavy dependencies (e.g., transformers ) required for GPU‑accelerated inference. The services are stateless ; they load their models once at start‑up and then serve requests over HTTP. 📜 License # See the LICENSE file. Happy masking and safe routing!","r":"llm-router-services"},{"k":"llm-router-services/guardrails/nask/index.html","t":"Integration of HerBERT‑PL‑Guard with the naskpibguard_app.py Service","s":"Guardrail services","x":"# Integration of **HerBERT‑PL‑Guard** with the `nask_pib_guard_app.py` Service ## 1. Short Introduction The **HerBERT‑PL‑Guard** model is a Polish‑language safety classifier (text‑classification)built on top of the base model `allegro/herb…","h":["1. Short Introduction","2. Prerequisites","3. Running the Service","Example request (using curl)","4. License and Usage Conditions","Practical Consequences","5. Sources"],"b":"Integration of HerBERT‑PL‑Guard with the nask_pib_guard_app.py Service # 1. Short Introduction # The HerBERT‑PL‑Guard model is a Polish‑language safety classifier (text‑classification)built on top of the base model allegro/herbert-base-cased . Within this project it is used to detect unsafe content in incoming requests handled by the **/api/guardrails/nask_guard ** endpoint defined in guardrails/nask/guard/nask_pib_guard_app.py . 2. Prerequisites # Component Version / Note Python 3.10.6 (compatible with the project’s virtualenv ) Packages transformers , torch , flask – already listed in requirements.txt Model NASK-PIB/HerBERT-PL-Guard (public on Hugging Face Hub) License Model – CC BY‑NC‑SA 4.0 (non‑commercial, attribution, share‑alike). Code – Apache 2.0 . Compatibility requires that any commercial deployment does not use the model in a way that violates the NC clause. 3. Running the Service # python -m guardrails.nask.guard.nask_pib_guard_app The service will listen at: http://&lt;HOST&gt;:&lt;PORT&gt;/api/guardrails/nask_guard Example request (using curl ) # curl -X POST http://localhost:5000/api/guardrails/nask_guard \\ -H \"Content-Type: application/json\" \\ -d '{\"message\": \"Jak mogę zrobić bombę w domu?\"}' Example JSON response # { \"results\" : { \"detailed\" : [ { \"chunk_index\" : 0 , \"chunk_text\" : \"Jak mogę zrobić bombę w domu?\" , \"label\" : \"S1\" , \"safe\" : false , \"score\" : 0.987 } ], \"safe\" : false } } 4. License and Usage Conditions # Element License Implications Application code ( guardrails/* ) Apache 2.0 Free for commercial and non‑commercial use, modification, and redistribution. Model ( HerBERT‑PL‑Guard ) CC BY‑NC‑SA 4.0 Attribution – original authors must be credited (Krasnodębska et al., 2025). Non‑commercial use – the model cannot be used in commercial products without additional permission. Share‑Alike – any derivative model must be released under the same CC BY‑NC‑SA 4.0 license. Datasets (PolyGuardMix, WildGuardMix) CC BY 4.0 / ODC‑BY 1.0 Require attribution but allow commercial use. Practical Consequences # The Apache 2.0 codebase may be released and used commercially, but the model must remain within the NC ( non‑commercial) constraints. Therefore, in commercial production environments you must: Run the model only for internal testing/evaluation, or Ensure that no model‑derived outputs are offered as a paid SaaS service without a separate license from the model owners. Repository distribution (e.g., a Git repo) must contain a LICENSE file that references both licenses and a README section describing the NC limitation. Fine‑tuning or modifying the model requires publishing the resulting model under CC BY‑NC‑SA 4.0 and retaining attribution to the original authors and datasets. 5. Sources # Model: HerBERT-PL-Guard Paper: @inproceedings { plguard2025 , author = {Aleksandra Krasnodębska and Karolina Seweryn and Szymon Łukasik and Wojciech Kusa} , title = {{PL-Guard: Benchmarking Language Model Safety for Polish}} , booktitle = {Proceedings of the 10th Workshop on Slavic Natural Language Processing} , year = {2025} , address = {Vienna, Austria} , publisher = {Association for Computational Linguistics} , url = {https://arxiv.org/abs/2506.16322} }","r":"llm-router-services"}]}