1.4 KiB
1.4 KiB
Install Instructions
Prerequisites
- Python 3.8+
- Ollama installed and running with the
gemm4:12bmodel downloaded.
Setup
-
Navigate to the directory:
cd botagent_ai -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate -
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 isgemma4:12b)BOT_SERVER_URL/-u: botWebWars backend URL (defaulthttp://localhost:8000/api)BOT_NAME/-n: Bot display nameBOT_COLOR/-c: Hex color for the bot avatarBOT_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
Example with local LLM
$ OLLAMA_BASE_URL="http://192.168.1.220:11434" python3 ./bot.py -n myAIBot -s 2