feat(http): add pod/namespace/request-id response headers to /embeddings#374
Open
sbekkerm wants to merge 1 commit intollm-d:mainfrom
Open
feat(http): add pod/namespace/request-id response headers to /embeddings#374sbekkerm wants to merge 1 commit intollm-d:mainfrom
sbekkerm wants to merge 1 commit intollm-d:mainfrom
Conversation
Use shared addResponseHeaders helper so embeddings matches completions. Signed-off-by: Sergey Bekkerman <[email protected]>
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
Adds the same optional response headers to
/v1/embeddingsthat are already sent for chat/text completions: pod, port, namespace, and request-id (whenEnableRequestIDHeadersis set). This makes embeddings responses consistent with completions for testing and debugging (e.g. in multi-pod setups).Changes
addResponseHeadershelper — New helper onVllmSimulatorthat sets pod, port, namespace, and request-id on the response when configured. Only adds the request-id header when it is non-empty.HandleEmbeddingsnow callsaddResponseHeaders(ctx, s.getRequestID(ctx))before sending the JSON response.handleHTTPnow uses the same helper withreqCtx.request().GetRequestID()instead of inlining the header logic.