Nextcloud can do this and replace a bunch of other google services in the process.
Looking at what you said so far though I am not entirely sure if you want to go down the route of self hosting yet. Which is okay, it involves a lot of work and knowledge to do right. Something you might not want to risk your contacts for if you are still learing. There are services that provide nextcloud hosting. Personally I am using Hetzner, a Germany based hosting provider: https://www.hetzner.com/storage/storage-share
Edit:
I forgot to mention, you’ll also need to do some fiddling with your phone to sync things: https://docs.nextcloud.com/server/latest/user_manual/en/groupware/sync_android.html
This is already a thing, there are a myriad of LLM chat interfaces where you can either connecting to models you are locally running or connect to APIs of providers. “Open WebUI”, “librechat” and “Big-AGI” are web interfaces. On desktop you have things like jan.ai and a a lot more.