Skip to main content

How it attaches

beacon-gateway attaches to the LiteLLM proxy as a Generic Guardrail API guardrail (guardrail: generic_guardrail_api). LiteLLM calls it twice per model call and waits for each answer: Both calls are POST <api_base>/beta/litellm_basic_guardrail_api. beacon-gateway answers {"action": "NONE"}, so the call goes ahead unchanged.

What is supported

Deploy

1

Build and start beacon-gateway

The shipped configuration (and the built-in one, used when -config is omitted) enables the LiteLLM adapter on 127.0.0.1:4019:
beacon-gateway.yaml
Run it next to the proxy (same host or same pod) so the guardrail call stays on loopback. If LiteLLM reaches it over a network, bind addr to that interface and keep the port off the internet: the listener has no authentication of its own.
2

Add the two guardrails to LiteLLM

Add both entries to the proxy’s config.yaml (gateway/deploy/litellm.yaml is a complete example):
config.yaml
  • default_on: true runs the guardrail on every call without clients opting in.
  • unreachable_fallback: fail_open keeps the model path up when beacon-gateway is down; those calls go through unrecorded.
  • extra_headers lets the session headers through. Add any other header you want on the event; never add credential headers (Beacon drops them anyway).
3

Restart the proxy and send a call

Send a model call through the proxy, then check the output file and the counters:

Kubernetes

Run beacon-gateway as a sidecar container in the LiteLLM proxy’s pod, listening on 127.0.0.1:4019, and keep api_base: http://127.0.0.1:4019. Every proxy replica then has its own beacon-gateway. With the open build’s in-memory store each replica remembers only what it has seen, so a session whose calls land on several replicas records its system text and tool definitions once per replica. Write the output to a volume your log shipper reads.

Troubleshooting

LLM gateways

What gateway collection records and the settings shared by every gateway.

Envoy

Attach through Envoy, Envoy Gateway or Istio instead.