Qu

generate

Builtin index · Statistics & ML

result = model.generate(prompt, [max_tokens=64])

Input: prompt, max_tokens · Output: result

What it is

Runs greedy (argmax, no sampling knobs, no temperature) text completion on a model handle model from llm_load, given a string prompt and an integer cap max_tokens (default 64) on how many tokens to generate.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = model.generate(prompt, [max_tokens=64])
prompt stringnot documented yet
max_tokens string, optional (default 64)not documented yet
result string
Returns the completion as a plain string. There is no streaming and no hidden conversation state — each call is independent, so a multi-turn chat has to concatenate prior turns into prompt itself.

Examples

No documentation example calls this form yet. The Statistics & ML chapter is where one belongs.