fix(api)!: Stop model prior to deletion (#8422)

* Unload model prior to deletion

Signed-off-by: Andres Smith <andressmithdev@pm.me>

* Fix LFM model in gallery

Signed-off-by: Andres Smith <andressmithdev@pm.me>

* Remove mistakenly added files

Signed-off-by: Andres Smith <andressmithdev@pm.me>

---------

Signed-off-by: Andres Smith <andressmithdev@pm.me>
This commit is contained in:
Andres
2026-02-06 09:22:10 +01:00
committed by GitHub
parent bcd927da6e
commit efd552f83e
19 changed files with 32 additions and 11 deletions

View File

@@ -14,6 +14,7 @@ concurrency:
jobs:
backend-jobs:
if: github.repository == 'mudler/LocalAI'
uses: ./.github/workflows/backend_build.yml
with:
tag-latest: ${{ matrix.tag-latest }}

View File

@@ -5,6 +5,7 @@ on:
workflow_dispatch:
jobs:
bump-backends:
if: github.repository == 'mudler/LocalAI'
strategy:
fail-fast: false
matrix:

View File

@@ -5,6 +5,7 @@ on:
workflow_dispatch:
jobs:
bump-docs:
if: github.repository == 'mudler/LocalAI'
strategy:
fail-fast: false
matrix:

View File

@@ -5,6 +5,7 @@ on:
workflow_dispatch:
jobs:
checksum_check:
if: github.repository == 'mudler/LocalAI'
runs-on: ubuntu-latest
steps:
- name: Force Install GIT latest

View File

@@ -9,8 +9,8 @@ permissions:
jobs:
dependabot:
if: github.repository == 'mudler/LocalAI' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata

View File

@@ -12,6 +12,7 @@ concurrency:
jobs:
build-linux:
if: github.repository == 'mudler/LocalAI'
runs-on: ubuntu-latest
steps:
- name: Clone

View File

@@ -27,6 +27,7 @@ on:
type: string
jobs:
gallery-agent:
if: github.repository == 'mudler/LocalAI'
runs-on: ubuntu-latest
steps:
- name: Checkout repository

View File

@@ -13,6 +13,7 @@ concurrency:
jobs:
generate_caches:
if: github.repository == 'mudler/LocalAI'
strategy:
matrix:
include:

View File

@@ -12,6 +12,7 @@ concurrency:
jobs:
generate_caches:
if: github.repository == 'mudler/LocalAI'
strategy:
matrix:
include:

View File

@@ -14,6 +14,7 @@
jobs:
hipblas-jobs:
if: github.repository == 'mudler/LocalAI'
uses: ./.github/workflows/image_build.yml
with:
tag-latest: ${{ matrix.tag-latest }}
@@ -50,6 +51,7 @@
ubuntu-codename: 'noble'
core-image-build:
if: github.repository == 'mudler/LocalAI'
uses: ./.github/workflows/image_build.yml
with:
tag-latest: ${{ matrix.tag-latest }}
@@ -136,6 +138,7 @@
ubuntu-codename: 'noble'
gh-runner:
if: github.repository == 'mudler/LocalAI'
uses: ./.github/workflows/image_build.yml
with:
tag-latest: ${{ matrix.tag-latest }}

View File

@@ -10,8 +10,8 @@ permissions:
actions: write # to dispatch publish workflow
jobs:
dependabot:
if: github.repository == 'mudler/LocalAI' && github.actor == 'localai-bot' && !contains(github.event.pull_request.title, 'chore(model gallery):')
runs-on: ubuntu-latest
if: ${{ github.actor == 'localai-bot' && !contains(github.event.pull_request.title, 'chore(model gallery):') }}
steps:
- name: Checkout repository
uses: actions/checkout@v6

View File

@@ -10,7 +10,7 @@ permissions:
jobs:
notify-discord:
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'area/ai-model')) }}
if: github.repository == 'mudler/LocalAI' && (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'area/ai-model'))
env:
MODEL_NAME: gemma-3-12b-it-qat
runs-on: ubuntu-latest
@@ -90,7 +90,7 @@ jobs:
connect-timeout-seconds: 180
limit-access-to-actor: true
notify-twitter:
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'area/ai-model')) }}
if: github.repository == 'mudler/LocalAI' && (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'area/ai-model'))
env:
MODEL_NAME: gemma-3-12b-it-qat
runs-on: ubuntu-latest

View File

@@ -6,6 +6,7 @@ on:
jobs:
notify-discord:
if: github.repository == 'mudler/LocalAI'
runs-on: ubuntu-latest
env:
RELEASE_BODY: ${{ github.event.release.body }}

View File

@@ -8,6 +8,7 @@ on:
jobs:
stale:
if: github.repository == 'mudler/LocalAI'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v9

View File

@@ -5,6 +5,7 @@ on:
workflow_dispatch:
jobs:
swagger:
if: github.repository == 'mudler/LocalAI'
strategy:
fail-fast: false
runs-on: ubuntu-latest

View File

@@ -78,7 +78,7 @@ package: whisper
build: package
clean: purge
rm -rf libgowhisper*.so sources/whisper.cpp whisper
rm -rf libgowhisper*.so package sources/whisper.cpp whisper
purge:
rm -rf build*

View File

@@ -197,6 +197,9 @@ func processModelOperation(
switch {
case op.Delete:
if err := modelLoader.ShutdownModel(op.GalleryElementName); err != nil {
xlog.Warn("Failed to unload model during deletion", "model", op.GalleryElementName, "error", err)
}
return gallery.DeleteModelFromSystem(systemState, op.GalleryElementName)
case op.GalleryElement != nil:
installedModel, err := gallery.InstallModel(

View File

@@ -1391,7 +1391,7 @@
- filename: mmproj-OpenGVLab_InternVL3_5-2B-f16.gguf
sha256: e83ba6e675b747f7801557dc24594f43c17a7850b6129d4972d55e3e9b010359
uri: huggingface://bartowski/OpenGVLab_InternVL3_5-8B-GGUF/mmproj-OpenGVLab_InternVL3_5-2B-f16.gguf
- &lfm2
- &lfm2vl
url: "github:mudler/LocalAI/gallery/lfm.yaml@master"
name: "lfm2-vl-450m"
license: lfm1.0
@@ -1424,7 +1424,7 @@
- filename: mmproj-LFM2-VL-450M-F16.gguf
sha256: 416a085c5c7ba0f8d02bb8326c719a6f8f2210c2641c6bf64194a57c11c76e59
uri: huggingface://LiquidAI/LFM2-VL-450M-GGUF/mmproj-LFM2-VL-450M-F16.gguf
- !!merge <<: *lfm2
- !!merge <<: *lfm2vl
name: "lfm2-vl-1.6b"
urls:
- https://huggingface.co/LiquidAI/LFM2-VL-1.6B
@@ -1440,7 +1440,7 @@
- filename: mmproj-LFM2-VL-1.6B-F16.gguf
sha256: b637bfa6060be2bc7503ec23ba48b407843d08c2ca83f52be206ea8563ccbae2
uri: huggingface://LiquidAI/LFM2-VL-1.6B-GGUF/mmproj-LFM2-VL-1.6B-F16.gguf
- !!merge <<: *lfm2
- &lfm2
name: "lfm2-1.2b"
urls:
- https://huggingface.co/LiquidAI/LFM2-1.2B

View File

@@ -45,8 +45,9 @@ const (
)
var (
cuda13DirExists bool
cuda12DirExists bool
cuda13DirExists bool
cuda12DirExists bool
capabilityLogged bool
)
func init() {
@@ -133,7 +134,10 @@ func (s *SystemState) getSystemCapabilities() string {
return defaultCapability
}
xlog.Info("Capability automatically detected", "capability", s.GPUVendor, "env", capabilityEnv)
if !capabilityLogged {
xlog.Info("Capability automatically detected", "capability", s.GPUVendor, "env", capabilityEnv)
capabilityLogged = true
}
// If vram is less than 4GB, let's default to CPU but warn the user that they can override that via env
if s.VRAM <= 4*1024*1024*1024 {
xlog.Warn("VRAM is less than 4GB, defaulting to CPU", "env", capabilityEnv)