LLMUnity icon indicating copy to clipboard operation
LLMUnity copied to clipboard

Remember optimal server settings

Open BruceKristelijn opened this issue 1 year ago • 4 comments

Describe the feature

With the introduction of the fallback to CPU and --no-mmap I was thinking. Maybe start up can be sped up on a repeated run by remembering what setup worked for this user? So the first time the LLM.cs will recognise what works and the other times a user starts up the game it will run in these settings.

I am unsure how to implement this yet (how / where to store this?) and probably something for the future but can help speed up launch times for users.

BruceKristelijn avatar Feb 02 '24 13:02 BruceKristelijn

Very good point! I think something like this can be implemented with PlayerPrefs.

amakropoulos avatar Feb 02 '24 13:02 amakropoulos

PlayerPrefs are an option but as a developer I try to not use them in production. These seem to be saved in some (in my opinion) odd places. I problem I forse with PlayerPrefs is that when something does not work for the end-user it is a bit harder to help them reset the settings themselves. It would seem more elegant to tell them to go to to Application.persistentDataPath and remove a certain file so LLMUnity can generate new ones? Let me know what you think!

BruceKristelijn avatar Feb 05 '24 16:02 BruceKristelijn

Yes you are right, that's better!

amakropoulos avatar Feb 05 '24 18:02 amakropoulos

I tried some things with this today but I am unsure if the current setup can achieve it.

Feel free to checkout my initial test here: https://github.com/Savanna-Developments/LLMUnity/tree/saving_settings

I added code to generate a hardware hash and added a way to get the package version. In the script LLMSerializedSettings.cs I added a check to check if any of these change to make sure the server command is "regenerated" so the ideal setup can be detected again. However I have some concerns at the current setup:

  • Right now I basically save the working server command. But what if the install directory changes, this should also be detected and captured.
  • I feel that storing a long string is not ideal. But I am unsure how else this can be achieved with the current setup.

Maybe any other ideas / solutions? 😄

BruceKristelijn avatar Mar 11 '24 14:03 BruceKristelijn

I think the functionality is not needed anymore with the DLLs because they either load or not depending on the system hardware.

amakropoulos avatar Aug 27 '24 07:08 amakropoulos