diff --git a/demos/currency_exchange/README.md b/demos/sample_apps/currency_exchange/README.md similarity index 100% rename from demos/currency_exchange/README.md rename to demos/sample_apps/currency_exchange/README.md diff --git a/demos/currency_exchange/arch_config.yaml b/demos/sample_apps/currency_exchange/arch_config.yaml similarity index 100% rename from demos/currency_exchange/arch_config.yaml rename to demos/sample_apps/currency_exchange/arch_config.yaml diff --git a/demos/currency_exchange/docker-compose.yaml b/demos/sample_apps/currency_exchange/docker-compose.yaml similarity index 92% rename from demos/currency_exchange/docker-compose.yaml rename to demos/sample_apps/currency_exchange/docker-compose.yaml index 32e52c40..e145f2b4 100644 --- a/demos/currency_exchange/docker-compose.yaml +++ b/demos/sample_apps/currency_exchange/docker-compose.yaml @@ -1,7 +1,7 @@ services: chatbot_ui: build: - context: ../shared/chatbot_ui + context: ../../shared/chatbot_ui ports: - "18080:8080" environment: diff --git a/demos/currency_exchange/run_demo.sh b/demos/sample_apps/currency_exchange/run_demo.sh similarity index 100% rename from demos/currency_exchange/run_demo.sh rename to demos/sample_apps/currency_exchange/run_demo.sh diff --git a/demos/currency_exchange/test_data.yaml b/demos/sample_apps/currency_exchange/test_data.yaml similarity index 100% rename from demos/currency_exchange/test_data.yaml rename to demos/sample_apps/currency_exchange/test_data.yaml diff --git a/demos/sample_apps/python/human_resources_agent/Dockerfile b/demos/sample_apps/human_resources_agent/Dockerfile similarity index 100% rename from demos/sample_apps/python/human_resources_agent/Dockerfile rename to demos/sample_apps/human_resources_agent/Dockerfile diff --git a/demos/sample_apps/python/human_resources_agent/README.md b/demos/sample_apps/human_resources_agent/README.md similarity index 100% rename from demos/sample_apps/python/human_resources_agent/README.md rename to demos/sample_apps/human_resources_agent/README.md diff --git a/demos/sample_apps/python/human_resources_agent/arch_config.yaml b/demos/sample_apps/human_resources_agent/arch_config.yaml similarity index 100% rename from demos/sample_apps/python/human_resources_agent/arch_config.yaml rename to demos/sample_apps/human_resources_agent/arch_config.yaml diff --git a/demos/sample_apps/python/human_resources_agent/docker-compose.yaml b/demos/sample_apps/human_resources_agent/docker-compose.yaml similarity index 89% rename from demos/sample_apps/python/human_resources_agent/docker-compose.yaml rename to demos/sample_apps/human_resources_agent/docker-compose.yaml index 61c710a2..f1afe6f4 100644 --- a/demos/sample_apps/python/human_resources_agent/docker-compose.yaml +++ b/demos/sample_apps/human_resources_agent/docker-compose.yaml @@ -8,7 +8,6 @@ services: - CHAT_COMPLETION_ENDPOINT=http://host.docker.internal:10000/v1 volumes: - ./arch_config.yaml:/app/arch_config.yaml - - ../shared/chatbot_ui/common.py:/app/common.py ports: - "18080:80" healthcheck: @@ -18,7 +17,7 @@ services: chatbot_ui: build: - context: ../shared/chatbot_ui + context: ../../shared/chatbot_ui dockerfile: Dockerfile ports: - "18080:8080" diff --git a/demos/sample_apps/python/human_resources_agent/image.png b/demos/sample_apps/human_resources_agent/image.png similarity index 100% rename from demos/sample_apps/python/human_resources_agent/image.png rename to demos/sample_apps/human_resources_agent/image.png diff --git a/demos/sample_apps/python/human_resources_agent/main.py b/demos/sample_apps/human_resources_agent/main.py similarity index 100% rename from demos/sample_apps/python/human_resources_agent/main.py rename to demos/sample_apps/human_resources_agent/main.py diff --git a/demos/sample_apps/python/human_resources_agent/requirements.txt b/demos/sample_apps/human_resources_agent/requirements.txt similarity index 100% rename from demos/sample_apps/python/human_resources_agent/requirements.txt rename to demos/sample_apps/human_resources_agent/requirements.txt diff --git a/demos/sample_apps/python/human_resources_agent/run_demo.sh b/demos/sample_apps/human_resources_agent/run_demo.sh similarity index 100% rename from demos/sample_apps/python/human_resources_agent/run_demo.sh rename to demos/sample_apps/human_resources_agent/run_demo.sh diff --git a/demos/sample_apps/python/human_resources_agent/test_data.yaml b/demos/sample_apps/human_resources_agent/test_data.yaml similarity index 100% rename from demos/sample_apps/python/human_resources_agent/test_data.yaml rename to demos/sample_apps/human_resources_agent/test_data.yaml diff --git a/demos/sample_apps/python/human_resources_agent/workforce_data.json b/demos/sample_apps/human_resources_agent/workforce_data.json similarity index 100% rename from demos/sample_apps/python/human_resources_agent/workforce_data.json rename to demos/sample_apps/human_resources_agent/workforce_data.json diff --git a/demos/sample_apps/java/weather_forcecast_service/Dockerfile b/demos/sample_apps/java/weather_forcecast_service/Dockerfile index c4fe3861..1f536c5a 100644 --- a/demos/sample_apps/java/weather_forcecast_service/Dockerfile +++ b/demos/sample_apps/java/weather_forcecast_service/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: Build the application using Maven -FROM maven:3.8.7-openjdk-17 AS build +FROM maven:3.8.7-openjdk-18-slim AS build WORKDIR /app # Copy pom.xml and download dependencies first (caching) COPY pom.xml . @@ -14,5 +14,5 @@ WORKDIR /app # Copy the built jar from the previous stage COPY --from=build /app/target/weather-forecast-service-0.0.1-SNAPSHOT.jar app.jar # Expose the port on which the app runs (default Spring Boot is 8080) -EXPOSE 8080 +EXPOSE 8081 ENTRYPOINT ["java", "-jar", "app.jar"] diff --git a/demos/sample_apps/java/weather_forcecast_service/arch_config.yaml b/demos/sample_apps/java/weather_forcecast_service/arch_config.yaml new file mode 100644 index 00000000..10c22819 --- /dev/null +++ b/demos/sample_apps/java/weather_forcecast_service/arch_config.yaml @@ -0,0 +1,45 @@ +version: v0.1 +listener: + address: 127.0.0.1 + port: 10000 #If you configure port 443, you'll need to update the listener with tls_certificates + message_format: huggingface + +# Centralized way to manage LLMs, manage keys, retry logic, failover and limits in a central way +llm_providers: + - name: OpenAI + provider_interface: openai + access_key: $OPENAI_API_KEY + model: gpt-4o-mini + default: true + +# Arch creates a round-robin load balancing between different endpoints, managed via the cluster subsystem. +endpoints: + weather_forecast_service: + # value could be ip address or a hostname with port + # this could also be a list of endpoints for load balancing + # for example endpoint: [ ip1:port, ip2:port ] + endpoint: host.docker.internal:18081 + # max time to wait for a connection to be established + connect_timeout: 0.005s + +# default system prompt used by all prompt targets +system_prompt: | + You are a helpful weather assistant. + +prompt_targets: + - name: weather_forecast + description: get the weather forecast + parameters: + - name: location + description: the location for which to get the weather forecast + required: true + type: string + format: City, State + - name: days + description: the number of days for the forecast + required: true + type: int + endpoint: + name: weather_forecast_service + path: /weather + http_method: POST diff --git a/demos/sample_apps/java/weather_forcecast_service/docker-compose.yaml b/demos/sample_apps/java/weather_forcecast_service/docker-compose.yaml new file mode 100644 index 00000000..5a05da5a --- /dev/null +++ b/demos/sample_apps/java/weather_forcecast_service/docker-compose.yaml @@ -0,0 +1,20 @@ +services: + weather_forecast_service: + build: + context: . + dockerfile: Dockerfile + ports: + - "18081:8081" + + chatbot_ui: + build: + context: ../../../shared/chatbot_ui + dockerfile: Dockerfile + ports: + - "18080:8080" + environment: + - CHAT_COMPLETION_ENDPOINT=http://host.docker.internal:10000/v1 + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - ./arch_config.yaml:/app/arch_config.yaml diff --git a/demos/sample_apps/java/weather_forcecast_service/pom.xml b/demos/sample_apps/java/weather_forcecast_service/pom.xml index b0dfedbd..c2fed928 100644 --- a/demos/sample_apps/java/weather_forcecast_service/pom.xml +++ b/demos/sample_apps/java/weather_forcecast_service/pom.xml @@ -4,7 +4,7 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + weather weather-forecast-service 0.0.1-SNAPSHOT jar diff --git a/demos/sample_apps/python/stock_quote/run_demo.sh b/demos/sample_apps/java/weather_forcecast_service/run_demo.sh similarity index 100% rename from demos/sample_apps/python/stock_quote/run_demo.sh rename to demos/sample_apps/java/weather_forcecast_service/run_demo.sh diff --git a/demos/sample_apps/java/weather_forcecast_service/src/main/java/weather/controller/WeatherController.java b/demos/sample_apps/java/weather_forcecast_service/src/main/java/weather/controller/WeatherController.java index 00a9c21d..bb41227a 100644 --- a/demos/sample_apps/java/weather_forcecast_service/src/main/java/weather/controller/WeatherController.java +++ b/demos/sample_apps/java/weather_forcecast_service/src/main/java/weather/controller/WeatherController.java @@ -1,7 +1,6 @@ package weather.controller; import weather.model.DayForecast; -import weeather.model.Temperature; import weather.model.WeatherForecastResponse; import weather.model.WeatherRequest; import org.springframework.web.bind.annotation.PostMapping; @@ -20,7 +19,7 @@ public class WeatherController { private Random random = new Random(); @PostMapping("/weather") - public WeatherForecastResponse getWeather(@RequestBody WeatherRequest req) { + public WeatherForecastResponse getRandomWeatherForecast(@RequestBody WeatherRequest req) { WeatherForecastResponse response = new WeatherForecastResponse(); response.setLocation(req.getLocation()); response.setUnits(req.getUnits()); diff --git a/demos/sample_apps/java/weather_forcecast_service/src/main/java/weather/model/WeatherForecastResponse.java b/demos/sample_apps/java/weather_forcecast_service/src/main/java/weather/model/WeatherForecastResponse.java index 22b35714..3fc4d116 100644 --- a/demos/sample_apps/java/weather_forcecast_service/src/main/java/weather/model/WeatherForecastResponse.java +++ b/demos/sample_apps/java/weather_forcecast_service/src/main/java/weather/model/WeatherForecastResponse.java @@ -5,7 +5,7 @@ import java.util.List; public class WeatherForecastResponse { private String location; private String units; - private List temperature; + private List forecast; // Default Constructor public WeatherForecastResponse() {} @@ -28,10 +28,10 @@ public class WeatherForecastResponse { } public List getDailyForecast() { - return temperature; + return forecast; } - public void setDailyForecas(List forecast) { + public void setDailyForecast(List forecast) { this.forecast = forecast; } } diff --git a/demos/sample_apps/java/weather_forcecast_service/src/main/resources/application.properties b/demos/sample_apps/java/weather_forcecast_service/src/main/resources/application.properties new file mode 100644 index 00000000..4d360de1 --- /dev/null +++ b/demos/sample_apps/java/weather_forcecast_service/src/main/resources/application.properties @@ -0,0 +1 @@ +server.port=8081 diff --git a/demos/sample_apps/network_switch_operator_agent/Dockerfile b/demos/sample_apps/network_switch_operator_agent/Dockerfile new file mode 100644 index 00000000..96600b38 --- /dev/null +++ b/demos/sample_apps/network_switch_operator_agent/Dockerfile @@ -0,0 +1,19 @@ +FROM python:3.12 AS base + +FROM base AS builder + +WORKDIR /src + +COPY requirements.txt /src/ +RUN pip install --prefix=/runtime --force-reinstall -r requirements.txt + +COPY ../. /src + +FROM python:3.12-slim AS output + +COPY --from=builder /runtime /usr/local + +COPY ../. /app +WORKDIR /app + +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80", "--log-level", "info"] diff --git a/demos/sample_apps/python/network_switch_operator_agent/README.md b/demos/sample_apps/network_switch_operator_agent/README.md similarity index 100% rename from demos/sample_apps/python/network_switch_operator_agent/README.md rename to demos/sample_apps/network_switch_operator_agent/README.md diff --git a/demos/sample_apps/python/network_switch_operator_agent/arch_config.yaml b/demos/sample_apps/network_switch_operator_agent/arch_config.yaml similarity index 100% rename from demos/sample_apps/python/network_switch_operator_agent/arch_config.yaml rename to demos/sample_apps/network_switch_operator_agent/arch_config.yaml diff --git a/demos/sample_apps/network_switch_operator_agent/docker-compose.yaml b/demos/sample_apps/network_switch_operator_agent/docker-compose.yaml new file mode 100644 index 00000000..90b5c084 --- /dev/null +++ b/demos/sample_apps/network_switch_operator_agent/docker-compose.yaml @@ -0,0 +1,20 @@ +services: + api_server: + build: + context: . + dockerfile: Dockerfile + ports: + - "18083:80" + + chatbot_ui: + build: + context: ../../shared/chatbot_ui + dockerfile: Dockerfile + ports: + - "18080:8080" + environment: + - CHAT_COMPLETION_ENDPOINT=http://host.docker.internal:10000/v1 + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - ./arch_config.yaml:/app/arch_config.yaml diff --git a/demos/sample_apps/python/network_switch_operator_agent/image.png b/demos/sample_apps/network_switch_operator_agent/image.png similarity index 100% rename from demos/sample_apps/python/network_switch_operator_agent/image.png rename to demos/sample_apps/network_switch_operator_agent/image.png diff --git a/demos/sample_apps/python/network_switch_operator_agent/main.py b/demos/sample_apps/network_switch_operator_agent/main.py similarity index 100% rename from demos/sample_apps/python/network_switch_operator_agent/main.py rename to demos/sample_apps/network_switch_operator_agent/main.py diff --git a/demos/sample_apps/network_switch_operator_agent/requirements.txt b/demos/sample_apps/network_switch_operator_agent/requirements.txt new file mode 100644 index 00000000..8aa2003a --- /dev/null +++ b/demos/sample_apps/network_switch_operator_agent/requirements.txt @@ -0,0 +1,13 @@ +fastapi +uvicorn +pydantic +typing +pandas +gradio==5.3.0 +async_timeout==4.0.3 +loguru==0.7.2 +asyncio==3.4.3 +httpx==0.27.0 +python-dotenv==1.0.1 +pydantic==2.8.2 +openai==1.51.0 diff --git a/demos/sample_apps/python/network_switch_operator_agent/run_demo.sh b/demos/sample_apps/network_switch_operator_agent/run_demo.sh similarity index 100% rename from demos/sample_apps/python/network_switch_operator_agent/run_demo.sh rename to demos/sample_apps/network_switch_operator_agent/run_demo.sh diff --git a/demos/sample_apps/python/stock_quote/README.md b/demos/sample_apps/stock_quote/README.md similarity index 100% rename from demos/sample_apps/python/stock_quote/README.md rename to demos/sample_apps/stock_quote/README.md diff --git a/demos/sample_apps/python/stock_quote/arch_config.yaml b/demos/sample_apps/stock_quote/arch_config.yaml similarity index 100% rename from demos/sample_apps/python/stock_quote/arch_config.yaml rename to demos/sample_apps/stock_quote/arch_config.yaml diff --git a/demos/sample_apps/python/stock_quote/docker-compose.yaml b/demos/sample_apps/stock_quote/docker-compose.yaml similarity index 92% rename from demos/sample_apps/python/stock_quote/docker-compose.yaml rename to demos/sample_apps/stock_quote/docker-compose.yaml index 32cfbd20..babe1169 100644 --- a/demos/sample_apps/python/stock_quote/docker-compose.yaml +++ b/demos/sample_apps/stock_quote/docker-compose.yaml @@ -1,7 +1,7 @@ services: chatbot_ui: build: - context: ../shared/chatbot_ui + context: ../../shared/chatbot_ui ports: - "18080:8080" environment: diff --git a/demos/sample_apps/stock_quote/run_demo.sh b/demos/sample_apps/stock_quote/run_demo.sh new file mode 100644 index 00000000..eb47dce6 --- /dev/null +++ b/demos/sample_apps/stock_quote/run_demo.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -e + +# Function to start the demo +start_demo() { + # Step 1: Check if .env file exists + if [ -f ".env" ]; then + echo ".env file already exists. Skipping creation." + else + # Step 2: Create `.env` file and set OpenAI key + if [ -z "$OPENAI_API_KEY" ]; then + echo "Error: OPENAI_API_KEY environment variable is not set for the demo." + exit 1 + fi + + echo "Creating .env file..." + echo "OPENAI_API_KEY=$OPENAI_API_KEY" > .env + echo ".env file created with OPENAI_API_KEY." + fi + + # Step 3: Start Arch + echo "Starting Arch with arch_config.yaml..." + archgw up arch_config.yaml + + # Step 4: Start developer services + echo "Starting Network Agent using Docker Compose..." + docker compose up -d # Run in detached mode +} + +# Function to stop the demo +stop_demo() { + # Step 1: Stop Docker Compose services + echo "Stopping Network Agent using Docker Compose..." + docker compose down + + # Step 2: Stop Arch + echo "Stopping Arch..." + archgw down +} + +# Main script logic +if [ "$1" == "down" ]; then + stop_demo +else + # Default action is to bring the demo up + start_demo +fi diff --git a/demos/sample_apps/python/stock_quote/stock_quote_demo.png b/demos/sample_apps/stock_quote/stock_quote_demo.png similarity index 100% rename from demos/sample_apps/python/stock_quote/stock_quote_demo.png rename to demos/sample_apps/stock_quote/stock_quote_demo.png diff --git a/demos/sample_apps/python/weather_forecast/Dockerfile b/demos/sample_apps/weather_forecast/Dockerfile similarity index 100% rename from demos/sample_apps/python/weather_forecast/Dockerfile rename to demos/sample_apps/weather_forecast/Dockerfile diff --git a/demos/sample_apps/python/weather_forecast/README.md b/demos/sample_apps/weather_forecast/README.md similarity index 100% rename from demos/sample_apps/python/weather_forecast/README.md rename to demos/sample_apps/weather_forecast/README.md diff --git a/demos/sample_apps/python/weather_forecast/arch_config.yaml b/demos/sample_apps/weather_forecast/arch_config.yaml similarity index 100% rename from demos/sample_apps/python/weather_forecast/arch_config.yaml rename to demos/sample_apps/weather_forecast/arch_config.yaml diff --git a/demos/sample_apps/python/weather_forecast/docker-compose-honeycomb.yaml b/demos/sample_apps/weather_forecast/docker-compose-honeycomb.yaml similarity index 100% rename from demos/sample_apps/python/weather_forecast/docker-compose-honeycomb.yaml rename to demos/sample_apps/weather_forecast/docker-compose-honeycomb.yaml diff --git a/demos/sample_apps/python/weather_forecast/docker-compose-jaeger.yaml b/demos/sample_apps/weather_forecast/docker-compose-jaeger.yaml similarity index 100% rename from demos/sample_apps/python/weather_forecast/docker-compose-jaeger.yaml rename to demos/sample_apps/weather_forecast/docker-compose-jaeger.yaml diff --git a/demos/sample_apps/python/weather_forecast/docker-compose-logfire.yaml b/demos/sample_apps/weather_forecast/docker-compose-logfire.yaml similarity index 100% rename from demos/sample_apps/python/weather_forecast/docker-compose-logfire.yaml rename to demos/sample_apps/weather_forecast/docker-compose-logfire.yaml diff --git a/demos/sample_apps/python/weather_forecast/docker-compose-signoz.yaml b/demos/sample_apps/weather_forecast/docker-compose-signoz.yaml similarity index 100% rename from demos/sample_apps/python/weather_forecast/docker-compose-signoz.yaml rename to demos/sample_apps/weather_forecast/docker-compose-signoz.yaml diff --git a/demos/sample_apps/python/weather_forecast/docker-compose.yaml b/demos/sample_apps/weather_forecast/docker-compose.yaml similarity index 58% rename from demos/sample_apps/python/weather_forecast/docker-compose.yaml rename to demos/sample_apps/weather_forecast/docker-compose.yaml index 15441de3..566dfa8d 100644 --- a/demos/sample_apps/python/weather_forecast/docker-compose.yaml +++ b/demos/sample_apps/weather_forecast/docker-compose.yaml @@ -11,7 +11,7 @@ services: chatbot_ui: build: - context: ../shared/chatbot_ui + context: ../../shared/chatbot_ui ports: - "18080:8080" environment: @@ -19,23 +19,3 @@ services: - CHAT_COMPLETION_ENDPOINT=http://host.docker.internal:10000/v1 extra_hosts: - "host.docker.internal:host-gateway" - volumes: - - ./arch_config.yaml:/app/arch_config.yaml - - jaeger: - build: - context: ../shared/jaeger - ports: - - "16686:16686" - - "4317:4317" - - "4318:4318" - - prometheus: - build: - context: ../shared/prometheus - - grafana: - build: - context: ../shared/grafana - ports: - - "3000:3000" diff --git a/demos/sample_apps/python/weather_forecast/main.py b/demos/sample_apps/weather_forecast/main.py similarity index 100% rename from demos/sample_apps/python/weather_forecast/main.py rename to demos/sample_apps/weather_forecast/main.py diff --git a/demos/sample_apps/python/weather_forecast/poetry.lock b/demos/sample_apps/weather_forecast/poetry.lock similarity index 100% rename from demos/sample_apps/python/weather_forecast/poetry.lock rename to demos/sample_apps/weather_forecast/poetry.lock diff --git a/demos/sample_apps/python/weather_forecast/pyproject.toml b/demos/sample_apps/weather_forecast/pyproject.toml similarity index 100% rename from demos/sample_apps/python/weather_forecast/pyproject.toml rename to demos/sample_apps/weather_forecast/pyproject.toml diff --git a/demos/sample_apps/python/weather_forecast/run_demo.sh b/demos/sample_apps/weather_forecast/run_demo.sh similarity index 100% rename from demos/sample_apps/python/weather_forecast/run_demo.sh rename to demos/sample_apps/weather_forecast/run_demo.sh diff --git a/demos/use_cases/llm_routing/docker-compose.yaml b/demos/use_cases/llm_routing/docker-compose.yaml index ac59499c..219bd6ee 100644 --- a/demos/use_cases/llm_routing/docker-compose.yaml +++ b/demos/use_cases/llm_routing/docker-compose.yaml @@ -2,7 +2,7 @@ services: chatbot_ui: build: - context: ../shared/chatbot_ui + context: ../../shared/chatbot_ui dockerfile: Dockerfile ports: - "18080:8080" diff --git a/demos/use_cases/ollama/docker-compose.yaml b/demos/use_cases/ollama/docker-compose.yaml index 32e52c40..e145f2b4 100644 --- a/demos/use_cases/ollama/docker-compose.yaml +++ b/demos/use_cases/ollama/docker-compose.yaml @@ -1,7 +1,7 @@ services: chatbot_ui: build: - context: ../shared/chatbot_ui + context: ../../shared/chatbot_ui ports: - "18080:8080" environment: