Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
d65fac27
Unverified
Commit
d65fac27
authored
Mar 03, 2024
by
Jason Cox
Committed by
GitHub
Mar 02, 2024
Browse files
Add vLLM version info to logs and openai API server (#3161)
parent
ce4f5a29
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
vllm/engine/llm_engine.py
vllm/engine/llm_engine.py
+2
-1
vllm/entrypoints/openai/api_server.py
vllm/entrypoints/openai/api_server.py
+8
-0
No files found.
vllm/engine/llm_engine.py
View file @
d65fac27
...
...
@@ -7,6 +7,7 @@ import importlib
from
typing
import
(
TYPE_CHECKING
,
Any
,
Dict
,
Iterable
,
List
,
Optional
,
Tuple
,
Union
)
import
vllm
from
vllm.lora.request
import
LoRARequest
from
vllm.config
import
(
CacheConfig
,
DeviceConfig
,
ModelConfig
,
ParallelConfig
,
SchedulerConfig
,
LoRAConfig
)
...
...
@@ -85,7 +86,7 @@ class LLMEngine:
log_stats
:
bool
,
)
->
None
:
logger
.
info
(
"Initializing an LLM engine with config: "
f
"Initializing an LLM engine
(v
{
vllm
.
__version__
}
)
with config: "
f
"model=
{
model_config
.
model
!
r
}
, "
f
"tokenizer=
{
model_config
.
tokenizer
!
r
}
, "
f
"tokenizer_mode=
{
model_config
.
tokenizer_mode
}
, "
...
...
vllm/entrypoints/openai/api_server.py
View file @
d65fac27
...
...
@@ -15,6 +15,7 @@ from fastapi.exceptions import RequestValidationError
from
fastapi.middleware.cors
import
CORSMiddleware
from
fastapi.responses
import
JSONResponse
,
StreamingResponse
,
Response
import
vllm
from
vllm.engine.arg_utils
import
AsyncEngineArgs
from
vllm.engine.async_llm_engine
import
AsyncLLMEngine
from
vllm.entrypoints.openai.protocol
import
CompletionRequest
,
ChatCompletionRequest
,
ErrorResponse
...
...
@@ -168,6 +169,12 @@ async def show_available_models():
return
JSONResponse
(
content
=
models
.
model_dump
())
@
app
.
get
(
"/version"
)
async
def
show_version
():
ver
=
{
"version"
:
vllm
.
__version__
}
return
JSONResponse
(
content
=
ver
)
@
app
.
post
(
"/v1/chat/completions"
)
async
def
create_chat_completion
(
request
:
ChatCompletionRequest
,
raw_request
:
Request
):
...
...
@@ -231,6 +238,7 @@ if __name__ == "__main__":
f
"Invalid middleware
{
middleware
}
. Must be a function or a class."
)
logger
.
info
(
f
"vLLM API server version
{
vllm
.
__version__
}
"
)
logger
.
info
(
f
"args:
{
args
}
"
)
if
args
.
served_model_name
is
not
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment