Never _unsupported() => throw UnsupportedError('llama.cpp is not built in.'); enum GpuBackend { auto, cpu } enum LlamaChatRole { system, user, assistant } class ModelParams { final int gpuLayers; final GpuBackend preferredBackend; const ModelParams({this.gpuLayers = 0, this.preferredBackend = GpuBackend.cpu}); } class GenerationParams { const GenerationParams({ int? maxTokens, double? temp, int? topK, double? topP, double? penalty, bool? reusePromptPrefix, }); } class LlamaChatMessage { LlamaChatMessage.fromText({required LlamaChatRole role, required String text}); } class LlamaDelta { String? get content => null; } class LlamaChoice { LlamaDelta get delta => LlamaDelta(); } class LlamaCompletionChunk { List get choices => const []; } class LlamaBackend {} class LlamaEngine { LlamaEngine(LlamaBackend backend); Future loadModel(String path, {ModelParams? modelParams}) async => _unsupported(); Stream create( List messages, { GenerationParams? params, bool? enableThinking, String? sourceLangCode, String? targetLangCode, }) => _unsupported(); Future dispose() async {} }