• perchance@lemmy.worldM
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 months ago

    Yep - core engine code is completely open source, though the code is extremely messy as mentioned in the above quote. Also mentioned above, the ShadowRealms will solve that (by isolating the messiness so it doesn’t affect the rest of your codebase), and that spec is finally making significant progress lately. A few random notes:

    • Probably the most annoying thing that’s not open source at the moment is the AI plugin stuff. It wouldn’t be hard to edit the AI plugin code to just use an external API service, but this is unfortunately not feasible for a lot of people because AI stuff is expensive. There are various workarounds, including setting up local models (e.g. using ollama + ComfyUI/A1111 + etc), and maybe eventually even local models within the browser (see Transformers.js) but for now this is just not very easy, and you need a powerful GPU. Still, I’d like to see someone in the community try to play around with these ideas. Note that Perchance exclusively uses open-source models for the AI stuff, so you can replicate all the capabilities by just using top models from civit/localllama/etc.

    • The express.js and mongodb server would be very simple for someone to make. It’d be very hard for me to open source the actual server (and also the AI plugin servers), since it would expose various defence-in-depth abuse-prevention methods, and I’d need to disentangle it from various things like my Cloudflare account (workers, caching rules, etc.), Deno Deploy, B2 Backblaze, and a bunch of other stuff. There are a lot of moving parts that wouldn’t be needed for self-hosting, which is why it’d be way easier for someone from the community just built it from scratch. It wouldn’t need to be much more than a “hello world” example of express.js and mongodb - basically connect it to this the bare-bones “offline editor”: https://www.reddit.com/r/perchance/comments/yi0twl/dev_you_can_now_edit_your_downloaded_generators/ - see also: https://perchance.org/better-offline-editor

    • This may be useful depending on your use case: https://perchance.org/diy-perchance-api

    • There have been a few projects which try to replicate a subset of the Perchance engine in other languages - https://pypi.org/project/PyChance - https://crates.io/crates/purrchance - there may be others.

    • BluePower@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 months ago

      That is a very neat explanation! Would be very useful for someone who wants to deep dive into the deepest sides of Perchance. And actually, I’d be interested in learning more on that, too.