# 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](docs/LocalDiplomacy_PLAN.md) for the architecture. ## Agent Quick Start From `src/LocalDiplomacy.Agent`: ```powershell 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: ```powershell 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: ```powershell $env:BANNERLORD_REFERENCES="C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client" dotnet build src\LocalDiplomacy\LocalDiplomacy.csproj ```