mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
Microservice that wraps headroom-ai as a LiteLLM pre_call guardrail. Compresses tool outputs and JSON arrays before they reach the LLM provider using headroom's smart_crusher (JSON dedup + schema compression) and kompress (prose/log compression). Returns compressed structured_messages via the generic guardrail API, which required adding structured_messages support to GenericGuardrailAPIResponse.
13 lines
466 B
YAML
13 lines
466 B
YAML
services:
|
|
headroom-guardrail:
|
|
build: .
|
|
ports:
|
|
- "8100:8100"
|
|
environment:
|
|
# LLM provider key headroom uses internally to compress
|
|
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
|
# Optional: lock down the guardrail endpoint
|
|
- GUARDRAIL_API_KEY=${GUARDRAIL_API_KEY:-}
|
|
# Model headroom uses for compression (falls back to gpt-4o-mini)
|
|
- HEADROOM_DEFAULT_MODEL=${HEADROOM_DEFAULT_MODEL:-gpt-4o-mini}
|
|
restart: unless-stopped
|