package com.kazeia.llm
// Remplace ExecuTorchLlmEngine. Mono-moteur Speaker+Thinker (budget thinking off).
class EngineJni {
    external fun load(ggufPath: String, nCtx: Int): Long
    external fun generate(h: Long, sys: String, usr: String, maxTok: Int): String
    external fun reset(h: Long); external fun free(h: Long)
    companion object { init { System.loadLibrary("kazeia_engine") } }
}
class EngineLlmEngine(model: String, ctx: Int = 2048) {
    private val jni = EngineJni(); private val h = jni.load(model, ctx)
    // Thinker: bullets; Speaker: SYS_KAZEIA + bullets. reset() entre tours, ou cache persistant.
    fun generate(sys: String, usr: String, max: Int = 64) = jni.generate(h, sys, usr, max)
    fun reset() = jni.reset(h); fun release() = jni.free(h)
}
