run demos without docker, keep docker optional via --with-ui

This commit is contained in:
Adil Hafeez 2026-03-09 17:18:11 +00:00
parent b9f01c8471
commit 1285bd083d
33 changed files with 447 additions and 316 deletions

View file

@ -7,33 +7,57 @@ start_demo() {
if [ -f ".env" ]; then
echo ".env file already exists. Skipping creation."
else
# Step 2: Create `.env` file and set OpenAI key
# Step 2: Create `.env` file and set API keys
if [ -z "$OPENAI_API_KEY" ]; then
echo "Error: OPENAI_API_KEY environment variable is not set for the demo."
exit 1
fi
if [ -z "$ANTHROPIC_API_KEY" ]; then
echo "Warning: ANTHROPIC_API_KEY environment variable is not set. Anthropic features may not work."
fi
echo "Creating .env file..."
echo "OPENAI_API_KEY=$OPENAI_API_KEY" > .env
echo ".env file created with OPENAI_API_KEY."
if [ -n "$ANTHROPIC_API_KEY" ]; then
echo "ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY" >> .env
fi
echo ".env file created with API keys."
fi
# Step 3: Start Plano
echo "Starting Plano with config.yaml..."
planoai up config.yaml
echo "Starting Plano with arch_config_with_aliases.yaml..."
planoai up arch_config_with_aliases.yaml
# Step 4: Start developer services
echo "Starting Network Agent using Docker Compose..."
docker compose up -d # Run in detached mode
# Step 4: Optionally start UI services (AnythingLLM, Jaeger)
if [ "$1" == "--with-ui" ]; then
echo "Starting UI services (AnythingLLM, Jaeger)..."
docker compose up -d
fi
echo ""
echo "Plano started successfully."
echo "Please run the following CURL command to test model alias routing. Additional instructions are in the README.md file."
echo ""
echo "curl -sS -X POST \"http://localhost:12000/v1/chat/completions\" \
-H \"Authorization: Bearer test-key\" \
-H \"Content-Type: application/json\" \
-d '{
\"model\": \"arch.summarize.v1\",
\"max_tokens\": 50,
\"messages\": [
{ \"role\": \"user\",
\"content\": \"Hello, please respond with exactly: Hello from alias arch.summarize.v1!\"
}
]
}' | jq ."
}
# Function to stop the demo
stop_demo() {
# Step 1: Stop Docker Compose services
echo "Stopping Network Agent using Docker Compose..."
docker compose down
# Stop Docker Compose services if running
docker compose down 2>/dev/null || true
# Step 2: Stop Plano
# Stop Plano
echo "Stopping Plano..."
planoai down
}
@ -42,6 +66,5 @@ stop_demo() {
if [ "$1" == "down" ]; then
stop_demo
else
# Default action is to bring the demo up
start_demo
start_demo "$1"
fi

View file

@ -22,18 +22,19 @@ start_demo() {
echo "Starting Plano with config.yaml..."
planoai up config.yaml
# Step 4: Start developer services
echo "Starting Network Agent using Docker Compose..."
docker compose up -d # Run in detached mode
# Step 4: Optionally start UI services (AnythingLLM, Jaeger)
if [ "$1" == "--with-ui" ]; then
echo "Starting UI services (AnythingLLM, Jaeger)..."
docker compose up -d
fi
}
# Function to stop the demo
stop_demo() {
# Step 1: Stop Docker Compose services
echo "Stopping Network Agent using Docker Compose..."
docker compose down
# Stop Docker Compose services if running
docker compose down 2>/dev/null || true
# Step 2: Stop Plano
# Stop Plano
echo "Stopping Plano..."
planoai down
}
@ -42,6 +43,5 @@ stop_demo() {
if [ "$1" == "down" ]; then
stop_demo
else
# Default action is to bring the demo up
start_demo
start_demo "$1"
fi