+ |
+ Agent0-VL-7B (Ours)
+ Ours
+ |
53.1 |
37.3 |
75.6 |
@@ -710,8 +713,11 @@
- | Agent0-VL-8B (Ours) |
+
+ |
+ Agent0-VL-8B (Ours)
+ SOTA
+ |
65.5 |
56.2 |
83.7 |
diff --git a/scripts/audit_code.sh b/scripts/audit_code.sh
new file mode 100755
index 0000000..deba47c
--- /dev/null
+++ b/scripts/audit_code.sh
@@ -0,0 +1,132 @@
+#!/bin/bash
+# Agent0 Code Audit Script
+# Usage: ./scripts/audit_code.sh [audit_type]
+
+set -e
+set -o pipefail
+
+AUDIT_TYPE=${1:-"all"}
+BASE_DIR=$(cd "$(dirname "$0")/.." && pwd)/Agent0
+
+echo "๐ Agent0 Code Audit"
+echo "===================="
+echo ""
+
+# Install audit tools if needed
+install_audit_tools() {
+ echo "๐ฆ Installing audit tools..."
+ pip install --quiet pylint black flake8 bandit safety 2>/dev/null || {
+ echo "โ ๏ธ Some tools may already be installed"
+ }
+}
+
+case $AUDIT_TYPE in
+ "all")
+ install_audit_tools
+ $0 security
+ $0 quality
+ $0 dependencies
+ ;;
+
+ "security")
+ echo "๐ Security Audit"
+ echo "----------------"
+
+ if command -v bandit &> /dev/null; then
+ echo "Running Bandit security scan..."
+ bandit -r "$BASE_DIR" -ll -f json -o /tmp/bandit_report.json 2>/dev/null || {
+ echo "โ ๏ธ Security issues found. Check /tmp/bandit_report.json"
+ }
+ echo "โ
Security scan complete"
+ else
+ echo "โ ๏ธ Bandit not installed. Install with: pip install bandit"
+ fi
+ echo ""
+
+ if command -v safety &> /dev/null; then
+ echo "Checking for known vulnerabilities..."
+ safety check --json 2>/dev/null || {
+ echo "โ ๏ธ Vulnerable packages found"
+ }
+ echo "โ
Dependency vulnerability check complete"
+ else
+ echo "โ ๏ธ Safety not installed. Install with: pip install safety"
+ fi
+ echo ""
+ ;;
+
+ "quality")
+ echo "๐ Code Quality Audit"
+ echo "--------------------"
+
+ if command -v black &> /dev/null; then
+ echo "Checking code formatting with Black..."
+ black --check --diff "$BASE_DIR" 2>/dev/null || {
+ echo "โ ๏ธ Code formatting issues found"
+ }
+ echo "โ
Formatting check complete"
+ else
+ echo "โ ๏ธ Black not installed"
+ fi
+ echo ""
+
+ if command -v flake8 &> /dev/null; then
+ echo "Running Flake8 linting..."
+ flake8 "$BASE_DIR" --max-line-length=120 --exclude=venv,__pycache__,*.egg-info --count --statistics 2>/dev/null || {
+ echo "โ ๏ธ Linting issues found"
+ }
+ echo "โ
Linting complete"
+ else
+ echo "โ ๏ธ Flake8 not installed"
+ fi
+ echo ""
+
+ if command -v pylint &> /dev/null; then
+ echo "Running Pylint analysis..."
+ pylint "$BASE_DIR" --disable=all --enable=E,W --max-line-length=120 2>/dev/null | head -50 || {
+ echo "โ ๏ธ Code quality issues found"
+ }
+ echo "โ
Pylint analysis complete"
+ else
+ echo "โ ๏ธ Pylint not installed"
+ fi
+ echo ""
+ ;;
+
+ "dependencies")
+ echo "๐ฆ Dependency Audit"
+ echo "-------------------"
+
+ echo "Checking for outdated packages..."
+ pip list --outdated 2>/dev/null | head -20 || {
+ echo "โ ๏ธ Could not check outdated packages"
+ }
+ echo ""
+
+ echo "Checking for duplicate dependencies..."
+ # Check for version conflicts in requirements files
+ if [ -f "$BASE_DIR/requirements.txt" ]; then
+ echo "Main requirements:"
+ duplicates=$(grep -E "^[a-zA-Z]" "$BASE_DIR/requirements.txt" | cut -d'=' -f1 | sort | uniq -d)
+ if [ -z "$duplicates" ]; then
+ echo " โ
No duplicates found"
+ else
+ echo " โ ๏ธ Duplicates found: $duplicates"
+ fi
+ fi
+ echo ""
+
+ echo "Checking license compatibility..."
+ echo "โ ๏ธ Manual license check recommended"
+ echo " Verify all dependencies are compatible with Apache 2.0"
+ echo ""
+ ;;
+
+ *)
+ echo "Unknown audit type: $AUDIT_TYPE"
+ echo "Available types: all, security, quality, dependencies"
+ exit 1
+ ;;
+esac
+
+echo "โ
Audit complete!"
diff --git a/scripts/debug_helper.sh b/scripts/debug_helper.sh
new file mode 100755
index 0000000..3e3f709
--- /dev/null
+++ b/scripts/debug_helper.sh
@@ -0,0 +1,156 @@
+#!/bin/bash
+# Agent0 Debug Helper Script
+# Usage: ./scripts/debug_helper.sh [command] [args...]
+
+set -e
+
+COMMAND=${1:-"help"}
+BASE_DIR="/workspace/Agent0"
+
+case $COMMAND in
+ "help")
+ echo "๐ Agent0 Debug Helper"
+ echo "======================"
+ echo ""
+ echo "Usage: ./scripts/debug_helper.sh [command] [args...]"
+ echo ""
+ echo "Commands:"
+ echo " gpu-status - Show GPU status and memory usage"
+ echo " ray-status - Check Ray cluster status"
+ echo " check-logs - Show recent log files"
+ echo " test-sandbox - Test SandboxFusion connection"
+ echo " test-vllm - Test vLLM server connection"
+ echo " memory-profile - Profile memory usage"
+ echo " check-config - Validate configuration files"
+ echo ""
+ ;;
+
+ "gpu-status")
+ echo "๐ฎ GPU Status"
+ echo "------------"
+ nvidia-smi --query-gpu=index,name,memory.used,memory.total,utilization.gpu --format=csv,noheader,nounits || {
+ echo "โ ๏ธ nvidia-smi not available (may not have GPU)"
+ }
+ ;;
+
+ "ray-status")
+ echo "โ๏ธ Ray Cluster Status"
+ echo "---------------------"
+ python3 -c "
+import ray
+try:
+ ray.init(address='auto', ignore_reinit_error=True)
+ print('โ
Ray connected')
+ print(f'Nodes: {len(ray.nodes())}')
+ print(f'Resources: {ray.available_resources()}')
+except Exception as e:
+ print(f'โ ๏ธ Ray not initialized: {e}')
+ print('Start Ray with: ray start --head')
+" || echo "โ ๏ธ Ray check failed"
+ ;;
+
+ "check-logs")
+ echo "๐ Recent Logs"
+ echo "-------------"
+ LOG_DIRS=(
+ "$BASE_DIR/curriculum_train"
+ "$BASE_DIR/executor_train"
+ )
+
+ for dir in "${LOG_DIRS[@]}"; do
+ if [ -d "$dir" ]; then
+ echo "Logs in $dir:"
+ find "$dir" -name "*.log" -type f -mtime -1 2>/dev/null | head -5 | grep . || echo " No recent logs"
+ fi
+ done
+ ;;
+
+ "test-sandbox")
+ SANDBOX_URL=${2:-"http://localhost:8000/run_code"}
+ echo "๐งช Testing SandboxFusion"
+ echo "-----------------------"
+ echo "URL: $SANDBOX_URL"
+
+ curl -X POST "$SANDBOX_URL" \
+ -H "Content-Type: application/json" \
+ -d '{"code": "print(1+1)", "language": "python"}' \
+ -w "\nHTTP Status: %{http_code}\n" || {
+ echo "โ Sandbox connection failed"
+ echo "Make sure SandboxFusion is running"
+ }
+ ;;
+
+ "test-vllm")
+ VLLM_URL=${2:-"http://localhost:8000/v1/completions"}
+ echo "๐ Testing vLLM Server"
+ echo "---------------------"
+ echo "URL: $VLLM_URL"
+
+ curl -X POST "$VLLM_URL" \
+ -H "Content-Type: application/json" \
+ -d '{"model": "test", "prompt": "Hello", "max_tokens": 10}' \
+ -w "\nHTTP Status: %{http_code}\n" || {
+ echo "โ vLLM connection failed"
+ echo "Make sure vLLM server is running"
+ }
+ ;;
+
+ "memory-profile")
+ echo "๐พ Memory Profiling"
+ echo "-------------------"
+ python3 -c "
+import torch
+import psutil
+import os
+
+process = psutil.Process(os.getpid())
+mem_info = process.memory_info()
+print(f'Process Memory: {mem_info.rss / 1024 / 1024:.2f} MB')
+
+if torch.cuda.is_available():
+ for i in range(torch.cuda.device_count()):
+ print(f'GPU {i} Memory:')
+ print(f' Allocated: {torch.cuda.memory_allocated(i) / 1024**3:.2f} GB')
+ print(f' Reserved: {torch.cuda.memory_reserved(i) / 1024**3:.2f} GB')
+else:
+ print('โ ๏ธ CUDA not available')
+"
+ ;;
+
+ "check-config")
+ echo "โ๏ธ Configuration Check"
+ echo "----------------------"
+
+ # Check environment variables
+ echo "Environment Variables:"
+ for var in STORAGE_PATH HUGGINGFACENAME WANDB_API_KEY; do
+ if [ -n "${!var}" ]; then
+ echo " โ
$var is set"
+ else
+ echo " โ ๏ธ $var is not set"
+ fi
+ done
+ echo ""
+
+ # Check config files
+ echo "Configuration Files:"
+ CONFIG_FILES=(
+ "$BASE_DIR/curriculum_train/vllm_service_init/start_vllm_server_tool.py"
+ "$BASE_DIR/curriculum_train/scripts/curriculum_train.sh"
+ )
+
+ for file in "${CONFIG_FILES[@]}"; do
+ if [ -f "$file" ]; then
+ echo " โ
$(basename $file) exists"
+ else
+ echo " โ $(basename $file) missing"
+ fi
+ done
+ ;;
+
+ *)
+ echo "Unknown command: $COMMAND"
+ $0 help
+ exit 1
+ ;;
+esac
diff --git a/scripts/explore_codebase.sh b/scripts/explore_codebase.sh
new file mode 100755
index 0000000..d568758
--- /dev/null
+++ b/scripts/explore_codebase.sh
@@ -0,0 +1,92 @@
+#!/bin/bash
+# Agent0 Codebase Explorer Script
+# Usage: ./scripts/explore_codebase.sh [component]
+
+set -e
+
+COMPONENT=${1:-"all"}
+BASE_DIR="/workspace/Agent0"
+
+echo "๐ Agent0 Codebase Explorer"
+echo "============================"
+echo ""
+
+case $COMPONENT in
+ "all")
+ echo "๐ Overall Statistics"
+ echo "---------------------"
+ echo "Python files: $(find $BASE_DIR -name "*.py" | wc -l)"
+ echo "Shell scripts: $(find $BASE_DIR -name "*.sh" | wc -l)"
+ echo "Config files: $(find $BASE_DIR -name "*.yaml" | wc -l)"
+ echo ""
+
+ echo "๐๏ธ Key Components"
+ echo "-----------------"
+ echo "Curriculum Training:"
+ find $BASE_DIR/curriculum_train -maxdepth 2 -type d | head -10
+ echo ""
+ echo "Executor Training:"
+ find $BASE_DIR/executor_train -maxdepth 2 -type d | head -10
+ echo ""
+
+ echo "๐ Entry Points"
+ echo "---------------"
+ grep -r "if __name__" $BASE_DIR --include="*.py" | head -10
+ echo ""
+ ;;
+
+ "training")
+ echo "๐ Training Scripts"
+ echo "-------------------"
+ find $BASE_DIR -name "*train*.sh" -type f
+ echo ""
+
+ echo "๐ Training Configs"
+ echo "------------------"
+ find $BASE_DIR -name "*.yaml" -path "*/train*" -o -name "*config*.yaml" | head -20
+ echo ""
+ ;;
+
+ "tools")
+ echo "๐ง Tool Servers"
+ echo "--------------"
+ find $BASE_DIR/executor_train/verl_tool/servers -name "*.py" -type f | grep -v test | grep -v __pycache__
+ echo ""
+
+ echo "๐งช Tool Tests"
+ echo "-------------"
+ find $BASE_DIR/executor_train/verl_tool/servers/tests -name "test_*.py" -type f
+ echo ""
+ ;;
+
+ "evaluation")
+ echo "๐ Evaluation Components"
+ echo "-----------------------"
+ find $BASE_DIR -path "*/eval*" -name "*.py" -type f | head -20
+ echo ""
+
+ echo "๐ Evaluation Scripts"
+ echo "--------------------"
+ find $BASE_DIR -name "*evaluate*.sh" -o -name "*evaluate*.py" | head -10
+ echo ""
+ ;;
+
+ "dependencies")
+ echo "๐ฆ Dependencies"
+ echo "--------------"
+ echo "Main requirements:"
+ cat $BASE_DIR/requirements.txt | head -20
+ echo ""
+ echo "Curriculum requirements:"
+ cat $BASE_DIR/curriculum_train/requirements.txt | head -20
+ echo ""
+ ;;
+
+ *)
+ echo "Unknown component: $COMPONENT"
+ echo "Available components: all, training, tools, evaluation, dependencies"
+ exit 1
+ ;;
+esac
+
+echo "โ
Exploration complete!"
diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh
new file mode 100755
index 0000000..9bb367e
--- /dev/null
+++ b/scripts/run_tests.sh
@@ -0,0 +1,92 @@
+#!/bin/bash
+# Agent0 Test Runner Script
+# Usage: ./scripts/run_tests.sh [test_type]
+
+set -e
+
+TEST_TYPE=${1:-"unit"}
+BASE_DIR="/workspace/Agent0"
+
+echo "๐งช Agent0 Test Runner"
+echo "====================="
+echo ""
+
+case $TEST_TYPE in
+ "unit")
+ echo "๐ Running Unit Tests"
+ echo "---------------------"
+
+ # VeRL unit tests
+ if [ -d "$BASE_DIR/executor_train/verl/tests" ]; then
+ echo "Running VeRL unit tests..."
+ cd $BASE_DIR/executor_train/verl
+ python3 -m pytest tests/ -v -k "not gpu" --tb=short -x || {
+ echo "โ ๏ธ Some VeRL tests failed (this may be expected)"
+ }
+ cd - > /dev/null
+ echo ""
+ fi
+
+ # Tool server tests
+ if [ -d "$BASE_DIR/executor_train/verl_tool/servers/tests" ]; then
+ echo "Running tool server tests..."
+ cd $BASE_DIR/executor_train/verl_tool/servers/tests
+ python3 -m pytest test_*.py -v --tb=short -x || {
+ echo "โ ๏ธ Some tool tests failed (may require external services)"
+ }
+ cd - > /dev/null
+ echo ""
+ fi
+
+ # Evaluation service tests
+ if [ -d "$BASE_DIR/executor_train/eval_service/test" ]; then
+ echo "Running evaluation service tests..."
+ cd $BASE_DIR/executor_train/eval_service/test
+ python3 -m pytest test_*.py -v --tb=short -x || {
+ echo "โ ๏ธ Some evaluation tests failed"
+ }
+ cd - > /dev/null
+ echo ""
+ fi
+ ;;
+
+ "integration")
+ echo "๐ Running Integration Tests"
+ echo "----------------------------"
+ echo "โ ๏ธ Integration tests require GPU and external services"
+ echo "Skipping for now..."
+ ;;
+
+ "quick")
+ echo "โก Running Quick Tests"
+ echo "---------------------"
+
+ # Quick import tests
+ echo "Testing imports..."
+ python3 -c "
+import torch
+import transformers
+import ray
+print('โ
Core imports OK')
+" || exit 1
+
+ # Quick VeRL import
+ cd $BASE_DIR/executor_train/verl 2>/dev/null && python3 -c "import verl; print('โ
VeRL import OK')" || echo "โ ๏ธ VeRL not installed"
+ echo ""
+ ;;
+
+ "all")
+ echo "๐ Running All Tests"
+ echo "-------------------"
+ $0 unit
+ $0 integration
+ ;;
+
+ *)
+ echo "Unknown test type: $TEST_TYPE"
+ echo "Available types: unit, integration, quick, all"
+ exit 1
+ ;;
+esac
+
+echo "โ
Test run complete!"
diff --git a/scripts/validate_build.sh b/scripts/validate_build.sh
new file mode 100755
index 0000000..ae1d596
--- /dev/null
+++ b/scripts/validate_build.sh
@@ -0,0 +1,130 @@
+#!/bin/bash
+# Agent0 Build Validation Script
+# Usage: ./scripts/validate_build.sh
+
+set -e
+
+echo "๐๏ธ Agent0 Build Validation"
+echo "==========================="
+echo ""
+
+# Check Python version
+echo "๐ Python Version Check"
+python3 --version
+if [ $? -ne 0 ]; then
+ echo "โ Python not found"
+ exit 1
+fi
+echo "โ
Python OK"
+echo ""
+
+# Check CUDA availability
+echo "๐ฎ CUDA Check"
+python3 -c "import torch; print(f'PyTorch: {torch.__version__}'); print(f'CUDA Available: {torch.cuda.is_available()}'); print(f'CUDA Version: {torch.version.cuda if torch.cuda.is_available() else \"N/A\"}')" || {
+ echo "โ PyTorch/CUDA check failed"
+ exit 1
+}
+echo "โ
CUDA OK"
+echo ""
+
+# Check critical packages
+echo "๐ฆ Critical Package Check"
+PACKAGES=(
+ "torch"
+ "transformers"
+ "ray"
+ "vllm"
+ "flash_attn"
+ "accelerate"
+ "wandb"
+)
+
+for pkg in "${PACKAGES[@]}"; do
+ python3 -c "import $pkg; print(f'โ
$pkg: OK')" 2>/dev/null || {
+ if [ "$pkg" == "flash_attn" ]; then
+ if ! python3 -c "import torch; exit(0 if torch.cuda.is_available() else 1)"; then
+ echo "โ ๏ธ $pkg: SKIPPED (No CUDA)"
+ continue
+ fi
+ fi
+ echo "โ $pkg: MISSING"
+ MISSING=1
+ }
+done
+
+if [ -n "$MISSING" ]; then
+ echo ""
+ echo "โ ๏ธ Some packages are missing. Install with:"
+ echo " pip install -r Agent0/requirements.txt"
+ exit 1
+fi
+echo ""
+
+# Check VeRL installation
+echo "๐ฌ VeRL Framework Check"
+cd /workspace/Agent0/executor_train/verl 2>/dev/null || {
+ echo "โ VeRL directory not found"
+ exit 1
+}
+
+python3 -c "import verl; print('โ
VeRL: OK')" 2>/dev/null || {
+ echo "โ ๏ธ VeRL not installed. Install with:"
+ echo " cd Agent0/executor_train/verl && pip install -e ."
+}
+echo ""
+
+# Check file structure
+echo "๐ File Structure Check"
+REQUIRED_DIRS=(
+ "Agent0/curriculum_train"
+ "Agent0/executor_train"
+ "Agent0/curriculum_train/scripts"
+ "Agent0/executor_train/examples"
+)
+
+for dir in "${REQUIRED_DIRS[@]}"; do
+ if [ -d "/workspace/$dir" ]; then
+ echo "โ
$dir exists"
+ else
+ echo "โ $dir missing"
+ exit 1
+ fi
+done
+echo ""
+
+# Check configuration files
+echo "โ๏ธ Configuration Files Check"
+CONFIG_FILES=(
+ "Agent0/requirements.txt"
+ "Agent0/curriculum_train/requirements.txt"
+ "Agent0/curriculum_train/scripts/curriculum_train.sh"
+)
+
+for file in "${CONFIG_FILES[@]}"; do
+ if [ -f "/workspace/$file" ]; then
+ echo "โ
$file exists"
+ else
+ echo "โ ๏ธ $file missing (may be optional)"
+ fi
+done
+echo ""
+
+# Check external services (if configured)
+echo "๐ External Services Check"
+if [ -f "/workspace/Agent0/curriculum_train/vllm_service_init/start_vllm_server_tool.py" ]; then
+ echo "โ
vLLM service script found"
+ # Check if sandbox URLs are configured
+ if grep -q "SANDBOX_API_URLS" /workspace/Agent0/curriculum_train/vllm_service_init/start_vllm_server_tool.py; then
+ echo "โ ๏ธ Sandbox URLs may need configuration"
+ fi
+else
+ echo "โ ๏ธ vLLM service script not found"
+fi
+echo ""
+
+echo "โ
Build validation complete!"
+echo ""
+echo "Next steps:"
+echo "1. Configure SandboxFusion URLs if needed"
+echo "2. Set environment variables (STORAGE_PATH, WANDB_API_KEY, etc.)"
+echo "3. Run tests: ./scripts/run_tests.sh"