Fix Chunked Response Formatting #7

Closed
opened 2025-07-08 08:36:38 -04:00 by AtHeartEngineer · 0 comments

Originally created by @Mascinissa on 2/11/2025

Hey folks,

I'm new to this repo and wasn't sure how the original _send_response method was supposed to work, but I noticed it was adding a "400" at the beginning and a "0" at the end of JSON responses. I tweaked it to properly handle response content without extra characters. Tested it, and it seems to work fine now!

I also added the /v1/chat/completions to the endpoints considered by the queuing mechanism. This endpoint is accessed when running ollama with OpenAI's API.

Let me know if anything needs adjusting. Happy to contribute!

*Originally created by @Mascinissa on 2/11/2025* Hey folks, I'm new to this repo and wasn't sure how the original `_send_response` method was supposed to work, but I noticed it was adding a "400" at the beginning and a "0" at the end of JSON responses. I tweaked it to properly handle response content without extra characters. Tested it, and it seems to work fine now! I also added the `/v1/chat/completions` to the endpoints considered by the queuing mechanism. This endpoint is accessed when running ollama with OpenAI's API. Let me know if anything needs adjusting. Happy to contribute!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/ollama_proxy_server#7