// Requires an optional native-engine build and a compatible local GGUF file.
// Replace the artifact path before running. Checking does not load or serve it.
import aner.llm
import aner.api

let base = llm.load("models/research-model.gguf", context: 16384,
    device: "metal", kv_cache_type: "q8_0", flash_attention: "on")
let model = base.with_context_pool(max_idle: 1)
base.close()
print(model.load_summary())
let app = api.app("Aner native chat").llm(path: "/chat", model: model)
    .bind(host: "127.0.0.1", port: 11435)
    .limits(max_rows: 64, timeout_ms: 120000)
    .output_limit(max_tokens: 512)
    .session_limit(max_sessions: 2)
app.serve()
model.close()
