Mount & Blade II: Bannerlord
0 of 0

File information

Last updated

Original upload

Created by

Wondering Mark

Uploaded by

wonderingmark123

Virus scan

Some manually verified files

About this mod

ChatGPT API is added to the game. You could talk to the villagers, companions and lords freely. The ChatGPT will read your inout sentence and start conversation with you. Both OpenAI API and free LLM local model are available for this mod.

Permissions and credits
ChatGPT API is added to the game. You could talk to the villagers, companions, and lords freely. The ChatGPT will read your input sentence and start the conversation with you.

This mod should be relatively clean without any interaction with other mods. Currently, it is tested in game version 1.2.8. In principle, this mod should also work for other versions. If you have tried this mod with another version of the game and it works without any issues. I would really appreciate it if you could report that in the discussion.

Currently tested versions are: 1.2.8, 1.2.9, 1.1.5

New feature:
You could run this mod with local LLM now, which is open-source and free!

If you encounter any problem in this mod. Please check the log.txt in ${Gamefolder}/Modules/Bannerlord.ChatGPT/ModReplay/log.txt file. It should contain the problems you encounter by using this mod.
Any bugs or issues reports are welcome. You could report here or on the GitHub page. Please include the log.txt file I mentioned previously. 

If you also want to contribute to the mod, you could visit this mod's GitHub page and start a pull request. 
wonderingmark123/Bannerlord.ChatGPT: ChatGPT mod for Mount & Blade 2: bannerlord (github.com)

Installation

There are two ways of installing the mod. You can either run it with the local model or run it with OpenAI API (recommend). 

 Using OpenAI API (recommend)
  • Exact the Bannerlord.ChatGPT.zip file and copy the \Bannerlord.ChatGPT folder to your {Game Folder}\Modules\ folder. 
  • Log in/register to the ChatGPT API website https://platform.openai.com/api-keys. Go to the usage tab on the left (Or click that link again after login). Click "Create new secret key". Make sure you copy that before you close the window. ChatGPT API gives 18 dollars to new users. If your phone number hasn't been registered, go and get it!
  • Go to {Game Folder}\Modules\Bannerlord.ChatGPT\ModRelayer. Open the file APIkey.txt. Paste the API key to this file. (Replace the old API key. And make sure there is no extra letter added to that file)
  • Then in the start panel, tick this Bannerlord.ChatGPT and enjoy your journey! 
Local LLM model (offline and free):
  • download version 2.0.0 of this mod.
  • Exact the Bannerlord.ChatGPT.zip file and copy the \Bannerlord.ChatGPT folder to your {Game Folder}\Modules\ folder. 
  • (Optional) If you want to use another LLM model. you could download it somewhere and copy its path to APIkey.txt in the ModReplay folder. Only an extension of gguf is supported in this mod. 

  • Start your game and then there will be a cmd window coming up and minimized. Don't close that until you exit the game. 
  • The response time for the local model will be very long. For my computer, the initialization of the conversation will take 2mins and responses usually take 30 seconds. 
  • DONOT use the vortex to start the game with this mod!


## Some issues
  • This mod is only valid in the mission view. For example, you could chat in the castles, inside the towns. However, any conversation started from the map won't be able to call this mod. This issue will be fixed in the later version.
  • Sometimes the response will be so long. The text is divided into several pages. You could left/right-click your mouse to move to the next/previous page.
  • This mod is supposed to support most of the versions and has the minimum modification of the original game. However, they are not tested. 


This mod is referring to the following works:
* Inworld API: https://studio.inworld.ai/workspaces/default-ibnuyu5uug-lnmebb0pd9w/characters
* Inworld Mod installation guide: https://bloctheworker.github.io/Inworld-Bannerlord-Mod/installation/
* Inworld Ai: Inworld AI - Calradia at Mount & Blade II: Bannerlord Nexus - Mods and community (nexusmods.com)
* Bannerlord wiki: https://mountandblade2bannerlord.wiki.fextralife.com
* Bannerlord API doc: https://apidoc.bannerlord.com/v/1.2.7/
* **Harmony** introduction: https://harmony.pardeike.net/articles/patching.html
* official docs: https://moddocs.bannerlord.com/
* **ChatGPT API**: https://platform.openai.com/playground/p/default-sql-translate?mode=chat
* **ChatGPT C# lib**: https://github.com/OkGoDoIt/OpenAI-API-dotnet
* CharacterAI-NET-API-Wrapper: https://github.com/drizzle-mizzle/CharacterAI-NET-API-Wrapper/wiki/Getting-started.
Thanks a lot for their contribution to the community!