Skip to content

armgit / uzu

Public Imported from GitHub
0

A high-performance inference engine for AI models

441 B
Raw Blame
import type { PlatformClient } from "./platform-client";

let client: PlatformClient | null = null;

export function initPlatform(impl: PlatformClient): void {
  if (client !== null) {
    throw new Error("Platform already initialized.");
  }
  client = impl;
}

export function getPlatform(): PlatformClient {
  if (client === null) {
    throw new Error("Platform not initialized. Call initPlatform() before use.");
  }
  return client;
}