Foundry-Local icon indicating copy to clipboard operation
Foundry-Local copied to clipboard

Foundry Local 0.8.101 does not emit finish_reason

Open joergjo opened this issue 3 months ago • 1 comments

When using streaming APIs in Foundry Local 0.8.101, there is no finish_reason field in the choices array.

data: {"model":"qwen2.5-1.5b-instruct-generic-gpu:3","choices":[{"delta":{"role":"assistant","content":"ence","tool_calls":[]},"message":{"role":"assistant","content":"ence","tool_calls":[]},"index":0}],"created":1762612476,"CreatedAt":"2025-11-08T14:34:36+00:00","id":"chat.id.1","IsDelta":false,"Successful":true,"HttpStatusCode":0,"object":"chat.completion.chunk"}

data: {"model":"qwen2.5-1.5b-instruct-generic-gpu:3","choices":[{"delta":{"role":"assistant","content":" holds","tool_calls":[]},"message":{"role":"assistant","content":" holds","tool_calls":[]},"index":0}],"created":1762612476,"CreatedAt":"2025-11-08T14:34:36+00:00","id":"chat.id.1","IsDelta":false,"Successful":true,"HttpStatusCode":0,"object":"chat.completion.chunk"}

data: {"model":"qwen2.5-1.5b-instruct-generic-gpu:3","choices":[{"delta":{"role":"assistant","content":" its","tool_calls":[]},"message":{"role":"assistant","content":" its","tool_calls":[]},"index":0}],"created":1762612476,"CreatedAt":"2025-11-08T14:34:36+00:00","id":"chat.id.1","IsDelta":false,"Successful":true,"HttpStatusCode":0,"object":"chat.completion.chunk"}

data: {"model":"qwen2.5-1.5b-instruct-generic-gpu:3","choices":[{"delta":{"role":"assistant","content":" breath","tool_calls":[]},"message":{"role":"assistant","content":" breath","tool_calls":[]},"index":0}],"created":1762612476,"CreatedAt":"2025-11-08T14:34:36+00:00","id":"chat.id.1","IsDelta":false,"Successful":true,"HttpStatusCode":0,"object":"chat.completion.chunk"}

data: {"model":"qwen2.5-1.5b-instruct-generic-gpu:3","choices":[{"delta":{"role":"assistant","content":".","tool_calls":[]},"message":{"role":"assistant","content":".","tool_calls":[]},"index":0}],"created":1762612476,"CreatedAt":"2025-11-08T14:34:36+00:00","id":"chat.id.1","IsDelta":false,"Successful":true,"HttpStatusCode":0,"object":"chat.completion.chunk"}

data: [DONE]

This breaks proper streaming completion, tool calls, max tokens overage etc.

joergjo avatar Nov 09 '25 15:11 joergjo

Upvoted for visibilty - this is causing issues with AnythingLLM rendering since now we cannot close responses in a standard way

timothycarambat avatar Nov 18 '25 23:11 timothycarambat