Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
ccd153af
Commit
ccd153af
authored
Feb 21, 2025
by
Alec
Committed by
GitHub
Feb 21, 2025
Browse files
[fix] initialize vLLM engine before runtime (#238)
Co-authored-by:
hongkuanz
<
hongkuanz@nvidia.com
>
parent
32a748e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
examples/python_rs/llm/vllm/kv_router/worker.py
examples/python_rs/llm/vllm/kv_router/worker.py
+4
-3
No files found.
examples/python_rs/llm/vllm/kv_router/worker.py
View file @
ccd153af
...
...
@@ -41,9 +41,9 @@ class VllmEngine(BaseVllmEngine):
@
triton_endpoint
(
vLLMGenerateRequest
,
MyRequestOutput
)
async
def
generate
(
self
,
request
)
->
AsyncIterator
:
if
self
.
engine_client
is
None
:
await
self
.
initialize
()
assert
self
.
engine_client
i
s
not
None
,
"engine_client was not
initialize
d
"
assert
(
self
.
engine_client
is
not
None
),
"
engine_client
wa
s not
initialized, must call
initialize
() first
"
sampling_params
=
request
.
sampling_params
# rust HTTP requires Delta streaming
...
...
@@ -83,6 +83,7 @@ async def worker(runtime: DistributedRuntime, engine_args: AsyncEngineArgs):
vllm_logger
.
info
(
f
"Generate endpoint ID:
{
VLLM_WORKER_ID
}
"
)
vllm_engine
=
VllmEngine
(
engine_args
)
await
vllm_engine
.
initialize
()
await
worker_endpoint
.
serve_endpoint
(
vllm_engine
.
generate
)
...
...
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