trigguard-litellm
LiteLLM callback that gates every model call through TrigGuard POST /execute.
- PERMIT / OBSERVE — the call proceeds
- DENY / SILENCE / ESCALATE / unreachable gateway —
RuntimeError(fail-closed)
Install
pip install trigguard-litellm
# optional: pip install 'trigguard-litellm[litellm]'
Usage
import litellm
from trigguard_litellm import TrigGuardLiteLLMCallback
litellm.callbacks = [
TrigGuardLiteLLMCallback(
gateway_url="https://api.trigguardai.com",
api_key="tg_live_...",
)
]
Constructor arguments default to TRIGGUARD_GATEWAY_URL and TRIGGUARD_API_KEY.
Imperative gate (no LiteLLM required):
from trigguard_litellm import TrigGuardPolicyGate
gate = TrigGuardPolicyGate(
gateway_url="https://api.trigguardai.com",
api_key="tg_live_...",
)
result = gate.authorize(context={"model": "gpt-4o"})
Related
@trigguard/execution-sdk— Node client for the same/executerailtrigguardon PyPI — Python SDK (authorize/verify)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trigguard_litellm-0.1.0.tar.gz.
File metadata
- Download URL: trigguard_litellm-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcf19c137212a4aecb9632a56c4dd2d2f8412dabab5b7a1c089337f2a1c401a0
|
|
| MD5 |
732d175dae8ca218b26db48cebd9d7ce
|
|
| BLAKE2b-256 |
829e92c17d54a7614345a80ce6c61696a450e9fe1e557ad46acbd9a683686437
|
File details
Details for the file trigguard_litellm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: trigguard_litellm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cbf248371ad1b79d141457f9526665e88fa0fac2a39025af7e7ac8246a01c9b
|
|
| MD5 |
52b8e7f48543fc461247d4e6d7235ed3
|
|
| BLAKE2b-256 |
0a7d5857399eaf5af7ab599860874d24a8ed91b94abb1ba6419ba4985b51fbeb
|