Skip to main content

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 /execute rail
  • trigguard on 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

trigguard_litellm-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trigguard_litellm-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

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

Hashes for trigguard_litellm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dcf19c137212a4aecb9632a56c4dd2d2f8412dabab5b7a1c089337f2a1c401a0
MD5 732d175dae8ca218b26db48cebd9d7ce
BLAKE2b-256 829e92c17d54a7614345a80ce6c61696a450e9fe1e557ad46acbd9a683686437

See more details on using hashes here.

File details

Details for the file trigguard_litellm-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for trigguard_litellm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cbf248371ad1b79d141457f9526665e88fa0fac2a39025af7e7ac8246a01c9b
MD5 52b8e7f48543fc461247d4e6d7235ed3
BLAKE2b-256 0a7d5857399eaf5af7ab599860874d24a8ed91b94abb1ba6419ba4985b51fbeb

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page