Array of completion choices (typically contains one item)
The generated message
Optionalfinish_reason?: stringReason the completion finished: 'stop', 'length', etc.
OptionalusageToken usage statistics
Number of tokens in the prompt
Number of tokens in the completion
Total tokens used (prompt + completion)
Result from a WebLLM chat completion request. Compatible with OpenAI chat completion API format.
Example