package com.correx.infrastructure.inference.commons

import com.correx.core.inference.InferenceProvider

/**
 * A wrapper around [InferenceProvider] that tracks model lifecycle.
 * Ensures the provider is tied to a specific [ModelManager] instance and [ModelDescriptor].
 */
interface ManagedInferenceProvider : InferenceProvider {
    /**
     * Unload the managed model.
     */
    suspend fun unload()

    /**
     * Check if the underlying model is still loaded.
     */
    fun isLoaded(): Boolean

    /**
     * Load a different model, replacing this one.
     */
    suspend fun load(newDescriptor: ModelDescriptor): ManagedInferenceProvider
}
