-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Add "/server_info" endpoint in api_server to retrieve the vllm_config. #16572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
df44ffc
1a72372
41973c3
57034d4
0dc5397
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
from typing_extensions import assert_never | ||
|
||
import vllm.envs as envs | ||
from vllm.config import ModelConfig | ||
from vllm.config import ModelConfig, VllmConfig | ||
from vllm.engine.arg_utils import AsyncEngineArgs | ||
from vllm.engine.async_llm_engine import AsyncLLMEngine # type: ignore | ||
from vllm.engine.multiprocessing.client import MQLLMEngineClient | ||
|
@@ -327,6 +327,7 @@ | |
"/load", | ||
"/ping", | ||
"/version", | ||
"/server_info", | ||
], | ||
registry=registry, | ||
).add().instrument(app).expose(app) | ||
|
@@ -728,6 +729,11 @@ | |
is_sleeping = await engine_client(raw_request).is_sleeping() | ||
return JSONResponse(content={"is_sleeping": is_sleeping}) | ||
|
||
@router.get("/server_info") | ||
async def show_server_info(raw_request: Request): | ||
server_info = {"vllm_config": str(raw_request.app.state.vllm_config)} | ||
return JSONResponse(content=server_info) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Place this at the top of the block since it's more "basic"? |
||
|
||
|
||
@router.post("/invocations", dependencies=[Depends(validate_json_request)]) | ||
async def invocations(raw_request: Request): | ||
|
@@ -894,7 +900,7 @@ | |
|
||
async def init_app_state( | ||
engine_client: EngineClient, | ||
model_config: ModelConfig, | ||
vllm_config: VllmConfig, | ||
state: State, | ||
args: Namespace, | ||
) -> None: | ||
|
@@ -915,6 +921,8 @@ | |
|
||
state.engine_client = engine_client | ||
state.log_stats = not args.disable_log_stats | ||
state.vllm_config = vllm_config | ||
model_config = vllm_config.model_config | ||
|
||
resolved_chat_template = load_chat_template(args.chat_template) | ||
if resolved_chat_template is not None: | ||
|
@@ -1069,8 +1077,8 @@ | |
async with build_async_engine_client(args) as engine_client: | ||
app = build_app(args) | ||
|
||
model_config = await engine_client.get_model_config() | ||
await init_app_state(engine_client, model_config, app.state, args) | ||
vllm_config = await engine_client.get_vllm_config() | ||
Check failure on line 1080 in vllm/entrypoints/openai/api_server.py
|
||
DarkLight1337 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
await init_app_state(engine_client, vllm_config, app.state, args) | ||
|
||
def _listen_addr(a: str) -> str: | ||
if is_valid_ipv6_address(a): | ||
|
Uh oh!
There was an error while loading. Please reload this page.