Files
invariant-gateway/gateway/run.sh
T
Luca Beurer-Kellner 7c0bb957fb Pipelined Guardrails (#32)
* initial draft: pipelined guardrails

* documentation on stream instrumentation

* more comments

* fix: return earlier

* non-streaming case

* handle non-streaming case

* fix more cases

* simplify request instrumentation

* improve comments

* fix import issues

* extend tests for input guardrailing

* anthropic integration of pipelined and pre-guardrailing

* fix gemini streamed refusal
2025-03-31 14:13:58 +02:00

21 lines
658 B
Bash
Executable File

#!/bin/bash
# Validate configuration
python validate_config.py
# Check exit code of validation script
if [ $? -ne 0 ]; then
echo "Configuration validation failed. Exiting."
exit 1
fi
# check if PORT environment variable is set
UVICORN_PORT=${PORT:-8000}
# using 'exec' belows ensures that signals like SIGTERM are passed to the child process
# and not the shell script itself (important when running in a container)
if [ "$DEV_MODE" = "true" ]; then
exec uvicorn serve:app --host 0.0.0.0 --port $UVICORN_PORT --reload --reload-dir /srv/resources --reload-dir /srv/gateway
else
exec uvicorn serve:app --host 0.0.0.0 --port $UVICORN_PORT
fi