Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`pinned: true` model is freed after every request — idle-unload exclusion (#9305) ineffective on v4.7.1

オープン
#11,101 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go
領域
backend

調査の方向性

ログに示された削除およびFree()の経路を確認するため、pkg/model/process.goから開始し、次にpinnedおよびmax_active_backendsの設定がバックエンドのクリーンアップにどう到達するかを追跡します。記載されているv4.7.1のランタイム設定と2つのリクエストで再現します。pinnedモデルのバックエンドプロセスがアイドルタイムアウトなしでリクエスト間も常駐すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Follow-up to #9305 / #9309 (exclude models from idle unloading via pinned: true). On v4.7.1 a pinned: true model is not kept resident — its backend process is torn down after every request, so each call pays a full cold reload.

Environment
  • LocalAI v4.7.1, image localai/localai:v4.7.1-gpu-nvidia-cuda-13, single NVIDIA 16 GB GPU, llama-cpp (cuda13) backend.
  • Model YAML: backend: llama-cpp, pinned: true, context_size: 24576.
  • Runtime settings: watchdog_enabled: false, single_backend: false, max_active_backends: 0 (docs: "0 = unlimited"), memory_reclaimer_enabled: false, size_aware_eviction: false, force_eviction_when_busy: false.
Expected

Per the docs ("a pinned model is never evicted") and #9305: with no watchdog, no LRU limit, and pinned: true, the model should stay loaded across requests.

Actual

The backend is freed immediately after each response completes (not after any idle timeout):

INFO  ... Predict request completed successfully
DEBUG Deleting process model="qwen3.5-9b"           (pkg/model/process.go:49)
DEBUG Calling Free() to release GPU resources model="qwen3.5-9b"
INFO  Backend process stopped id="qwen3.5-9b" exitCode="0"

This repeats for every single request across the log; the next request cold-loads (~10 s). Confirmed via nvidia-smi: the backend process disappears seconds after each response and reloads on the next call.

Repro
  1. Load a pinned: true llama-cpp model on v4.7.1 with the runtime settings above.
  2. Send two chat completions about a minute apart.
  3. Observe (via nvidia-smi) the backend process disappear after the first completes and reload for the second.
Question

Is pinned: true expected to keep a model resident, or only to exempt it from eviction while some other path still frees it? If max_active_backends: 0 (documented as "unlimited") is implicated, the "0 = unlimited" behaviour and the #9305 exclusion don't appear to hold. Net effect: pinned currently provides no persistence benefit — every request pays a full cold model load.

主要言語
Go
スター
49.2k
フォーク
4.5k
平均マージ
19時間 42分
マージ済み PR(30日)
299

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mudler/LocalAI のほかの issue

mudler/LocalAI の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。