import { LLMEngine, LLMModel } from "@infersec/definitions";
import { Logger } from "@infersec/logger";
import EventEmitter from "eventemitter3";
import { Response } from "undici";
import type { RequestInit } from "undici";
import { type ModelDownloadProgressUpdate } from "./download.js";
interface ModelManagerEvents {
    engineError: (error: Error) => void;
    engineReady: () => void;
    engineTerminated: () => void;
}
type EngineLifecycleState = "errored" | "running" | "starting" | "stopped" | "stopping";
export declare class ModelManager extends EventEmitter<ModelManagerEvents> {
    readonly engine: LLMEngine;
    readonly enginePort: number;
    readonly model: LLMModel;
    readonly parallelism: number | null;
    private uniqueName;
    readonly contextLength: number | null;
    protected readonly logger: Logger;
    private engineProcess;
    private healthPollInterval;
    private lifecycleState;
    private stopRequested;
    protected readonly modelsDirectory: string;
    constructor({ contextLength, engine, enginePort, logger, model, parallelism, root }: {
        contextLength?: number | null;
        engine: LLMEngine;
        enginePort: number;
        logger: Logger;
        model: LLMModel;
        parallelism?: number | null;
        root: string;
    });
    fetchOpenAI(path: string, opts?: RequestInit): Promise<Response>;
    prepare({ onDownloadProgress }?: {
        onDownloadProgress?: (update: ModelDownloadProgressUpdate) => void;
    }): Promise<void>;
    start(): Promise<void>;
    stop(): Promise<void>;
    get canStart(): boolean;
    get canStop(): boolean;
    get state(): EngineLifecycleState;
    private checkEngineReadiness;
    private checkLlamacppReadiness;
    private checkVLLMReadiness;
    private waitForEngineReady;
    private clearHealthPoll;
    private startHealthPoll;
    private bindEngineProcessEvents;
    private startEngineProcess;
}
export {};
