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
ca31b3aa
Unverified
Commit
ca31b3aa
authored
Jan 21, 2026
by
Graham King
Committed by
GitHub
Jan 22, 2026
Browse files
chore: Remove binding OAIChatPreprocessor (#5516)
Signed-off-by:
Graham King
<
grahamk@nvidia.com
>
parent
91ddf418
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
88 deletions
+1
-88
lib/bindings/python/rust/lib.rs
lib/bindings/python/rust/lib.rs
+0
-1
lib/bindings/python/rust/llm/preprocessor.rs
lib/bindings/python/rust/llm/preprocessor.rs
+1
-72
lib/bindings/python/src/dynamo/_core.pyi
lib/bindings/python/src/dynamo/_core.pyi
+0
-14
lib/bindings/python/src/dynamo/runtime/__init__.py
lib/bindings/python/src/dynamo/runtime/__init__.py
+0
-1
No files found.
lib/bindings/python/rust/lib.rs
View file @
ca31b3aa
...
...
@@ -159,7 +159,6 @@ fn _core(m: &Bound<'_, PyModule>) -> PyResult<()> {
m
.add_class
::
<
llm
::
kv
::
WorkerMetricsPublisher
>
()
?
;
m
.add_class
::
<
llm
::
model_card
::
ModelDeploymentCard
>
()
?
;
m
.add_class
::
<
llm
::
local_model
::
ModelRuntimeConfig
>
()
?
;
m
.add_class
::
<
llm
::
preprocessor
::
OAIChatPreprocessor
>
()
?
;
m
.add_class
::
<
llm
::
preprocessor
::
MediaDecoder
>
()
?
;
m
.add_class
::
<
llm
::
preprocessor
::
MediaFetcher
>
()
?
;
m
.add_class
::
<
llm
::
kv
::
OverlapScores
>
()
?
;
...
...
lib/bindings/python/rust/llm/preprocessor.rs
View file @
ca31b3aa
...
...
@@ -2,80 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
use
super
::
*
;
use
crate
::
llm
::
model_card
::
ModelDeploymentCard
;
use
std
::
time
::
Duration
;
use
llm_rs
::{
preprocessor
::
OpenAIPreprocessor
,
preprocessor
::
media
::{
MediaDecoder
as
RsMediaDecoder
,
MediaFetcher
as
RsMediaFetcher
},
protocols
::
common
::
llm_backend
::{
BackendOutput
,
PreprocessedRequest
},
types
::{
Annotated
,
openai
::
chat_completions
::{
NvCreateChatCompletionRequest
,
NvCreateChatCompletionStreamResponse
,
},
},
};
use
dynamo_runtime
::
pipeline
::{
ManyOut
,
Operator
,
PushRouter
,
SegmentSink
,
ServiceFrontend
,
SingleIn
,
Source
,
};
#[pyclass]
pub
(
crate
)
struct
OAIChatPreprocessor
{
inner
:
Arc
<
llm_rs
::
preprocessor
::
OpenAIPreprocessor
>
,
current
:
Endpoint
,
next
:
Endpoint
,
}
#[pymethods]
impl
OAIChatPreprocessor
{
#[new]
fn
new
(
mdc
:
ModelDeploymentCard
,
current
:
Endpoint
,
next
:
Endpoint
)
->
PyResult
<
Self
>
{
let
preprocessor
=
OpenAIPreprocessor
::
new
(
mdc
.inner
.clone
())
.map_err
(
to_pyerr
)
?
;
Ok
(
Self
{
inner
:
preprocessor
,
current
,
next
,
})
}
fn
start
<
'p
>
(
&
self
,
py
:
Python
<
'p
>
)
->
PyResult
<
Bound
<
'p
,
PyAny
>>
{
let
frontend
=
ServiceFrontend
::
<
SingleIn
<
NvCreateChatCompletionRequest
>
,
ManyOut
<
Annotated
<
NvCreateChatCompletionStreamResponse
>>
,
>
::
new
();
let
network
=
SegmentSink
::
<
SingleIn
<
PreprocessedRequest
>
,
ManyOut
<
Annotated
<
BackendOutput
>>>
::
new
();
let
preprocessor
=
self
.inner
.into_operator
();
let
pipeline
=
frontend
.link
(
preprocessor
.forward_edge
())
.map_err
(
to_pyerr
)
?
.link
(
network
.clone
())
.map_err
(
to_pyerr
)
?
.link
(
preprocessor
.backward_edge
())
.map_err
(
to_pyerr
)
?
.link
(
frontend
)
.map_err
(
to_pyerr
)
?
;
let
ingress
=
Ingress
::
for_engine
(
pipeline
)
.map_err
(
to_pyerr
)
?
;
let
builder
=
self
.current.inner
.endpoint_builder
()
.handler
(
ingress
);
let
endpoint
=
Arc
::
new
(
self
.next.inner
.clone
());
pyo3_async_runtimes
::
tokio
::
future_into_py
(
py
,
async
move
{
let
client
=
endpoint
.client
()
.await
.map_err
(
to_pyerr
)
?
;
let
router
=
PushRouter
::
<
PreprocessedRequest
,
Annotated
<
BackendOutput
>>
::
from_client
(
client
,
Default
::
default
(),
)
.await
.map_err
(
to_pyerr
)
?
;
network
.attach
(
Arc
::
new
(
router
))
.map_err
(
to_pyerr
)
?
;
builder
.start
()
.await
.map_err
(
to_pyerr
)
?
;
Ok
(())
})
}
}
use
llm_rs
::
preprocessor
::
media
::{
MediaDecoder
as
RsMediaDecoder
,
MediaFetcher
as
RsMediaFetcher
};
#[pyclass]
#[derive(Clone)]
...
...
lib/bindings/python/src/dynamo/_core.pyi
View file @
ca31b3aa
...
...
@@ -534,19 +534,6 @@ class ModelRuntimeConfig:
"""Get an engine-specific runtime configuration value"""
...
class OAIChatPreprocessor:
"""
A preprocessor for OpenAI chat completions
"""
...
async def start(self) -> None:
"""
Start the preprocessor
"""
...
class OverlapScores:
"""
A collection of prefix matching scores of workers for a given token ids.
...
...
@@ -1670,7 +1657,6 @@ __all__ = [
"Context",
"KserveGrpcService",
"ModelDeploymentCard",
"OAIChatPreprocessor",
"PythonAsyncEngine",
"prometheus_names",
]
lib/bindings/python/src/dynamo/runtime/__init__.py
View file @
ca31b3aa
...
...
@@ -17,7 +17,6 @@ from dynamo._core import DistributedRuntime as DistributedRuntime
from
dynamo._core
import
Endpoint
as
Endpoint
from
dynamo._core
import
ModelDeploymentCard
as
ModelDeploymentCard
from
dynamo._core
import
Namespace
as
Namespace
from
dynamo._core
import
OAIChatPreprocessor
as
OAIChatPreprocessor
def
dynamo_worker
(
enable_nats
:
bool
=
True
):
...
...
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