server: add OpenAI-compatible /v1/responses endpoint#214
Open
krystophny wants to merge 4 commits intowaybarrios:mainfrom
Open
server: add OpenAI-compatible /v1/responses endpoint#214krystophny wants to merge 4 commits intowaybarrios:mainfrom
krystophny wants to merge 4 commits intowaybarrios:mainfrom
Conversation
c7f7364 to
ad483cc
Compare
This was referenced Mar 25, 2026
df4f9af to
05838da
Compare
…onse_object Replace unbounded dict with OrderedDict (max 1000 entries) to prevent memory leaks from accumulated stored responses. Evict oldest entries on insert when the cap is exceeded. Remove the _stream_response_object function (190 lines) which was never called anywhere in the codebase.
… API Codex sends ResponseReasoningItem in the Responses API input array during multi-turn conversations. Convert reasoning content to assistant messages so the model sees its prior chain-of-thought. Previously this raised an HTTPException, but since the streaming response had already started, this caused a RuntimeError that broke the SSE stream mid-flight.
The reasoning input item rejection (HTTPException 400) was added in PR #28 but conflicts with the earlier fix that converts reasoning items to assistant messages in _responses_input_to_chat_messages. The rejection ran first, crashing the SSE stream mid-flight. Also downgrade reasoning config rejection to a debug log since raising inside the streaming generator causes "response already started" crashes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an OpenAI-compatible
/v1/responsesendpoint for local coding-agent workflows.Scope
previous_response_idreplay for persisted replayable input itemschat_template_kwargsforwardingWhat changed
server.py: full/v1/responsesendpoint with streaming SSEapi/responses_models.py: Pydantic models for Responses API_responses_storecapped withOrderedDictLRU eviction (max 1000)ResponseReasoningIteminput converted to assistant messages (Codex sends these in multi-turn)request.reasoning) logged and ignored instead of crashing mid-streamFiles
vllm_mlx/server.pyvllm_mlx/api/responses_models.pytests/test_responses_api.pyValidation