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
dynamo
Commits
30e5c35b
"vscode:/vscode.git/clone" did not exist on "2887cd1ce052df20d2e4e0109ad74d2074164cfd"
Unverified
Commit
30e5c35b
authored
Jul 11, 2025
by
Alec
Committed by
GitHub
Jul 12, 2025
Browse files
fix: add capi to pip and make it fallback (#1904)
parent
35c56065
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
deploy/sdk/src/dynamo/sdk/__init__.py
deploy/sdk/src/dynamo/sdk/__init__.py
+2
-0
deploy/sdk/src/dynamo/sdk/lib/utils.py
deploy/sdk/src/dynamo/sdk/lib/utils.py
+25
-0
hatch_build.py
hatch_build.py
+1
-0
launch/dynamo-run/src/subprocess/vllm_inc.py
launch/dynamo-run/src/subprocess/vllm_inc.py
+2
-1
No files found.
deploy/sdk/src/dynamo/sdk/__init__.py
View file @
30e5c35b
...
@@ -23,6 +23,7 @@ from dynamo.sdk.core.decorators.endpoint import abstract_endpoint, api, endpoint
...
@@ -23,6 +23,7 @@ from dynamo.sdk.core.decorators.endpoint import abstract_endpoint, api, endpoint
from
dynamo.sdk.core.lib
import
DYNAMO_IMAGE
,
depends
,
liveness
,
readiness
,
service
from
dynamo.sdk.core.lib
import
DYNAMO_IMAGE
,
depends
,
liveness
,
readiness
,
service
from
dynamo.sdk.core.protocol.interface
import
AbstractService
from
dynamo.sdk.core.protocol.interface
import
AbstractService
from
dynamo.sdk.lib.decorators
import
async_on_start
,
on_shutdown
from
dynamo.sdk.lib.decorators
import
async_on_start
,
on_shutdown
from
dynamo.sdk.lib.utils
import
get_capi_library_path
dynamo_context
:
dict
[
str
,
Any
]
=
{}
dynamo_context
:
dict
[
str
,
Any
]
=
{}
...
@@ -39,4 +40,5 @@ __all__ = [
...
@@ -39,4 +40,5 @@ __all__ = [
"abstract_endpoint"
,
"abstract_endpoint"
,
"liveness"
,
"liveness"
,
"readiness"
,
"readiness"
,
"get_capi_library_path"
,
]
]
deploy/sdk/src/dynamo/sdk/lib/utils.py
View file @
30e5c35b
...
@@ -132,3 +132,28 @@ def upload_graph(
...
@@ -132,3 +132,28 @@ def upload_graph(
)
)
if
resp
.
status_code
not
in
(
200
,
201
,
204
):
if
resp
.
status_code
not
in
(
200
,
201
,
204
):
raise
RuntimeError
(
f
"Failed to upload graph artifact:
{
resp
.
text
}
"
)
raise
RuntimeError
(
f
"Failed to upload graph artifact:
{
resp
.
text
}
"
)
def
get_capi_library_path
()
->
str
:
"""
Get the path to the libdynamo_llm_capi.so library.
First checks the VLLM_KV_CAPI_PATH environment variable.
If not set, returns the path where the library is installed by the wheel.
Returns:
The path to the library.
"""
# First check environment variable
env_path
=
os
.
environ
.
get
(
"VLLM_KV_CAPI_PATH"
)
if
env_path
:
return
env_path
# Fall back to the installed location
# The library is installed at dynamo/sdk/cli/bin/libdynamo_llm_capi.so
import
dynamo.sdk
sdk_path
=
os
.
path
.
dirname
(
dynamo
.
sdk
.
__file__
)
lib_path
=
os
.
path
.
join
(
sdk_path
,
"cli"
,
"bin"
,
"libdynamo_llm_capi.so"
)
return
lib_path
hatch_build.py
View file @
30e5c35b
...
@@ -28,4 +28,5 @@ class CustomBuildHook(BuildHookInterface):
...
@@ -28,4 +28,5 @@ class CustomBuildHook(BuildHookInterface):
f
"
{
bin_path
}
/http"
:
"dynamo/sdk/cli/bin/http"
,
f
"
{
bin_path
}
/http"
:
"dynamo/sdk/cli/bin/http"
,
f
"
{
bin_path
}
/metrics"
:
"dynamo/sdk/cli/bin/metrics"
,
f
"
{
bin_path
}
/metrics"
:
"dynamo/sdk/cli/bin/metrics"
,
f
"
{
bin_path
}
/mock_worker"
:
"dynamo/sdk/cli/bin/mock_worker"
,
f
"
{
bin_path
}
/mock_worker"
:
"dynamo/sdk/cli/bin/mock_worker"
,
f
"
{
bin_path
}
/libdynamo_llm_capi.so"
:
"dynamo/sdk/cli/bin/libdynamo_llm_capi.so"
,
}
}
launch/dynamo-run/src/subprocess/vllm_inc.py
View file @
30e5c35b
...
@@ -36,6 +36,7 @@ from dynamo.llm import (
...
@@ -36,6 +36,7 @@ from dynamo.llm import (
)
)
from
dynamo.runtime
import
DistributedRuntime
,
dynamo_worker
from
dynamo.runtime
import
DistributedRuntime
,
dynamo_worker
from
dynamo.runtime.logging
import
configure_dynamo_logging
from
dynamo.runtime.logging
import
configure_dynamo_logging
from
dynamo.sdk.lib.utils
import
get_capi_library_path
# Only used if you run it manually from the command line
# Only used if you run it manually from the command line
DEFAULT_ENDPOINT
=
"dyn://dynamo.backend.generate"
DEFAULT_ENDPOINT
=
"dyn://dynamo.backend.generate"
...
@@ -208,7 +209,7 @@ async def init(runtime: DistributedRuntime, config: Config):
...
@@ -208,7 +209,7 @@ async def init(runtime: DistributedRuntime, config: Config):
_check_and_set_env_value
(
"VLLM_WORKER_ID"
,
str
(
endpoint
.
lease_id
()))
_check_and_set_env_value
(
"VLLM_WORKER_ID"
,
str
(
endpoint
.
lease_id
()))
_check_and_set_env_value
(
_check_and_set_env_value
(
"VLLM_KV_CAPI_PATH"
,
"libdynamo_llm_capi.so"
,
allow_override
=
True
"VLLM_KV_CAPI_PATH"
,
get_capi_library_path
()
,
allow_override
=
True
)
)
_check_and_set_env_value
(
"VLLM_KV_NAMESPACE"
,
config
.
namespace
)
_check_and_set_env_value
(
"VLLM_KV_NAMESPACE"
,
config
.
namespace
)
_check_and_set_env_value
(
"VLLM_KV_COMPONENT"
,
config
.
component
)
_check_and_set_env_value
(
"VLLM_KV_COMPONENT"
,
config
.
component
)
...
...
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