
Drives a chat turn against a colocated SGLang service from a user and system String, streaming the reply as String chunks and closing with a StreamEnd; supports JSON-object output and rolling conversation history.
Voice assistant — transcribe speech, reason on SGLang, speak the answer.
Document Q&A — OCR a page, answer over it, emit JSON.
model_name is required; it is declared as a dependency and deployed alongside, with its address read from the environment at startup and its OpenAI-style route called without authentication, so the service must accept unauthenticated requests.streaming on the reply arrives as incremental chunks, otherwise as one chunk at completion, and emit_stream_end is what produces the StreamEnd.history_messages set to zero runs stateless, negative keeps the full conversation, and positive keeps the last N turns; max_parallel only takes effect in the stateless case, since carrying history forces sequential turns.preempt_on_new_input cancels the in-flight stream when a fresh prompt arrives, so the abandoned turn surfaces downstream as a truncated stream.json_mode asks the service for a JSON object but the output is not re-validated here, so a non-conforming response propagates unchanged.max_tokens caps per-turn generation; exceeding the service's context length surfaces as a backend error rather than a local truncation.Automated release