mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-06-12 07:47:47 +02:00
7c0bb957fb
* 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
21 lines
658 B
Bash
Executable File
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 |