-- broker.lua — llama.cpp HTTP client. -- Phase 0: blocking POST via libcurl FFI; SSE streaming wired in Phase 1. -- See docs/PHASE0.md §6. local M = {} -- Send a /v1/chat/completions request. -- model_cfg: entry from config.models (endpoint, model, temperature, [key_env]) -- messages: list of { role = ..., content = ... } including system prompt -- Returns: assistant content string on success, (nil, errmsg) on failure. function M.chat(model_cfg, messages) error("broker.chat: not implemented (Phase 0 pending)") end return M