Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b317939
no errors for now
Oct 2, 2025
6d25ddc
bump
ishandhanani Oct 3, 2025
f90eb88
Merge branch 'main' into ishan/late-registration-ye
ishandhanani Oct 3, 2025
3b492f4
refactor
ishandhanani Oct 3, 2025
2124d91
found
ishandhanani Oct 3, 2025
ac9357e
nice
ishandhanani Oct 4, 2025
999c716
err
ishandhanani Oct 4, 2025
889f0c5
cleanup
ishandhanani Oct 5, 2025
9562483
bump
ishandhanani Oct 5, 2025
48bc524
go
ishandhanani Oct 5, 2025
ad934a4
Merge branch 'main' into ishan/late-registration-ye
ishandhanani Oct 5, 2025
c2d10ee
working
ishandhanani Oct 5, 2025
f3d74b8
go
ishandhanani Oct 5, 2025
3820e80
profile
ishandhanani Oct 5, 2025
a791ca7
bump:
ishandhanani Oct 5, 2025
5886ae4
redundant space
ishandhanani Oct 5, 2025
5166638
bump
ishandhanani Oct 5, 2025
35aa49e
slightly logic change since only agg endpoints supported now
ishandhanani Oct 6, 2025
b0ae2d4
reshuffle
ishandhanani Oct 6, 2025
c5307e3
Merge branch 'main' into ishan/late-registration-ye
ishandhanani Oct 6, 2025
f50c54b
selective pieces return a 404
ishandhanani Oct 6, 2025
3e6bf2c
singleton drt
ishandhanani Oct 6, 2025
f6f7c91
bump
ishandhanani Oct 6, 2025
e774001
bump
ishandhanani Oct 6, 2025
4502810
bump
ishandhanani Oct 6, 2025
18f590d
Merge branch 'main' into ishan/late-registration-ye
ishandhanani Oct 7, 2025
0cb978a
bump
ishandhanani Oct 7, 2025
145fb06
Merge branch 'main' into ishan/late-registration-ye
ishandhanani Oct 7, 2025
95e3a4f
swap etcd with drt in http builder
ishandhanani Oct 7, 2025
cdc4da0
gp
ishandhanani Oct 7, 2025
3d79298
lel
ishandhanani Oct 7, 2025
7ffe3e2
test
ishandhanani Oct 7, 2025
28e268d
no panicgit add .!
ishandhanani Oct 7, 2025
7852920
bruh
ishandhanani Oct 7, 2025
a3e2839
bump
ishandhanani Oct 7, 2025
11e8439
simple
ishandhanani Oct 7, 2025
2b7d61a
full refactor
ishandhanani Oct 8, 2025
6f194ee
try
ishandhanani Oct 8, 2025
c6c39cf
handling
ishandhanani Oct 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions components/src/dynamo/sglang/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ async def register_model():

health_check_payload = SglangHealthCheckPayload(engine).to_dict()

test_endpoint = component.endpoint("test")
test_endpoint.register_custom_endpoint("/test")

try:
# Start endpoint immediately and register model concurrently
# Requests queue until ready_event is set
Expand All @@ -139,6 +142,12 @@ async def register_model():
health_check_payload=health_check_payload,
),
register_model(),
test_endpoint.serve_endpoint(
handler.generate,
graceful_shutdown=True,
metrics_labels=metrics_labels,
health_check_payload=health_check_payload,
),
)
except Exception as e:
logging.error(f"Failed to serve endpoints: {e}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import AsyncIterator

import torch
from sglang.srt.conversation import chat_templates
from sglang.srt.parser.conversation import chat_templates
from transformers import AutoImageProcessor, AutoModel, AutoTokenizer

import dynamo.nixl_connect as connect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import logging

from sglang.srt.conversation import chat_templates
from sglang.srt.parser.conversation import chat_templates

logger = logging.getLogger(__name__)

Expand Down
33 changes: 33 additions & 0 deletions lib/bindings/python/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,39 @@ impl Component {

#[pymethods]
impl Endpoint {
#[pyo3(signature = (endpoint_path))]
fn register_custom_endpoint<'p>(
&self,
py: Python<'p>,
endpoint_path: &str,
) -> PyResult<Bound<'p, PyAny>> {
// validate that the endpoint path looks like "/<string>" and does not end with a slash
if !endpoint_path.starts_with("/") || endpoint_path.ends_with("/") {
return Err(PyErr::new::<pyo3::exceptions::PyValueError, _>(
"Endpoint path must start with a slash and not end with a slash",
));
}

let endpoint_path = endpoint_path.to_string();

let drt = self.inner.drt();
let etcd_client = drt.etcd_client();

pyo3_async_runtimes::tokio::future_into_py(py, async move {
if let Some(etcd_client) = etcd_client {
etcd_client
.kv_create(
endpoint_path.as_str(),
serde_json::to_vec_pretty(&serde_json::Value::Null).unwrap(),
None,
)
.await
.map_err(to_pyerr)?;
}
Ok(())
})
}

#[pyo3(signature = (generator, graceful_shutdown = true, metrics_labels = None, health_check_payload = None))]
fn serve_endpoint<'p>(
&self,
Expand Down
6 changes: 6 additions & 0 deletions lib/bindings/python/src/dynamo/_core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ class Endpoint:

...

def register_custom_endpoint(self, endpoint_path: str) -> None:
"""
Register a custom endpoint path to our discovery plane by dynamo ingress
"""
...

async def serve_endpoint(self, handler: RequestHandler, graceful_shutdown: bool = True, metrics_labels: Optional[List[Tuple[str, str]]] = None, health_check_payload: Optional[Dict[str, Any]] = None) -> None:
"""
Serve an endpoint discoverable by all connected clients at
Expand Down
Loading