/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { CachePolicy, IRunConfig, TaskConfig } from "@workglow/task-graph"; import { CreateWorkflow } from "@workglow/task-graph"; import { DataPortSchema } from "@workglow/util/schema"; import type { ModelConfig } from "../model/ModelSchema"; import { AiTask } from "./base/AiTask"; export type ModelDownloadRemoveTaskRunInput = { model: string | ModelConfig; }; export type ModelDownloadRemoveTaskRunOutput = { model: string | ModelConfig; }; export type ModelDownloadRemoveTaskConfig = TaskConfig; /** * Unload a model from memory and clear its cache. * * @remarks * This task has a side effect of removing the model from memory and deleting cached files */ export declare class ModelDownloadRemoveTask extends AiTask { static type: string; /** * Resolves to the provider's `["model.download-remove"]` run-fn registration. Local * providers (HFT, Ollama, LlamaCpp, TFMP, chrome-ai) opt-in by registering * a run-fn with `serves: ["model.download-remove"]`; cloud providers don't register * one and `ModelDownloadRemoveTask` for cloud models is a no-op (or surfaces as a * runtime "no run-fn for provider serving model.unload" error). */ static readonly requires: ["model.download-remove"]; /** * Provider-lifecycle override: `requires: ["model.download-remove"]` routes the * dispatcher to the provider's unload run-fn, but the *model* record * doesn't need to advertise `model.unload` in its `capabilities` — * unload is a provider-side operation on whatever the provider has * resident, not a property of the model. Skip the capability gate. */ protected gateOrThrow(_model: ModelConfig): void; static category: string; static title: string; static description: string; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; static cachePolicy: CachePolicy; } /** * Unload a model from memory and clear its cache. * * @param input - Input containing model(s) to unload * @returns Promise resolving to the unloaded model(s) */ export declare const unloadModel: (input: ModelDownloadRemoveTaskRunInput, config?: ModelDownloadRemoveTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { unloadModel: CreateWorkflow; } } //# sourceMappingURL=ModelDownloadRemoveTask.d.ts.map