Skip to content

Commit a72e3a8

Browse files
authored
[Traffic Intersection Agent] Removing default models and related docs updates (open-edge-platform#1816)
Signed-off-by: Krishna Murti <krishna.murti@intel.com>
1 parent 98ba694 commit a72e3a8

File tree

6 files changed

+102
-71
lines changed

6 files changed

+102
-71
lines changed

metro-ai-suite/smart-traffic-intersection-agent/docker/agent-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
http_proxy: ${http_proxy}
2121
https_proxy: ${https_proxy}
2222
# VLM Model configuration
23-
VLM_MODEL_NAME: ${VLM_MODEL_NAME:-Qwen/Qwen2.5-VL-3B-Instruct}
23+
VLM_MODEL_NAME: ${VLM_MODEL_NAME}
2424
VLM_COMPRESSION_WEIGHT_FORMAT: ${VLM_COMPRESSION_WEIGHT_FORMAT:-int4}
2525
VLM_DEVICE: ${VLM_DEVICE:-CPU}
2626
VLM_SEED: ${VLM_SEED:-42}
@@ -87,7 +87,7 @@ services:
8787
WEATHER_MOCK: ${WEATHER_MOCK:-false}
8888

8989
# VLM configuration (overrides src/config/traffic_agent.json)
90-
VLM_MODEL_NAME: ${VLM_MODEL_NAME:-Qwen/Qwen2.5-VL-3B-Instruct}
90+
VLM_MODEL_NAME: ${VLM_MODEL_NAME}
9191
VLM_TIMEOUT_SECONDS: ${VLM_TIMEOUT_SECONDS:-}
9292
VLM_MAX_COMPLETION_TOKENS: ${VLM_MAX_COMPLETION_TOKENS:-}
9393
VLM_TEMPERATURE: ${VLM_TEMPERATURE:-}

metro-ai-suite/smart-traffic-intersection-agent/docs/user-guide/get-started.md

Lines changed: 79 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ git clone https://github.com/open-edge-platform/edge-ai-suites.git
4040
cd metro-ai-suite/smart-traffic-intersection-agent/
4141
```
4242

43-
### 2. Run the Complete Setup
43+
### 2. Set the required environment variables
44+
45+
```bash
46+
export VLM_MODEL_NAME=<supported_model_name> # eg. microsoft/Phi-3.5-vision-instruct, Qwen/Qwen2.5-VL-3B-Instruct
47+
```
48+
> **IMPORTANT:** See this [disclaimer](#disclaimer-for-using-third-party-ai-models) before using any AI Model.
49+
50+
### 3. Run the Complete Setup
4451

4552
The easiest way to set up the service is to use default configurations without making any
4653
changes. Run the setup script with the `--setup` option to set up the agent quickly with
@@ -59,7 +66,7 @@ This single command will:
5966
- Build Docker images
6067
- Start services in the Smart Traffic Intersection Agent's application stack
6168

62-
### 3. Run alternative setup options
69+
### 4. Run alternative setup options
6370

6471
For a more granular control, run these commands:
6572

@@ -83,7 +90,7 @@ source setup.sh --restart [service_type]
8390
source setup.sh --clean [option]
8491
```
8592

86-
### 4. Access Services
93+
### 5. Access Services
8794

8895
When the script completes, it will show the URLs to access the services. Go to these URLs so
8996
that the respective services can access them in a web browser.
@@ -103,81 +110,92 @@ locations on the same machine for `n` required instances.
103110
104111
### Set up Instance #1
105112

106-
1. Clone the repository into a new directory:
113+
1. Clone the repository into a new directory:
107114

108-
```bash
109-
# First instance
110-
git clone --depth 1 https://github.com/open-edge-platform/edge-ai-suites.git edge-ai-suites-instance1
111-
cd edge-ai-suites-instance1/metro-ai-suite/smart-traffic-intersection-agent/
112-
```
115+
```bash
116+
git clone --depth 1 https://github.com/open-edge-platform/edge-ai-suites.git edge-ai-suites-instance1
117+
cd edge-ai-suites-instance1/metro-ai-suite/smart-traffic-intersection-agent/
118+
```
113119

114-
2. Edit the deployment configuration file for instance #1:
120+
2. Edit the deployment configuration file for instance #1:
115121

116-
```bash
117-
nano src/config/deployment_instance.json
118-
```
122+
```bash
123+
nano src/config/deployment_instance.json
124+
```
119125

120-
Update the `latitude` and `longitude` values as required. If not required, use the default
121-
values without updating this config file. Following is a sample value for the Instance #1
122-
deployment config:
123-
124-
```json
125-
{
126-
"name": "intersection_1",
127-
"latitude": 37.7049108,
128-
"longitude": -121.9096158,
129-
"agent_backend_port": "8081",
130-
"agent_ui_port": "7860"
131-
}
132-
```
126+
Update `name`, `latitude` and `longitude` values as required. Following is a sample value for the Instance #1 deployment config:
133127

134-
3. Run the setup for instance #1:
128+
```json
129+
{
130+
"name": "intersection_1",
131+
"latitude": 37.5879818,
132+
"longitude": -122.0534334,
133+
"agent_backend_port": "8081",
134+
"agent_ui_port": "7860"
135+
}
136+
```
135137

136-
```bash
137-
source setup.sh --setup
138-
```
138+
> **TIPS:** Leave `agent_backend_port` and `agent_ui_port` empty to avoid port conflicts. Random ports would be assigned and application URLs with assigned ports will be shown when setup finishes.
139+
140+
3. Set the required environment variable.
141+
142+
```bash
143+
export VLM_MODEL_NAME=<supported_model_name> # eg. microsoft/Phi-3.5-vision-instruct, Qwen/Qwen2.5-VL-3B-Instruct
144+
```
145+
> **IMPORTANT:** See this [disclaimer](#disclaimer-for-using-third-party-ai-models) before using any AI Model.
146+
147+
4. Run the setup for instance #1:
148+
149+
```bash
150+
source setup.sh --setup
151+
```
139152

140153
### Set up Instance #2
141154

142-
1. Clone the repository into a new directory:
155+
1. Open a new terminal window and move to new directory. Clone the repository into the new directory:
143156

144-
Open a new terminal window and move to different directory and run the following.
157+
```bash
158+
git clone --depth 1 https://github.com/open-edge-platform/edge-ai-suites.git edge-ai-suites-instance2
159+
cd edge-ai-suites-instance2/metro-ai-suite/smart-traffic-intersection-agent/
160+
```
145161

146-
```bash
147-
git clone --depth 1 https://github.com/open-edge-platform/edge-ai-suites.git edge-ai-suites-instance2
148-
cd edge-ai-suites-instance2/metro-ai-suite/smart-traffic-intersection-agent/
149-
```
162+
2. Edit the deployment configuration for instance #2:
150163

151-
2. Edit the deployment configuration for instance #2:
164+
```bash
165+
nano src/config/deployment_instance.json
166+
```
152167

153-
```bash
154-
nano src/config/deployment_instance.json
155-
```
168+
The following is a sample value for instance #2 deployment configuration:
156169

157-
The following is a sample value for instance #2 deployment configuration:
170+
```json
171+
{
172+
"name": "intersection_2",
173+
"latitude": 37.33874,
174+
"longitude": -121.8852525,
175+
"agent_backend_port": "8082",
176+
"agent_ui_port": "7861"
177+
}
178+
```
158179

159-
```json
160-
{
161-
"name": "intersection_2",
162-
"latitude": 37.33874,
163-
"longitude": -121.8852525,
164-
"agent_backend_port": "8082",
165-
"agent_ui_port": "7861"
166-
}
167-
```
168-
3. Run Setup for Instance #2
180+
> **TIPS:** Leave `agent_backend_port` and `agent_ui_port` empty to avoid port conflicts. Random ports would be assigned and application URLs with assigned ports will be shown when setup finishes.
169181

170-
```bash
171-
source setup.sh --setup
172-
```
182+
3. Set the required environment variable.
183+
184+
```bash
185+
export VLM_MODEL_NAME=<supported_model_name> # eg. microsoft/Phi-3.5-vision-instruct, Qwen/Qwen2.5-VL-3B-Instruct
186+
```
187+
> **IMPORTANT:** See this [disclaimer](#disclaimer-for-using-third-party-ai-models) before using any AI Model.
188+
189+
4. Run Setup for Instance #2
173190

174-
> **Note:** Keep the `agent_backend_port` and `agent_ui_port` values empty to use random
175-
> ephemeral ports and avoid port conflicts.
191+
```bash
192+
source setup.sh --setup
193+
```
176194

177195
Ensure each instance has their `deployment_instance.json` updated with:
178196

179197
- A unique value for `name` field
180-
- Unique latitude and longitude co-ordinates
198+
- Unique `latitude` and `longitude` co-ordinates
181199
- Different `agent_backend_port` and `agent_ui_port` values to avoid port conflicts. This is
182200
optional. If not specified, an ephemeral port is picked automatically.
183201

@@ -191,6 +209,10 @@ are reached. Hence, deploy new instances only if you have the required resource
191209
To spin-up more instances - say `n number of new instances`, repeat the steps mentioned in
192210
[Set up Instance #2](#set-up-instance-2), by changing to a new directory `n` times.
193211

212+
### Disclaimer for Using Third-Party AI Models
213+
214+
Compliance with all license obligations and responsible use for a third-party AI Model is the user’s responsibility.
215+
194216
## Advanced Environment Configuration
195217

196218
For advanced users who need more control over the configuration, you can configure the following environment variables before running the setup script to override the default behaviour:
@@ -202,9 +224,6 @@ export LOG_LEVEL=DEBUG
202224
# Select iGPU as the accelerator to perform VLM inference. By default, it is set to CPU
203225
export VLM_DEVICE=GPU
204226
205-
# Change the VLM Model name. Default value set in setup.sh is microsoft/Phi-3.5-vision-instruct.
206-
export VLM_MODEL_NAME=Qwen/Qwen2.5-VL-3B-Instruct
207-
208227
# Other VLM related config, sample values
209228
export VLM_TIMEOUT_SECONDS=600 # Default 300
210229
export VLM_MAX_COMPLETION_TOKENS=1000 # Default 1500

metro-ai-suite/smart-traffic-intersection-agent/docs/user-guide/get-started/build-from-source.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,22 @@ git clone https://github.com/open-edge-platform/edge-ai-suites.git
1717
cd edge-ai-suites/metro-ai-suite/smart-traffic-intersection-agent/
1818
```
1919

20-
### 2. Build the Docker Image
20+
### 2. Set the required environment variables
21+
22+
```bash
23+
export VLM_MODEL_NAME=<supported_model_name> # eg. microsoft/Phi-3.5-vision-instruct, Qwen/Qwen2.5-VL-3B-Instruct
24+
```
25+
> **IMPORTANT:** See this [disclaimer](../get-started.md#disclaimer-for-using-third-party-ai-models) before using any AI Model.
26+
27+
### 3. Build the Docker Image
2128

2229
Build the Traffic Intersection Agent:
2330

2431
```bash
2532
docker compose -f docker/agent-compose.yaml build traffic-agent
2633
```
2734

28-
### 3. Run the Service
35+
### 4. Run the Service
2936

3037
```bash
3138
# Using setup script (recommended)

metro-ai-suite/smart-traffic-intersection-agent/setup.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ fi
127127
# Dependencies: Setup Smart Intersection RI before running the agent Backend/UI
128128
# ============================================================================
129129

130+
# Check if VLM Model name is set or not
131+
if [ -z "$VLM_MODEL_NAME" ]; then
132+
echo -e "${RED}Error: VLM_MODEL_NAME environment variable is not set. Please check docs for some possible VLM model names.${NC}"
133+
return 1
134+
fi
135+
130136
export SAMPLE_APP="smart-intersection"
131137
SUBMODULE="deps/metro-vision"
132138
SUBMODULE_PATH="$APP_DIR/$SUBMODULE"
@@ -206,7 +212,7 @@ export VIDEO_GROUP_ID=$(getent group video | awk -F: '{printf "%s\n", $3}' 2>/de
206212
export RENDER_GROUP_ID=$(getent group render | awk -F: '{printf "%s\n", $3}' 2>/dev/null || echo "109")
207213

208214
# VLM Service Configuration
209-
export VLM_MODEL_NAME=${VLM_MODEL_NAME:-microsoft/Phi-3.5-vision-instruct}
215+
export VLM_MODEL_NAME=${VLM_MODEL_NAME}
210216

211217
# VLM OpenVINO Configuration
212218
export VLM_DEVICE=${VLM_DEVICE:-CPU}
@@ -263,11 +269,11 @@ print_all_service_host_endpoints() {
263269
*traffic-agent*)
264270
BACKEND_SERVICE_NAME="Traffic Intersection Agent API Docs"
265271
PORT=$(docker port "$CONTAINER_NAME" 8081 | cut -d: -f2)
266-
echo -e "${BLUE}Access $BACKEND_SERVICE_NAME -> http://$HOST_IP:$PORT/docs${NC}"
272+
echo -e "${CYAN}Access $BACKEND_SERVICE_NAME -> http://$HOST_IP:$PORT/docs${NC}"
267273

268274
UI_SERVICE_NAME="Traffic Intersection Agent UI"
269275
PORT=$(docker port "$CONTAINER_NAME" 7860 | cut -d: -f2)
270-
echo -e "${BLUE}Access $UI_SERVICE_NAME -> http://$HOST_IP:$PORT${NC}"
276+
echo -e "${CYAN}Access $UI_SERVICE_NAME -> http://$HOST_IP:$PORT${NC}"
271277
;;
272278
*vlm*)
273279
SERVICE_NAME="VLM OpenVINO Serving API"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "intersection_1",
3-
"latitude": 33.3091336,
4-
"longitude": -111.9353095,
3+
"latitude": 37.51358,
4+
"longitude": -122.25591,
55
"agent_backend_port": "",
66
"agent_ui_port": ""
77
}

metro-ai-suite/smart-traffic-intersection-agent/src/docker-entrypoint.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ echo "========================================"
1515
export REFRESH_INTERVAL=${REFRESH_INTERVAL:-15}
1616
export LOG_LEVEL=${LOG_LEVEL:-INFO}
1717
export WEATHER_MOCK=${WEATHER_MOCK:-false}
18-
export VLM_MODEL=${VLM_MODEL:-Qwen/Qwen2.5-VL-3B-Instruct}
1918
export HIGH_DENSITY_THRESHOLD=${HIGH_DENSITY_THRESHOLD:-10}
2019
export USE_API=${USE_API:-true}
2120

@@ -26,7 +25,7 @@ echo "INTERSECTION_NAME: ${INTERSECTION_NAME}"
2625
echo "INTERSECTION_LATITUDE: ${INTERSECTION_LATITUDE}"
2726
echo "INTERSECTION_LONGITUDE: ${INTERSECTION_LONGITUDE}"
2827
echo "WEATHER_MOCK: ${WEATHER_MOCK}"
29-
echo "VLM_MODEL: ${VLM_MODEL}"
28+
echo "VLM_MODEL_NAME: ${VLM_MODEL_NAME}"
3029
echo "HIGH_DENSITY_THRESHOLD: ${HIGH_DENSITY_THRESHOLD}"
3130
echo "========================================"
3231

0 commit comments

Comments
 (0)