--verbose_response parameter#4205
Open
dkalinowski wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new --verbose_response server setting to help debug LLM OpenAI-compatible chat/text completion responses by embedding raw prompt/output details into unary JSON responses.
Changes:
- Add
--verbose_responseCLI flag and plumb it intoServerSettingsImpl. - Capture the post-template prompt in the request handler when verbose mode is enabled.
- Extend OpenAI chat/text completions unary JSON serialization to optionally emit a
__verboseobject containing the prompt and raw decoded outputs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/llm/servable.cpp |
Enables verbose mode per-request and passes the final prompt text into the API handler before tokenization. |
src/llm/apis/openai_completions.cpp |
Adds optional __verbose section to unary responses for multiple result types (GenerationOutput, EncodedResults, VLM). |
src/llm/apis/openai_api_handler.hpp |
Adds stored state + accessors for verbose mode (verboseResponse, verbosePrompt). |
src/cli_parser.cpp |
Adds the --verbose_response CLI option and maps it into server settings. |
src/capi_frontend/server_settings.hpp |
Adds verboseResponse boolean to ServerSettingsImpl. |
Comments suppressed due to low confidence (1)
src/llm/apis/openai_completions.cpp:401
- The
__verboseserialization logic is duplicated across the threeserializeUnaryResponse(...)overloads. Consider extracting it into a shared helper to reduce maintenance overhead and prevent the overloads from diverging over time.
if (isVerboseResponse()) {
jsonResponse.StartObject("__verbose");
jsonResponse.String("prompt", getVerbosePrompt());
jsonResponse.StartArray("raw_outputs");
for (const ov::genai::GenerationOutput& generationOutput : generationOutputs) {
Comment on lines
+397
to
+401
| if (isVerboseResponse()) { | ||
| jsonResponse.StartObject("__verbose"); | ||
| jsonResponse.String("prompt", getVerbosePrompt()); | ||
| jsonResponse.StartArray("raw_outputs"); | ||
| for (const ov::genai::GenerationOutput& generationOutput : generationOutputs) { |
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.
No description provided.