[PR #2661] [MERGED] feat(ml): model unloading #9652

Closed
opened 2026-02-05 14:08:33 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/2661
Author: @mertalev
Created: 6/5/2023
Status: Merged
Merged: 6/7/2023
Merged by: @alextran1502

Base: mainHead: feat/ml-model-unloading


📝 Commits (3)

  • 3c25745 model cache
  • 740ea51 fixed revalidation when using cache namespace
  • be19bb5 fixed ttl not being set, added lock

📊 Changes

5 files changed (+401 additions, -234 deletions)

View changed files

machine-learning/app/cache.py (+84 -0)
📝 machine-learning/app/main.py (+41 -92)
machine-learning/app/models.py (+117 -0)
📝 machine-learning/poetry.lock (+157 -141)
📝 machine-learning/pyproject.toml (+2 -1)

📄 Description

Branched from #2642.

This PR allows models to be unloaded after a period of inactivity. The default is 300 seconds and can be changed with the MACHINE_LEARNING_MODEL_TTL flag. In addition, it also cleans up main.py and refactors some model-specific logic into a new file.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/2661 **Author:** [@mertalev](https://github.com/mertalev) **Created:** 6/5/2023 **Status:** ✅ Merged **Merged:** 6/7/2023 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `feat/ml-model-unloading` --- ### 📝 Commits (3) - [`3c25745`](https://github.com/immich-app/immich/commit/3c257455dce363c4c6aedfcebbaf41b0e64c2f76) model cache - [`740ea51`](https://github.com/immich-app/immich/commit/740ea5160b7b3a95d40cec46e7a5fab4ebc250ba) fixed revalidation when using cache namespace - [`be19bb5`](https://github.com/immich-app/immich/commit/be19bb58c21f6003f0f582cd1327bc9c35cc8c20) fixed ttl not being set, added lock ### 📊 Changes **5 files changed** (+401 additions, -234 deletions) <details> <summary>View changed files</summary> ➕ `machine-learning/app/cache.py` (+84 -0) 📝 `machine-learning/app/main.py` (+41 -92) ➕ `machine-learning/app/models.py` (+117 -0) 📝 `machine-learning/poetry.lock` (+157 -141) 📝 `machine-learning/pyproject.toml` (+2 -1) </details> ### 📄 Description Branched from #2642. This PR allows models to be unloaded after a period of inactivity. The default is 300 seconds and can be changed with the `MACHINE_LEARNING_MODEL_TTL` flag. In addition, it also cleans up `main.py` and refactors some model-specific logic into a new file. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 14:08:33 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#9652