LostRuins/lite.koboldai.net

Simple ready to go preset?

Seantourage opened this issue · 7 comments

Is there anyways I can pre-configure koboldai with a supplied json or character card, endpoint and model settings so a user can instantly chat with the character I choose using my supplied endpoint?

I tried digging through the code, but it's a novel to figure out with my limited skills.

Thanks

Yes you can - you can export settings inside the json file which anyone who imports will get. If you're using koboldcpp, you can preconfigure a ready made save file using the --preloadstory option

Nice I'll take a look into that. Thanks!

Works great. Is there any way to get the unembedded koboldai.lite to auto connect to the endpoint and load the story?

I tried changing the following settings in the html file but it still wants me to pick an AI on first load.

var custom_kobold_endpoint = "http://localhost:5001"
saved_kai_addr: "http://localhost:5001",
prev_custom_endpoint_type: 1

Is there a way to have it autoconnect to the endpoint without a prompt even if

		let loadedsettingsjson = localStorage.getItem(STORAGE_PREFIX + "settings");
		let loadedstorycompressed = old loadlocalStorage.getItem(STORAGE_PREFIX + "story");

are both empty on first load?

Thanks a ton!

For that you can simply use URL params. Here's an example that tries to connect to a host on 192.168.1.50 at port 5005:

https://lite.koboldai.net/?local=1&port=5005&host=192.168.1.50

This will work when running on any domain, not just the official one. You can simply override any of the URL params and it will load accordingly.

Wow talk about a simple solution. Wish I knew about this setting earlier :)

After a few hours of messing with the code I cobbled together something that pretty much works for my limited use case.

In the section where it checks if there are previous settings and story, I added code after console.log("Skipped missing local save"); that creates local settings along with the compressed loadedstory that I then import.

I also hardcoded the variables with my endpoint URL and replaced display_custom_endpoint(); with connect_custom_endpoint() along with a few tweaks to have it automatically connect to my endpoint without any popups.

At this point I don't even need to use --preloadstory since I have the webui do it automatically if there isn't any chat history or settings and must say it's working pretty good.

I especially love how I can edit/remove the scenarios to just list the few characters I want my friends to check out or remove the character upload link to keep it curated.

I must say, the all in one HTML file is a marvel, especially with all the functionality, customization and options and really appreciate both the effort you put into maintaining and supporting it.

Guess I can remove some of my messy handiwork with your solution.

FYI, You can also launch Lite already filtered to a specific set of scenarios. For example:

https://lite.koboldai.net/?scenario=niko

likewise, you can utilize a character card scenario downloaded from chub, for example:

https://lite.koboldai.net/?chub=shaolan98/lara-lightland

Many setups can be arranged solely via the URL parameters.

Great info!