From 5be6191171076c3f7f31f6c8b9f1a639198a3349 Mon Sep 17 00:00:00 2001 From: cjackal <44624812+cjackal@users.noreply.github.com> Date: Sat, 26 Oct 2024 14:21:43 +0000 Subject: [PATCH] add example for custom `x-request-id` header --- docs/source/serving/openai_compatible_server.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/source/serving/openai_compatible_server.md b/docs/source/serving/openai_compatible_server.md index cc8e539a8a6d3..57e4c5f798b48 100644 --- a/docs/source/serving/openai_compatible_server.md +++ b/docs/source/serving/openai_compatible_server.md @@ -35,7 +35,7 @@ vLLM also provides experimental support for OpenAI Vision API compatible inferen ## Extra Parameters vLLM supports a set of parameters that are not part of the OpenAI API. In order to use them, you can pass them as extra parameters in the OpenAI client. -Or directly merge them into the JSON payload if you are using HTTP call directly. +Or directly merge them into the HTTP headers or JSON payload if you are using HTTP call directly. ```python completion = client.chat.completions.create( @@ -43,6 +43,9 @@ completion = client.chat.completions.create( messages=[ {"role": "user", "content": "Classify this sentiment: vLLM is wonderful!"} ], + extra_headers={ + "x-request-id": "sentiment-classification-00001", + }, extra_body={ "guided_choice": ["positive", "negative"] }