AI Skill Hub 推荐使用:零延迟本地首先LLM防火墙 是一款优质的AI工具。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。
零延迟本地首先LLM防火墙,拦截每个提示,提高AI安全性和可靠性
零延迟本地首先LLM防火墙 是一款基于 Python 开发的开源工具,专注于 installable、ai-safety、anthropic 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
零延迟本地首先LLM防火墙,拦截每个提示,提高AI安全性和可靠性
零延迟本地首先LLM防火墙 是一款基于 Python 开发的开源工具,专注于 installable、ai-safety、anthropic 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install guardian-runtime
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install guardian-runtime
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/ashp15205/guardian-runtime
cd guardian-runtime
pip install -e .
# 验证安装
python -c "import guardian_runtime; print('安装成功')"
# 命令行使用
guardian-runtime --help
# 基本用法
guardian-runtime input_file -o output_file
# Python 代码中调用
import guardian_runtime
# 示例
result = guardian_runtime.process("input")
print(result)
# guardian-runtime 配置文件示例(config.yml) app: name: "guardian-runtime" debug: false log_level: "INFO" # 运行时指定配置文件 guardian-runtime --config config.yml # 或通过环境变量配置 export GUARDIAN_RUNTIME_API_KEY="your-key" export GUARDIAN_RUNTIME_OUTPUT_DIR="./output"
<p align="center"> <img src="https://img.shields.io/badge/GuardianRuntime-Local%20AI%20Firewall-00ff88?style=for-the-badge&logo=shield&logoColor=black" alt="GuardianRuntime" /> </p>
<p align="center"> <strong>A Zero-Latency FinOps & Security Firewall for AI Applications.<br> Intercept every prompt and response locally. Stop data leaks and runaway token costs.</strong> </p>
<p align="center"> <a href="https://buymeacoffee.com/ashishp05"><img src="https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black" alt="Buy Me A Coffee"></a> <a href="https://pypi.org/project/guardian-runtime/"><img src="https://img.shields.io/pypi/pyversions/guardian-runtime.svg?style=for-the-badge&logo=python&logoColor=white" alt="Python Versions"></a> <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=for-the-badge" alt="MIT License"></a> </p>
<p align="center"> 🌐 <strong>Website & Docs:</strong> <a href="https://ashp15205.github.io/guardian-runtime/">https://ashp15205.github.io/guardian-runtime/</a><br> 📦 <strong>Available on PyPI:</strong> <a href="https://pypi.org/project/guardian-runtime/">https://pypi.org/project/guardian-runtime/</a> </p>
---
```bash
pip install "guardian_runtime[openai]" pip install "guardian_runtime[anthropic]" pip install "guardian_runtime[gemini]"
pip install "guardian_runtime[all]" ``` Done. No signup, no keys, zero configuration required. All monitoring data stays on your local machine in ~/.guardian_runtime/.
---
Guardian is designed to be universal. Here are the exact ways to deploy it based on your workflow.
Guardian Runtime is perfectly tuned out of the box with a $10 daily budget and strict secret scanning. If you need custom rules, run guardian_runtime init to create a policy.yaml:
version: "1.0"
agents:
default:
llm:
provider: openai
default_model: gpt-4o
input_guard:
scanner_enabled: true
jailbreak_detection: true
scanner_action: block
cost:
daily_budget: 5.00 # Instantly block if daily spend exceeds $5.00
max_input_tokens: 20000 # Block massive context windows to save money
optimizer:
enabled: true
terse_mode: true # Slashes output tokens by forcing terse shorthand
---
Why use it here? If you are building a production chatbot or RAG pipeline, you must ensure your users cannot perform "jailbreak" prompt injections or trick the LLM into leaking internal system prompts.
How to use: Use Guardian as a drop-in replacement for the OpenAI/Anthropic SDK.
import os
from guardian_runtime import GuardianRuntime, GuardianRuntimeBlockedError
os.environ["OPENAI_API_KEY"] = "sk-proj-..."
gr = GuardianRuntime() # Zero-config initialization
try:
# Protects user input before sending to OpenAI
response = gr.complete(
messages=[{"role": "user", "content": "My AWS Key is AKIAIOSFODNN7EXAMPLE"}],
raise_on_block=True
)
print(response.content)
except GuardianRuntimeBlockedError as e:
# Fails cleanly in your app instead of leaking the secret!
print(f"Blocked Locally: {e.response.violations[0].detail}")
Guardian ships with a powerful suite of offline CLI tools. All data is stored purely locally in ~/.guardian_runtime/. Below is a detailed dive into every command, its flags, and exactly how and why to use it.
Guardian intercepts traffic at the network layer or via SDK, passing it through a strict verification pipeline before it ever reaches the cloud.
Agent / Dev Guardian Runtime Cloud LLM
│ │ │
│ 1. Prompt + Context │ │
│ ──────────────────────────▶ │ │
│ │ │
│ │ [Security Firewall] │
│ │ ├─ Scan AWS Keys / Secrets │
│ │ └─ Block if Threat Detected ──┼─ (Drops Request)
│ │ │
│ │ [Token Optimizer] │
│ │ ├─ Compress Whitespace │
│ │ └─ Terse Mode (Output Trim) │
│ │ │
│ │ [FinOps Budget] │
│ │ ├─ Check Daily Spend Limit │
│ │ └─ Block if $5 Limit Hit ─────┼─ (Drops Request)
│ │ │
│ │ 2. Sanitized Prompt │
│ │ ────────────────────────────▶ │
│ │ │
│ │ 3. LLM Response │
│ │ ◀──────────────────────────── │
│ │ │
│ │ [Output Guard] │
│ │ Audit for Leaked PII/Secrets │
│ │ │
│ 4. Safe Response │ │
│ ◀────────────────────────── │ │
│ │ │
---
Guardian Runtime acts as an HTTP proxy or a native Python SDK, meaning it integrates effortlessly with almost any modern AI tool without modifying their internal code.
---
该项目提供了一个零延迟本地首先LLM防火墙,提高了AI安全性和可靠性,但需要进一步优化和测试
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,零延迟本地首先LLM防火墙 是一款质量良好的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | guardian-runtime |
| 原始描述 | 开源AI工具:A zero-latency, local-first runtime firewall for LLMs. Intercept every prompt an。⭐9 · Python |
| Topics | installableai-safetyanthropic |
| GitHub | https://github.com/ashp15205/guardian-runtime |
| License | MIT |
| 语言 | Python |
收录时间:2026-06-10 · 更新时间:2026-06-10 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。