diff --git a/lib/bindings/python/src/dynamo/llm/__init__.py b/lib/bindings/python/src/dynamo/llm/__init__.py index 264cc7e34467..71bef20f8780 100644 --- a/lib/bindings/python/src/dynamo/llm/__init__.py +++ b/lib/bindings/python/src/dynamo/llm/__init__.py @@ -61,6 +61,8 @@ except ImportError: pass +from ._unary import LLMUnaryClient as LLMUnaryClient +from ._unary import with_engine_data as with_engine_data from .exceptions import HttpError from .exceptions import RouterQueueLimitExceeded as RouterQueueLimitExceeded diff --git a/components/src/dynamo/experimental/llm.py b/lib/bindings/python/src/dynamo/llm/_unary.py similarity index 100% rename from components/src/dynamo/experimental/llm.py rename to lib/bindings/python/src/dynamo/llm/_unary.py diff --git a/lib/bindings/python/src/dynamo/runtime/__init__.py b/lib/bindings/python/src/dynamo/runtime/__init__.py index 1836bcfb7f6f..d7620792761d 100644 --- a/lib/bindings/python/src/dynamo/runtime/__init__.py +++ b/lib/bindings/python/src/dynamo/runtime/__init__.py @@ -17,6 +17,9 @@ from dynamo._core import Endpoint as Endpoint from dynamo._core import PyAsyncRequestStream as PyAsyncRequestStream +from ._unary import UnaryClient as UnaryClient +from ._unary import serve_unary_endpoint as serve_unary_endpoint + def dynamo_worker(enable_nats: Optional[bool] = None): """ diff --git a/components/src/dynamo/experimental/endpoint.py b/lib/bindings/python/src/dynamo/runtime/_unary.py similarity index 100% rename from components/src/dynamo/experimental/endpoint.py rename to lib/bindings/python/src/dynamo/runtime/_unary.py diff --git a/lib/bindings/python/tests/test_experimental_unary.py b/lib/bindings/python/tests/test_exported_unary_integration.py similarity index 93% rename from lib/bindings/python/tests/test_experimental_unary.py rename to lib/bindings/python/tests/test_exported_unary_integration.py index 5d01d17ccb53..71be921bdd42 100644 --- a/lib/bindings/python/tests/test_experimental_unary.py +++ b/lib/bindings/python/tests/test_exported_unary_integration.py @@ -10,9 +10,12 @@ import pytest from dynamo._core import Context -from dynamo.experimental.endpoint import UnaryClient, serve_unary_endpoint -from dynamo.experimental.llm import LLMUnaryClient +from dynamo.llm import LLMUnaryClient +from dynamo.runtime import UnaryClient, serve_unary_endpoint +# Keep this module sorted before the non-forked request-plane tests. Those tests +# initialize the process-wide Rust runtime in the pytest parent, whose worker +# threads cannot be inherited safely by this module's forked test processes. pytestmark = [ pytest.mark.asyncio, pytest.mark.forked, diff --git a/components/src/dynamo/experimental/tests/test_llm.py b/lib/bindings/python/tests/test_llm_unary.py similarity index 98% rename from components/src/dynamo/experimental/tests/test_llm.py rename to lib/bindings/python/tests/test_llm_unary.py index 033f8709b87c..57a2382fa42d 100644 --- a/components/src/dynamo/experimental/tests/test_llm.py +++ b/lib/bindings/python/tests/test_llm_unary.py @@ -7,7 +7,7 @@ import pytest -from dynamo.experimental.llm import LLMUnaryClient, with_engine_data +from dynamo.llm import LLMUnaryClient, with_engine_data pytestmark = [ pytest.mark.parallel, diff --git a/components/src/dynamo/experimental/tests/test_endpoint.py b/lib/bindings/python/tests/test_unary.py similarity index 98% rename from components/src/dynamo/experimental/tests/test_endpoint.py rename to lib/bindings/python/tests/test_unary.py index 3f27d5b3e874..4d978042acc7 100644 --- a/components/src/dynamo/experimental/tests/test_endpoint.py +++ b/lib/bindings/python/tests/test_unary.py @@ -7,7 +7,7 @@ import pytest -from dynamo.experimental.endpoint import UnaryClient, serve_unary_endpoint +from dynamo.runtime import UnaryClient, serve_unary_endpoint pytestmark = [ pytest.mark.asyncio,