mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +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.
15 lines
323 B
Docker
15 lines
323 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
COPY pyproject.toml .
|
|
RUN pip install --no-cache-dir ".[all]" 2>/dev/null || pip install --no-cache-dir \
|
|
"fastapi>=0.115" \
|
|
"uvicorn[standard]>=0.30" \
|
|
"headroom-ai[all]>=0.1"
|
|
|
|
COPY main.py .
|
|
|
|
EXPOSE 8100
|
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8100"]
|