LLMCraft helps you to easily integrate diverse LLM models into your server. You can configure model's parameters from the system prompt (how it will act) to the finest details such as temperature or frequency-penalty.
If you're using
Citizens, you can add your models to NPC's so that players are able to speak with them in game.
Each model in your config.yml is a "Model Type" that can be instanced in any number of different "Models" in-game; so you can have the same character multiple times, with different memory/context !
The plugins uses LangChain4J library for making API requests.
Features
- Multiple API providers (Anthropic, OpenAI...)
- Fine-configure your models
- Embed models into Citizens NPC
- Generate answers token per token into a DecentHolograms
- Individuals or shared conversations, with or without memory
Installation
- Upload the jar to your plugins' folder and restart your server
- Config your API-keys and your models/NPCs
- Reload the plugin using /llmcraft reload
- Enjoy !
Commands
- /llmcraft : shows the plugin's help page
- /ask <model> <prompt> : Chat with a model
- /instance <model type> <identifier> : creates a new instance of a model
- /model <model> : get info on a model
Configuration:
Model Configuration:
Here's an example of 2 models in the config :
Code (YAML):
models:
helper:
provider
: openai
model-name
: gpt-3.5-turbo
visibility
: private
persistent
: true
prefix
:
"§6§lHelper >§e§l "
system-prompt
:
"You are a Minecraft assistant, design to help the players with anything minecraft-related."
crazy-guy:
provider
: openai
visibility
: shared
persistent
: true
prefix
:
"§6§lCrazy Guy >§e"
system-prompt
:
"You are a completely insane medieval peasant, who likes to prank, joke, taunt etc."
temperature
: 0.2
max-tokens
: 400
frequency-penalty
: 2
time-out
: 60
NPC Configuration :
You can then if you want add a NPC configuration:
Shared NPC speak with everyone in their range and will remember what previous people said, where personal one will remember separately their conversations with players.
Code (YAML):
npcs
:
guard:
citizen-id
: 0
model
: city-guard
type
: shared
talking
: chat
range
: 10
helper:
citizen-id
: 3
model
: basicgpt
type
: personal
talking
: hologramdzdz
range
: 15
Limits Configuration :
As each request cost you money, you have to be able to limit players' usage of the API. You can do so with limiters:
Code (YAML):
usage-limits:
king:
deny-message
:
"I'm busy right now, sorry."
groups:
default
: 3
vip
: 5
super-vip
: 10
city-guard:
deny-message
:
"You can not enter this castle."
groups:
default
: 3
You need LuckPerms on your server to use this functionality. Usages are reset each time the plugin is reloaded (so basically, everytime your server restart).
Commands
- /llmcraft : shows the plugin's help page
- /modeltypes, /modeltype : see available model types
- /modeltype <model type> : see information on given model type
- /model, /models : see available instanced models
- /model <model name> : see information on a model
- /instance <model type> : create a new model based on given model type
- /ask <model> <prompt> : chat with given model
FAQ
- Why is the plugin so heavy?
The plugin uses the Langchain4J library, I shaded it into the plugin. You can build it from source without it from github if needed.
LLMCraft is under
GPL-3.0 license. Feel free to do everything you want with the source code.
Please, consider contributing to the project, a lot can be improved !