The specs:
- Mobile apps
- LLM wrapper (of e.g. OpenAI API)
- The chat history will be stored on the client
- Backend is needed to manage the api key and to track token consumption / payment (how many tokens does the user/device have left?)
I'm wondering whether "chat history stored on the client" and requiring authentication are possibly incompatible. Does a user expect full sync (use the app on multiple devices)/backups when authenticating?
Otherwise I could use e.g. a device generated UUID to identify the user in the backend, but it's less safe than authentication (e.g. JWT token).
And, well, we could consider too storing the message history in the backend, but we're thinking of making "better privacy" a selling point of the app (though this is of course not 100%, as the messages + summary still go to the OpenAI API) and simplifying development, at least for the start.
Suggestions / opinions?