f4e1e18541e69a498c90c52910de2398be0f1002
LocalDiplomacy
LocalDiplomacy is a Bannerlord singleplayer mod experiment that keeps the AI roleplay and diplomacy loop outside the game process.
See docs/LocalDiplomacy_PLAN.md for the architecture.
Agent Quick Start
From src/LocalDiplomacy.Agent:
Copy-Item config.example.yaml config.yaml
# Put koboldcpp.exe and model.gguf in this directory.
uv sync --extra test
uv run uvicorn localdiplomacy_agent.app:app --host 127.0.0.1 --port 8766
The agent will launch koboldcpp.exe --model .\model.gguf --port 5001 --contextsize 8192 --jinjatools when koboldcpp.autostart is enabled.
Mock Game Client
Use the mock connector to test the same commands the Bannerlord mod will send without launching the game:
cd src\LocalDiplomacy.Agent
uv run python -m localdiplomacy_agent.mock_game --mock-agent say "Can we make peace with Battania?"
uv run python -m localdiplomacy_agent.mock_game --mock-agent tick --day 12.5
Drop --mock-agent to send the same requests to a running agent at http://127.0.0.1:8766.
Bannerlord Build Notes
Install a .NET SDK that can target net472, then set BANNERLORD_REFERENCES to Bannerlord's bin\Win64_Shipping_Client directory before building:
$env:BANNERLORD_REFERENCES="C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client"
dotnet build src\LocalDiplomacy\LocalDiplomacy.csproj
Description
Languages
Python
87.5%
C#
12.5%