Skip to content

Model lifecycle explained

A typical model lifecycle with default configuration:

  1. PUT /p/:project/models stores the model definition in the local SQLite database and in-memory cache.
  2. No immediate action is taken. The model sits idle until explicitly woken up via POST /p/:project/models or a direct inference request to this model.
  3. When woken, the orchestrator directly starts a HEAppE job (create + submit) if the count of fresh jobs is below the desired scale. The job's owner is the user whose token triggered the start. Freshness is deduplicated: a start performed by a prior wake event counts until the job becomes visible in the HEAppE listing.
  4. The HEAppE job transitions through queued → running states. Serving state and inference metrics are collected lazily: any consumer reading the model's state (API endpoints, the openai proxy route) opens its own tunnel session (after a one-per-job owner-scoped node-IP resolution) and re-probes the running job's /metrics endpoint when its cached liveness has expired (liveness TTL).
  5. After some amount of time of inactivity on the inference API for the model, the model is considered idle (derived from the last wake-up time and the idle timeout): no new wake events arrive, so no replacement jobs are started, and the existing job drains naturally. The next wake event after the job ends (walltime exhaustion, engine failure, or cancellation) starts a replacement job owned by that requester.

Optionally a model can be set to auto-scale: The scale normally starts at 1, but can increase when auto-scaling is enabled, making it possible to have multiple jobs for the model when all the running jobs get saturated with inference requests.