█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

NeMo Guardrails

LLM चैट ऐप्स में programmable rails जोड़ें, ताकि वे सुरक्षित रहें और विषय पर बनी रहें

Guardrails & Securityओपन सोर्स
भाषा
Python
कवरेज
1 story
$pip install nemoguardrails
संक्षेप में

NeMo Guardrails क्या है?

NeMo Guardrails LLM चैट ऐप्स में programmable rails जोड़ें, ताकि वे सुरक्षित रहें और विषय पर बनी रहें. यह Evaluation & Production Ops टूल्स की Guardrails & Security श्रेणी में आता है; ओपन सोर्स है और Python में लिखा गया है। शुरू करने के लिए: pip से इंस्टॉल करें.

सारांश

NeMo Guardrails, NVIDIA का एक ओपन सोर्स टूलकिट है, जिससे LLM-आधारित कन्वर्सेशनल ऐप्स में programmable guardrails (या "rails") जोड़े जा सकते हैं। Rails मॉडल के व्यवहार को नियंत्रित करने के खास तरीके हैं, जैसे उसे कुछ विषयों से दूर रखना, पहले से तय dialog path पर चलाना, या यूज़र तक पहुँचने से पहले उसके output को मॉडरेट करना।

यह आपके ऐप्लिकेशन कोड और LLM के बीच बैठता है, इसलिए इसे कॉल करना सीधे मॉडल को कॉल करने जैसा ही है। आप एक guardrails configuration लोड करते हैं, LLMRails instance बनाते हैं, और अपने चैट मैसेज को इसके generate method से रूट करते हैं। यह कई LLM providers के साथ काम करता है और LangChain chains को भी wrap कर सकता है।

यह developers को safety और dialog policies लागू करने का एक संरचित तरीका देकर guardrail-frameworks श्रेणी में आता है। Rails को input, dialog, retrieval, execution और output प्रकारों में बाँटा गया है, जिससे request के हर चरण पर content को reject या बदला जा सकता है।

यह क्या करता है

  • पाँच rail types पूरे request flow को कवर करते हैं: input, dialog, retrieval, execution और output
  • Colang-based dialog rails मॉडल को पहले से तय बातचीत के रास्तों और standard procedures पर चलाते हैं
  • jailbreaks और prompt injections जैसी आम LLM कमज़ोरियों से सुरक्षा
  • कई LLMs के साथ काम करता है, जैसे OpenAI GPT-3.5, GPT-4, LLaMa-2, Falcon, Vicuna और Mosaic
  • मौजूदा chains के चारों ओर guardrails layer लपेटने के लिए वैकल्पिक LangChain integration
  • Async-first डिज़ाइन: public methods (generate और generate_async) के sync और async, दोनों संस्करण मौजूद हैं

शुरू करें

pip से package इंस्टॉल करें, फिर guardrails configuration लोड करें और अपने चैट मैसेज को LLMRails instance से रूट करें। इसके लिए Python 3.10, 3.11, 3.12 या 3.13 चाहिए।

pip से इंस्टॉल करें

PyPI से nemoguardrails package इंस्टॉल करें।

bashbash
pip install nemoguardrails

Config लोड करें और जवाब generate करें

किसी path से guardrails configuration लोड करें, LLMRails instance बनाएँ और chat-style messages के साथ generate कॉल करें।

pythonpython
from nemoguardrails import LLMRails, RailsConfig

# Load a guardrails configuration from the specified path.
config = RailsConfig.from_path("PATH/TO/CONFIG")
rails = LLMRails(config)

completion = rails.generate(
    messages=[{"role": "user", "content": "Hello world!"}]
)

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • Documents पर सवाल-जवाब (RAG), जहाँ fact-checking और output moderation की ज़रूरत हो
  • Domain-specific चैटबॉट्स, जिन्हें विषय पर बने रहना हो और तय बातचीत के फ़्लो को फ़ॉलो करना हो
  • सुरक्षित customer interaction के लिए किसी custom LLM endpoint में safety layer जोड़ना
  • मौजूदा LangChain chains के चारों ओर guardrails layer लपेटना

How NeMo Guardrails compares

NeMo Guardrails alongside other open-source guardrails & security tools AI/TLDR tracks, ranked by GitHub stars.

टूलस्टारयह क्या करता है
SkillSpector★ 28.6kइंस्टॉल करने से पहले कोई agent skill दुर्भावनापूर्ण पैटर्न के लिए स्कैन करें
Presidio★ 12.2kटेक्स्ट, इमेज और स्ट्रक्चर्ड डेटा में PII की पहचान करें और उसे हटाएं
Failproof AI★ 10.5kएक policy API, जो Claude Code, Codex, Cursor और नौ अन्य agent harnesses से जुड़कर हर event पर agent को block, warn या steer करता है
Guardrails AI★ 7.7kPython में कंपोज़ेबल गार्ड्स से LLM के इनपुट और आउटपुट वैलिडेट करें
NeMo Guardrails★ 7.6kLLM चैट ऐप्स में programmable rails जोड़ें, ताकि वे सुरक्षित रहें और विषय पर बनी रहें
BLA (Blind LLM Agents)★ 7.5kआपके रिलीज़ किए गए build को इतना मज़बूत बनाएं कि AI reverse-engineering agents का बजट खत्म हो जाए और वे नकली चीज़ों के पीछे भागें
dcg (Destructive Command Guard)★ 6.4kएक Rust pre-tool hook जो coding agent के चलाने से पहले destructive shell और git commands को ब्लॉक करता है
GLiNER★ 4.3kकिसी भी entity type के लिए zero-shot named-entity recognition, जो इतना छोटा है कि CPU पर चल जाए