Skip to content

GiusTex/Llm-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Llm-Chatbot

This plugin let your rpg-characters chat with you, using free local llms. The plugin is inspired by ChatGPT_APIMZ by Kotonoha. Some code parts are also inspired by Message Plus by Gabe.

Table of contents

Download demo

Set up

How it works

Plugin commands

Credits and inspiration

Download demo

You can find all downloadable files here.

There is a pre-built, non-editable demo (Windows-demo part1 and part2, Mac-demo part1 and part2) you can test.

If otherwise you want to test the plugin editing something or studying the demo, you can download LLM_Chatbot-Demo (part1 and part2. You have to own Rpg Maker).

Inside there are already the required dependencies (if you are on Windows, otherwise they'll be automatically downloaded but it will take some time). You can also find some NPCs to test the plugin commands with. You can also see the plugin in this video:

Watch video

Set up

If you don't want to download the demo, you can download the files manually following these steps:

If you are on Windows:

  • Download the chatbot folder (part1 and part2), then unzip it in your game's root directory. The path should be like this: [Your-Game-Name]/chatbot.
  • Download the plugin.js and move it into [Your-Game-Name]/js/plugins.
  • Run Run Windows Server", at the end you should see a link: http://localhost:8080` (this link works only on your computer, no one can connect to it from another one).

If you are not on Windows:

There will be some missing dependencies, to download them run Run Mac Server and wait. If after a few minutes a warning tells you You cannot run the "Make" command and You need to install "Command line develeloper tools", select Install (this will require 30 minutes).

Make command not available

Once Command line develeloper tools is installed, run again Run Mac Server to finish downloading the dependencies. At the end you should see a link: http://localhost:8080 (this link works only on your computer, no one can connect to it from another one).

Fix for newer versions of Koboldcpp, where --psutil_set_threads parameter has been removed:

To install the update, download server.py and drop it in the chatbot folder (the old server.py can be deleted).

You are now ready to test the 6 plugin commands!

How it works

  • The large language model (llm) used is Orca-mini-3b-ggml, weighs 2 gb, and although small is good in roleplay/chat. You can change the model used by dropping a new one in the chatbot folder, and then selecting it when starting the server.
  • As text generator I'm using koboldcpp, for windows, mac and linux. You could use another text-generation method by changing the Text generation Url parameter, but the plugin may require some tweaks then.
  • You can customize koboldcpp options depending on your computer strenght and run it directly in-game.
  • Characters can remember previous messages in an amount chosen by the user, to not create a memory too heavy.

Plugin commands

  • There are 6 plugin commands available:
    • Run Windows Server (starts koboldcpp with your desired options directly in-game (only on windows and mac);
    • Run Mac Server (starts koboldcpp with your desired options directly in-game (only on windows and mac);
    • Custom AI Answer (the character replies to a fixed message in the text box);
    • Gab Message (message box that doesn't block the user's commands, so you can keep moving);
    • AI Gab Message (the character replies to a fixed message in a message box that doesn't block the user's commands, so he can keep moving);
    • Start Dialogue (you can chat with the character/npc and he answers you).

You can choose the faces of the characters next to the messages, and the character's context.

Credits and inspiration