Awesome
BaseLang & Mastaba: Civrealm-LLM-Agents
BaseLang and Mastaba are two LLM-based agents for the reinforcement learning environment CivRealm. BaseLand and Mastaba share a similar interface to CivRealm over standard Gymnasium, as provided in CivRealm. BaseLang implements a paraallel controller on each unit individually and Mastaba uses an "advisor" to lead them all. Both agent models are presented in the paper of CivRealm.
Prerequisit
civrealm
from CivRealm.
The list requirements.txt
in the repository.
USAGE:
-
Install civrealm properly with correct freeciv-web. (See CivRealm)
-
Prepare the LLM's to use (GPT api key or local LLM URL)
-
Prepare a
PINECONE
API Key. -
Set env varibles.
# Use AZURE_OPENAI_API_TYPE="azure" to use Azure LLM, otherwise use "openai"
export AZURE_OPENAI_API_TYPE="<your_open_api_type>"
export AZURE_OPENAI_API_VERSION='<your_openai_api_version>'
export AZURE_OPENAI_API_BASE='<your_openai_api_base>'
export AZURE_OPENAI_API_KEY='<your_openai_api_key>'
export LOCAL_LLM_URL='<if_need_local_llm_inference>'
export MY_PINECONE_API_KEY='<your_pinecone_api_key>'
export MY_PINECONE_ENV='<your_pinecone_env_name>'
- Execute the code.
python main.py