
Drives a chat turn against a colocated vLLM service from a user and system String, streaming the reply as String chunks and closing with a StreamEnd; supports history and parallel stateless turns. Prefer generate_text_sglang for SGLang.
High-throughput local chat — read prompts from a file, answer, emit JSON.
Voice assistant — transcribe speech, reason on vLLM, speak the answer.
model_name is required; it is declared as a dependency and deployed alongside, with its address read from the environment at startup. An API key is sent only when one is configured in the environment, so the service must accept whichever form the client uses.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 requests a JSON object from the service; service builds that do not honour it return free-form text instead, and the output is not re-validated here.timeout_seconds caps each request, and max_tokens caps per-turn length; long generations need a higher timeout or they fail with a network error.Rebuild against the current pipeml