On Immich and Gemini Help

Page content

It’s interesting that my use of Immich has evolved with my adoption of Gemini. I know that the cool thing would be to vibe code an Immich clone, and then show off about it to the world. I don’t want to do that. I don’t find it interesting to re-invent the wheel. I think it’s more interesting to get a model such as Gemini to help me make Immich stable on a Pi 5.

If you’re starting with an empty photo album on a phone, and an empty photo library, then Immich is happy. It has no pressure on the Pi5. The challenge occurs when you tell Immich, “Here’s the external library, enjoy your meal”, and it begins to run all of its jobs at once.

Immich will look for sidecar metadata and extract metadata. It will also generate thumbnails. Each of these processes will easily take 200 percent of the CPU. Sometimes it takes minutes but in other cases it takes seconds to get an Out of Memory error. At this point you restart the Pi.

As if that wasn’t enough, once the thumbnails are generated Immich will then run three or four machine learning jobs. In so doing the Pi is now overwhelmed and fragile.

Before AI my process was to pause all the jobs except for extract sidecar and metadata. This can take hours on a 140,000 item library so you just leave it to run. In the meantime I “manage concurrency so that it does 1 task per job at a time.

With all of these restrictions the Pi was more stable, until it heats up over a period of time, or fails to garbage collect. Eventually you get an Out of Memory error and that’s where Gemini can help.

I’d like to preface this with an aknowledgement that we could read the fabulous manual (RTFM) but the reality is that often manuals are written either for people with a good contextual background who understand the nuances or for people who think one way rather than another. Often when I read them I think “I’d like an example” or “I’d like it to be explained in a different way.” To be clear, I am not criticising the manual. I am saying that if we get stuck we can use another resource.

If we know something is going wrong we can tell Gemini, and Gemini will provide us with commands that might help it get the log information it needs to provide us with a solution that works.

If we had RTFMed and searched for answer it might have taken hours. With AI the answer is often within seconds. Notice how I say often. In plenty of cases I have seen AI make erroneous assumptions.

Context and Assumptions

Sometimes, when I hit a snag, and told Gemini, Euria and Claude about an issue I found that they liked to throw the blame on me. They liked to assume that they understood the issue.

One of the weaknesses of LLMs is that they have poor contextual understanding so if you speak about A, then B, and then C they will switch th the wrong context, and provide answers that are wrong.

Fine Tuning and Understanding the Subject Matter

If I keep bringing up Gemini rather than Claude, Le Chat and Euria, it’s because I find that Gemini either understands my issues more easily, or I am more fine tuned to how it “thinks” or sees the world. If I stumble it helps, and if it stumbles then I recognise it, and fine tune what I am asking of it.

And Finally

Finding the instructions for installing and bringing up an instance is relatively easy, but fine tuning it and getting it to be stable is more of a challenge, especially on a low specification Pi4 or Pi5. Within this context regular crashes, and instability could lure someone away from the app. Thanks to an LLM you can identify and resolve a number of these issues by modifying the docker compose file to be ideally suited to your use case.

With a little help from Gemini Immich gains in accessability.