[Feature] Serverless support #18858
Replies: 4 comments 5 replies
-
In particular I'd love to hear @alextran1502's thoughts on this potential direction |
Beta Was this translation helpful? Give feedback.
-
Hello, Alex can certainly chime in if he sees this. SQLite support is not something we are considering at this time, and that makes this effectively a duplicate of #562. I don’t see serverless support as being feasible in immich future. Appreciate your thoughts. |
Beta Was this translation helpful? Give feedback.
-
Also see #10394 |
Beta Was this translation helpful? Give feedback.
-
Something like this is highly unlikely to be merged into Immich core. However, if you did work on this I would personally be interested to see where it goes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have searched the existing feature requests, both open and closed, to make sure this is not a duplicate request.
The feature
Running Immich at home is great for many use-cases but – depending on internet speed and hardware availability – potentially not performant or reliable enough for a stress free setup. At the same time, self-hosting Immich on adequate cloud hardware would be more expensive than using <unnamed 3rd-party services>. Self-hosting via a serverless platform like Cloudflare Workers could solve both issues, being very reliable, but also much cheaper (essentially free for most users). Cost would scale with usage, rather than users paying a flat monthly fee forever.
It's clear that this would require dev work. To begin with, an alternative code path would be required to replace the api and microservices "workers" with separately deployable serverless functions that call each other as necessary.
To take full advantage of a serverless environment, the PostgreSQL and Redis databases would also need to be serverless. Cloudflare's D1 is cost-effective, but is compatible with SQLite and not Postgres, which may require reviving this thread.
Cloudflare also has a very competitive offering for KV storage, and WebWorker support via DurableObjects. In addition, it offers dedicated serverless message queues, which may be an even better match and more cost effective, assuming Redis is unneeded for other things (I did not dig deep into this yet, as I'm new to the project).
The remaining parts of the picture appear to be the ML models for CLIP and facial recognition. Cloudflare does not offer generic serverless GPU functionality, although it does offer Workers AI with GPU acceleration, which includes llava and uform-gen models for CLIP-like functionality. Regardless, CPU inference may be totally adequate for Immich's use case, given it could run with very high parallelism (e.g. 1000 parallel processors running at once).
I believe a reasonable migration path – broken into 4 milestones – could be:
Next Steps
I'd be happy to slowly tackle one or even all of those issues (they should be doable independently of one another) if no one objects. Of course, I don't want to work on this if similar work is planned, or maintainers disagree about the direction. Please let me know what you think.
Platform
Beta Was this translation helpful? Give feedback.
All reactions