native/dart_bridge_llm library

DartBridge+LLM

LLM component bridge - manages C++ LLM component lifecycle. Mirrors Swift's CppBridge+LLM.swift pattern exactly.

This is a thin wrapper around C++ LLM component functions. All business logic is in C++ - Dart only manages the handle.

STREAMING ARCHITECTURE: Streaming runs in a background isolate to prevent ANR (Application Not Responding). The C++ logger callback uses NativeCallable.listener which is thread-safe and can be called from any isolate. Token callbacks in the background isolate send messages to the main isolate via a SendPort.

Classes

DartBridgeLLM
LLM component bridge for C++ interop.
LLMComponentResult
Result from LLM generation.