diff --git a/vllm/entrypoints/openai/serving_completion.py b/vllm/entrypoints/openai/serving_completion.py index 55cd0157960be..9c719d634ac7d 100644 --- a/vllm/entrypoints/openai/serving_completion.py +++ b/vllm/entrypoints/openai/serving_completion.py @@ -301,7 +301,7 @@ async def completion_stream_generator( else: chunk.usage = None - response_json = chunk.model_dump_json(exclude_unset=True) + response_json = chunk.model_dump_json(exclude_unset=False) yield f"data: {response_json}\n\n" if (request.stream_options @@ -314,7 +314,7 @@ async def completion_stream_generator( usage=usage, ) final_usage_data = (final_usage_chunk.model_dump_json( - exclude_unset=True, exclude_none=True)) + exclude_unset=False, exclude_none=True)) yield f"data: {final_usage_data}\n\n" except ValueError as e: