botWebWars/botagent_ai/INSTALL.md

1.3 KiB

Install Instructions

Prerequisites

  • Python 3.8+
  • Ollama installed and running with the gemm4:12b model downloaded.

Setup

  1. Navigate to the directory:

    cd botagent_ai
    
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows use: venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    

Configuration

The bot plays botWebWars using an Ollama model for strategy (voluntary alliances and navigation), while rule-mandated outcomes (forced battles/joins) are resolved automatically. Configure it via environment variables or CLI flags:

  • OLLAMA_BASE_URL / --ollama-url: Ollama instance URL (e.g., http://192.168.1.220:11434)
  • OLLAMA_MODEL / --ollama-model: The model name (default is gemma4:12b)
  • BOT_SERVER_URL / -u: botWebWars backend URL (default http://localhost:8000/api)
  • BOT_NAME / -n: Bot display name
  • BOT_COLOR / -c: Hex color for the bot avatar
  • BOT_STRENGTH / -s: Starting strength (1-10)

Example:

export OLLAMA_BASE_URL="http://192.168.1.220:11434"
export OLLAMA_MODEL="gemma4:12b"
python bot.py -n MyAIBot -s 5

Running the Bot

Run the script, then start the game from the frontend UI:

python bot.py