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
-config is omitted) enables
the LiteLLM adapter on 127.0.0.1:4019:beacon-gateway.yaml
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: trueruns the guardrail on every call without clients opting in.unreachable_fallback: fail_openkeeps the model path up whenbeacon-gatewayis down; those calls go through unrecorded.extra_headerslets 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
Kubernetes
Runbeacon-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
Related
LLM gateways
What gateway collection records and the settings shared by every gateway.
Envoy
Attach through Envoy, Envoy Gateway or Istio instead.