semperai / amica

Amica is an open source interface for interactive communication with 3D characters with voice synthesis and speech recognition.
https://heyamica.com
MIT License
684 stars 111 forks source link

Add ability to save characters into DB #43

Closed morphles closed 9 months ago

morphles commented 9 months ago

So it should mostly work I believe, I know translation/text/interface stuff might be sub-optimal, I'm not that well versed in react/next. Still it's a step. After this I can work on chat. Tweak stuff as needed.

This is for https://github.com/semperai/amica/issues/42 issue and needed for https://github.com/semperai/amica/issues/29

vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
amica ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2023 3:49pm
morphles commented 9 months ago

Ah testing on vercel preview I see that I probably need somehow adjust the api url. Have never touched vercel though and not sure how to make it work (that is get url to write somewhere in config). Will leave it to you @kasumi-1 . Or do we want separate config for DB endpoints host?

kasumi-1 commented 9 months ago

hey thanks for the PR @morphles

I think this makes more sense as additional backend for https://github.com/semperai/store.heyamica.com - or just docker compose or similar to spin up local db for that. since there is already apis to save and load characters it make more sense to use.

morphles commented 9 months ago

I one way yes. But for me, this is becoming a bit of flashbacks situation with work microservices :) . Or to put it simply having that stuff in separate repo seems like unnecessary over-complication, for which I have 0 interest.

kasumi-1 commented 9 months ago

There's definitely an argument to be made for not having multiple repos, I agree in general.

Maybe it makes sense to just pull in the store repo into this one.

I recently added ability to build Amica binaries with tauri (similar to electron) to make it easier for less technical people to run. With this its possible to connect to sqlite but not really through nextjs as that's just used for html export.

I think probably we want storage to be configurable to either choose the global storage system implemented with supabase or to use only local (esp if no network connection). And then https://github.com/semperai/amica/blob/master/src/pages/share.tsx#L96 here we could have this either send to the api or call into sqlite

morphles commented 9 months ago

Well for me it's too much over-complication when not getting paid :) . Even at work next/react +micro-services is driving me up the wall. And whole separate repos for all thing, sounds like micro services all over again, and I just extremely fail to see the point, like is this aiming at facebook scale or what? I was seriously contemplating sorta hard forking relevant parts and ripping out most of stuff, as I generally see even something like react itself as overkill (same at work, and I find hard to imagine where I'd go for something like that myself). I could go some with trying streamline the stuff and simplifying as much as possible (of course tts/stt and llm stuff will be separate as it's not js stuff), but doesn't seem to be direction being taken, and also with these full RDBMS seems like I'd be contributing to some hosted service, instead of tool for personal use. For now I have some other stuff to attend, might see how it goes and maybe contribute in future.

kasumi-1 commented 9 months ago

Ok, I'll close this for now.

As far as scale, I want to support hosted demo as well as desktop computers that have big gpus, as well as fully offline soc devices. So, the range is kind of large :)

For hosted service, maybe would be cool but not really focus - many other projects do hosted service. It would be useful for very underpowered devices as an all in one option, but I think this mostly solved with able to configure backends.

Making it easy to share characters or load same character on many devices necessitate shared db. I want amica to support offline character saving/loading, though probably best to find route that utilizes the existing character loader will lead to less maintenance in future.

In any case, thanks for the PR & hope you have a nice Christmas.

morphles commented 9 months ago

Thanks, nice holidays to you too :)

As for DB, if I'm hosting my instance, its local DB is by definition shared and I use it on any device I want, and I did that, leave my PC on, have vpn to which I connect from phone and I can access the system. As for me local hosting is most important (I'm not sending my whatever shit talking to anyone) I'd never use any service where models are not run on my HW. That said it is understandable that some people might want someone else to host the stuff as they have no suitable HW (which is also somewhat debatable as people manage to run, admittedly small, models on phones and SBCs), but then I still see no problem having db running on same machine as web (and just being simple and powerful sqlite).