-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayground.sh
More file actions
executable file
·35 lines (25 loc) · 1007 Bytes
/
playground.sh
File metadata and controls
executable file
·35 lines (25 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
set -e
if [ ! -f .env ]; then
echo ".env file not found. Please create it with the necessary environment variables."
exit 1
fi
source .env
# Fail if LLAMA_STACK_HOST or LLAMA_STACK_PORT is not set
if [ -z "$LLAMA_STACK_HOST" ] || [ -z "$LLAMA_STACK_PORT" ]; then
echo "LLAMA_STACK_HOST or LLAMA_STACK_PORT is not set. Please set them in the .env file."
exit 1
fi
export LLAMA_STACK_ENDPOINT=http://$LLAMA_STACK_HOST:$LLAMA_STACK_PORT
# Show the environment variables
echo "LLAMA_STACK_ENDPOINT: $LLAMA_STACK_ENDPOINT"
# Test the endpoint and fail if it's not working using jq .status is OK silently
echo "Testing the endpoint..."
if ! curl -s -X GET $LLAMA_STACK_ENDPOINT/v1/health | jq '.status == "OK"' > /dev/null; then
echo "Failed to test the endpoint. Please check the .env file."
exit 1
fi
podman run -p 8501:8501 \
--env NO_PROXY=localhost,127.0.0.1 \
--env LLAMA_STACK_ENDPOINT=${LLAMA_STACK_ENDPOINT} \
quay.io/rh-aiservices-bu/llama-stack-playground:0.2.11