33# Copyright (C) 2024 Intel Corporation
44# SPDX-License-Identifier: Apache-2.0
55
6- # Navigate to the parent directory and source the environment
6+ # ==============================================================================
7+ # Environment Configuration for DeepResearchAgent on Intel Gaudi HPU
8+ # ==============================================================================
9+
10+ # Get the directory where this script is located
711SCRIPT_DIR=" $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd) "
812
13+ # Source the parent environment configuration file
914pushd " $SCRIPT_DIR /../../../../../" > /dev/null
1015source .set_env.sh
1116popd > /dev/null
1217
13- # Function to check if a variable is set
18+ # ------------------------------------------------------------------------------
19+ # Helper Functions
20+ # ------------------------------------------------------------------------------
21+
22+ # Validates that a required environment variable is set
1423check_var () {
1524 local var_name=" $1 "
1625 local var_value=" ${! var_name} "
1726 if [ -z " ${var_value} " ]; then
1827 echo " Error: ${var_name} is not set. Please set ${var_name} ."
19- return 1 # Return an error code but do not exit the script
28+ return 1 # Return error but don't exit to allow other checks to run
2029 fi
2130}
2231
23- # Check critical variables
24- check_var " HF_TOKEN"
32+ # ------------------------------------------------------------------------------
33+ # Validate Required API Keys
34+ # ------------------------------------------------------------------------------
35+
36+ check_var " HF_TOKEN" # HuggingFace token for model access
37+ check_var " TAVILY_API_KEY" # Tavily API key for web search functionality
38+
39+ # ------------------------------------------------------------------------------
40+ # Network Configuration
41+ # ------------------------------------------------------------------------------
42+
43+ # Detect the primary IP address of the host machine
2544export ip_address=$( hostname -I | awk ' {print $1}' )
45+ export HOST_IP=${ip_address}
2646
27- # VLLM configuration
47+ # Update proxy settings to include the host IP
48+ export no_proxy=${no_proxy} ,${ip_address}
49+ export http_proxy=${http_proxy}
50+ export https_proxy=${https_proxy}
51+
52+ # ------------------------------------------------------------------------------
53+ # vLLM Service Configuration
54+ # ------------------------------------------------------------------------------
55+
56+ # Port where vLLM service will be accessible
2857export VLLM_PORT=" ${VLLM_PORT:- 8000} "
29- export VLLM_VOLUME=" ${VLLM_VOLUME:-/ data2/ huggingface} "
30- export VLLM_IMAGE=" ${VLLM_IMAGE:- opea/ vllm-gaudi: latest} "
58+
59+ # ------------------------------------------------------------------------------
60+ # Language Model Configuration
61+ # ------------------------------------------------------------------------------
62+
63+ # LLM model to use for the Deep Research Agent
64+ # See supported models and tool call parsers at:
65+ # https://docs.vllm.ai/en/stable/features/tool_calling/#automatic-function-calling
3166export LLM_MODEL_ID=" ${LLM_MODEL_ID:- meta-llama/ Llama-3.3-70B-Instruct} "
67+
68+ # Parser for handling function/tool calls (must match the model)
69+ export TOOL_CALL_PARSER=" ${TOOL_CALL_PARSER:- llama3_json} "
70+
71+ # Maximum sequence length for model context (131072 = ~128K tokens)
3272export MAX_LEN=" ${MAX_LEN:- 131072} "
73+
74+ # Number of Gaudi accelerator cards to use
3375export NUM_CARDS=" ${NUM_CARDS:- 4} "
76+
77+ # Directory for caching HuggingFace models
3478export HF_CACHE_DIR=" ${HF_CACHE_DIR:- " ./data" } "
35- export OPENAI_BASE_URL=" http://${ip_address} :8000/v1"
36- export OPENAI_API_KEY=" empty"
37- export no_proxy=${no_proxy}
38- export http_proxy=${http_proxy}
39- export https_proxy=${https_proxy}
4079
80+ # OpenAI-compatible API endpoint URL for vLLM
81+ export OPENAI_BASE_URL=" http://${ip_address} :${VLLM_PORT} /v1"
82+
83+ # ------------------------------------------------------------------------------
84+ # API Keys and Authentication
85+ # ------------------------------------------------------------------------------
86+
87+ export HF_TOKEN=" ${HF_TOKEN} " # HuggingFace authentication token
88+ export OPENAI_API_KEY=" empty-api-key" # Placeholder for vLLM compatibility
89+ export TAVILY_API_KEY=" ${TAVILY_API_KEY} " # Tavily search API key
90+
91+ # ------------------------------------------------------------------------------
92+ # Deep Research Agent Configuration
93+ # ------------------------------------------------------------------------------
94+
95+ # Maximum number of research units that can run concurrently
96+ export MAX_CONCURRENT_RESEARCH_UNITS=" ${MAX_CONCURRENT_RESEARCH_UNITS:- 3} "
4197
42- # Hugging Face API token
43- export HF_TOKEN =" ${HF_TOKEN } "
98+ # Maximum iterations per researcher before stopping
99+ export MAX_RESEARCHER_ITERATIONS =" ${MAX_RESEARCHER_ITERATIONS :- 3 } "
44100
45- # API keys
46- check_var " TAVILY_API_KEY"
47- export TAVILY_API_KEY=" ${TAVILY_API_KEY} "
101+ # Custom instructions for agent behavior (leave empty for defaults)
102+ export RESEARCHER_INSTRUCTIONS=" " # Instructions for individual researchers
103+ export RESEARCH_WORKFLOW_INSTRUCTIONS=" " # Instructions for overall research workflow
104+ export SUBAGENT_DELEGATION_INSTRUCTIONS=" " # Instructions for task delegation between agents
0 commit comments