import { type ChildProcess } from "node:child_process"; import { type NolRuntimeBinding } from "../_types/schemas/nol.js"; import { type NolWorkerOwnership, type NolWorkerLimits } from "../_types/execution/nol/worker-protocol.js"; import type { NolCudaPlacement } from "./cuda-lease.js"; export declare const nolVllmStartupDigest: () => string; /** Startup transport/admission foundation only. No backend capability, native * conformance, generation, scientific acceptance, or promotion is conferred. */ export declare const NOL_VLLM_STARTUP_VERSION: "omnius.nol.vllm-startup.v2"; export declare const NOL_VLLM_PRIVATE_VERSION: "omnius.nol.vllm-private.v1"; /** One fixed admission contract for the host and its private pipe transport. */ export declare const NOL_VLLM_WORKER_LIMIT_BOUNDS: Readonly<{ maxFrameBytes: 1048576; maxStdoutBytes: 16777216; maxStderrBytes: 16777216; requestTimeoutMs: 86400000; killGraceMs: 60000; }>; export declare function validateNolVllmWorkerLimits(value: NolWorkerLimits): void; /** Fixed job policy. CUDA identity is supplied exclusively by the lease. */ export declare function nolVllmWorkerEnvironment(base: NodeJS.ProcessEnv): NodeJS.ProcessEnv; export declare const NOL_VLLM_STARTUP_ROUTINES: readonly [ "block_table_warmup", "kv_zeroer_warmup", "qwen_causal_conv1d", "qwen_post_conv_1", "qwen_post_conv_2", "qwen_post_conv_16", "qwen_gating_delta", "sampler_warmup" ]; export interface NolVllmStartupPlan { schema: typeof NOL_VLLM_STARTUP_VERSION; binding: NolRuntimeBinding; gpuUuid: string; reservedMiB: number; requestPolicyDigest: string; source: { workerSha256: string; companionSha256: string; runtimeSha256: string; }; engine: { dtype: "bfloat16"; maxModelLen: number; maxNumBatchedTokens: number; maxNumSeqs: 1; kvCacheBytes: number; seed: number; tensorParallelSize: 1; pipelineParallelSize: 1; dataParallelSize: 1; executor: "uni"; enforceEager: true; chunkedPrefill: false; prefixCaching: false; asyncScheduling: false; taps: [ ]; speculative: false; lora: false; logStats: true; }; limits: { maxProfileCalls: number; maxDummyForwards: number; maxForwardPositions: number; maxRoutineCalls: number; maxRoutinePositions: number; maxSamplerDrawRows: number; maxCaptureBytes: 0; maxCaptures: 0; maxGeneratedTokens: 0; maxLoadBytes: number; maxGateMs: number; }; } export interface NolVllmRuntimeInventoryRequest { dependencyLockPath: string; dependencyLockSha256: string; maxRuntimeBytes: number; maxRuntimeFiles: number; } export interface NolVllmRuntimeInventory { schema: "omnius.nol.vllm-runtime-inventory.v1"; inventoryDigest: string; pythonVersion: string; pythonExecutable: { sha256: string; sizeBytes: number; }; pythonRuntimeLibrary: { path: string; sha256: string; sizeBytes: number; } | null; pythonStdlib: { files: number; digest: string; }; pythonImportArchives: { path: string; sha256: string; sizeBytes: number; }[]; pythonImportPathDigest: string; pythonCacheTag: string; bytecodeMagic: string; optimization: number; isolated: true; userSiteDisabled: true; bytecodeWritesDisabled: true; dependencyLock: { sha256: string; sizeBytes: number; }; packages: { name: string; version: string; files: number; digest: string; }[]; bytecode: { files: number; digest: string; }; unrecordedExecutable: { files: number; digest: string; }; environment: Record; files: number; bytes: number; scope: "installed_wheel_code_metadata_stdlib_executable_bytecode_interpreter_and_lock_not_driver_or_future_JIT_artifacts"; nativeConformance: "unverified"; capabilityAuthority: "none"; } /** Observational metadata only. Even a matching full digest never installs a * runtime designation or authorizes model loading/compute. Existing pyc and * unrecorded executable files are part of the digest; -B alone is insufficient. */ export declare function verifyNolVllmRuntimeInventory(input: unknown, requestInput: NolVllmRuntimeInventoryRequest): NolVllmRuntimeInventory; /** Replay only the frozen execution whitelist. Device scope always comes from * the current lease (or -1 for the separate CPU tokenizer), never the snapshot. */ export declare function replayNolVllmRuntimeEnvironment(snapshot: Readonly>, gpuUuid: string): NodeJS.ProcessEnv; export declare function parseNolVllmStartupPlan(input: unknown): NolVllmStartupPlan; /** Checks bounded observations only; it never upgrades CPU transport facts to * native conformance or backend capability authority. */ export declare function verifyNolVllmStartupObservation(input: unknown, startup: NolVllmStartupPlan): unknown; export interface NolVllmStartupTransport { readonly sessionId: string; readonly pid: number | null; readonly closed: Promise; start(signal: AbortSignal): Promise; request(action: "load" | "inspect" | "tokenize" | "reset" | "generate" | "profile", payload: unknown, signal: AbortSignal): Promise; onPrivateEvent(listener: (event: unknown) => void): void; grant(event: Record): void; retire(reason?: unknown): void; } export interface NolVllmStartupLease { readonly gpuUuid: string; environment(): NodeJS.ProcessEnv; attach(child: ChildProcess): void; loaded(): Promise; stop(): void; settle(): Promise; } export interface NolVllmStartupSessionOptions { pythonPath: string; workerPath: string; companionPath: string; ownership: NolWorkerOwnership; plan: NolVllmStartupPlan; /** Full data-only descriptor sealed by plan.requestPolicyDigest. */ loadDescriptor?: unknown; runtimeEnvironment?: Readonly>; limits: NolWorkerLimits; lease: NolVllmStartupLease; assertCurrent(): void; /** Installed host authorization for this exact model/runtime; never supplied * by a serialized request or inferred from model metadata. */ authorizeLoad(plan: NolVllmStartupPlan, signal: AbortSignal, admission: Readonly<{ pid: number; startIdentity: string; gpuUuid: string; planDigest: string; loadNonce: string; sessionId: string; jobId: string; ownerId: string; generation: number; }>): Promise; onPlacementConfirmed(placement: NolCudaPlacement, signal: AbortSignal): Promise; /** Explicit CPU fixture seam; returned observations carry no native authority. */ createTransport?(options: { ownership: NolWorkerOwnership; limits: NolWorkerLimits; env: NodeJS.ProcessEnv; onSpawn(child: ChildProcess): void; }): NolVllmStartupTransport; } /** Inert construction. Stop never means physical settlement; settle retains * actual startup/private-callback promises and waits for owned child close and * the host lease's physical release proof. */ export declare class NolVllmStartupSession { private readonly fixedPlan; get plan(): NolVllmStartupPlan; private transport; private readonly lifetime; private starting; private loading; private inspecting; private inspectionComplete; private readonly requests; private settling; private privateWork; private readonly privateKinds; private loadNonce; private state; private readonly options; constructor(options: NolVllmStartupSessionOptions); private current; start(): Promise; private launch; load(): Promise; /** One bounded stdlib-only observation. It neither creates a model nor * upgrades the source-owned native activation boundary. */ inspectRuntime(input: NolVllmRuntimeInventoryRequest): Promise; private runInspection; private runLoad; private privateEvent; stop(reason?: unknown): void; /** Fixed data-only commands; no collective RPC, Python trace or code port. */ request(action: "tokenize" | "reset" | "generate" | "profile", payload: unknown): Promise; settle(): Promise; private finish; }