4
submitted 3 weeks ago by MailTo@lemmy.world to c/perchance@lemmy.world

Hi i wanted to ask this for a long time and maybe i haven't noticed it but is the multi-character chat interface downloadable in some way to use offline, and plug my own localhost LLM into it and run it offline? I see the two code panels but i'm not a coder and don't know what should be done to make a local HTML and JS file and then reroute all character talk to my LMStudio's localhost server. Would be really interesting. Thank you.

top 1 comments
sorted by: hot top new old
[-] Almaumbria@lemmy.world 2 points 3 weeks ago

but i’m not a coder

Always time to learn! :D

You can download the generator code if you save your own copy of it:

  • click "🛠️ edit"
  • then "💾 save"
  • then "⚙️ settings"
  • finally, "download it" on the menu that pops up

That gives you an HTML file which you can simply open with your browser. But likely what you want is to serve it to yourself on localhost. I have a shell script with this:

#!/usr/bin/bash
python3 -m http.server 8000 --bind 127.0.0.1

Which I run from say path/to/folder, which contains the HTML file. So to serve myself the file my_generator.html, I go to http://localhost:8000/my_generator.html.

So OK what you'd have to do then is replace calls to the AI text plugin with calls to your own backend. Now, I can't tell you exactly what to do there because I don't know which generator you're talking about, but if the code is based on the advanced character chat (and I suspect that it is), then you want to be looking for these symbols within the code:

  • countTokens, a function that gets an approximate token count for a piece of text.
  • idealMaxContextTokens, some number below the total size of your context window.
  • aiTextPlugin/root.aiTextPlugin, ie the call to the model itself.

You'd have to provide your own version of these to handle the rerouting. And then another thing, if you have bits like these on the code:

  const aiTextPluginMetaObject = root.aiTextPlugin({getMetaObject:true});
  window.countTokens = aiTextPluginMetaObject.countTokens;
  window.idealMaxContextTokens = aiTextPluginMetaObject.idealMaxContextTokens;

Then you'd have to remove the aiTextPluginMetaObject, as you're no longer fetching anything from the AI text plugin.

Oh, also (again) I don't know how stuff like the comments or bug report plugins would behave because I honestly haven't tried if they work offline. I don't think they should...

The text embedder (used for lore/memories) would also maybe give you some trouble because it downloads a bunch of JS files while the page loads, and that wouldn't work without an internet connection. Not sure if the dynamic import trick done for the other dependencies (Dexie, marked, and DOMPurify, see here) would be affected by this. Anyway, I'm guessing you'd want to download the code for all those dependencies so that you can still import them without internet.

OK so there's a few hurdles and likely some more that I didn't number; this is just off the top of my head. Never tried self-hosting, my hardware is relatively ancient (less than 1GB of VRAM! XD) but hopefully this rant gives you an idea of what it would take to do what you want to.

Anyway, there are no elephants in this room...
ok, actually, there is one elephant. Conventional wisdom is you're going to have an easier time with a frontend that was developed with local use in mind and compiled to run on your platform, than rewriting a webapp to be entirely locally run.

However, if you need to rewrite a webapp anyway, then yeah, it should be possible.

OK exposition dump over :D cheers!

this post was submitted on 22 Apr 2026
4 points (100.0% liked)

Perchance - Create a Random Text Generator

1846 readers
8 users here now

⚄︎ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.

See this post for the Complete Guide to Posting Here on the Community!

Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

5. Refrain from requesting Prompts for the AI Tools.

  • We would like to ask to refrain from posting here needing help specifically with prompting/achieving certain results with the AI plugins (text-to-image-plugin and ai-text-plugin) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"
  • See Perchance AI FAQ for FAQ about the AI tools.
  • You can ask for help with prompting at the 'sister' community Casual Perchance, which is for more casual discussions.
  • We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

6. Search through the Community Before Posting.

  • Please Search through the Community Posts here (and on Reddit) before posting to see if what you will post has similar post/already been posted.

founded 2 years ago
MODERATORS