Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion lib/bindings/c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ fn dynamo_create_kv_publisher(
{
Ok(drt) => {
let backend = drt.namespace(namespace)?.component(component)?;
KvEventPublisher::new(backend, worker_id, kv_block_size)
KvEventPublisher::new(backend, worker_id, kv_block_size, None)
}
Err(e) => Err(e),
}
Expand Down
20 changes: 12 additions & 8 deletions lib/bindings/python/rust/llm/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use rs::traits::events::EventSubscriber;
use tracing;

use llm_rs::kv_router::protocols::*;
use llm_rs::kv_router::publisher::create_stored_blocks;
use llm_rs::kv_router::publisher::{create_stored_blocks, KvEventSourceConfig};

#[pyclass]
pub(crate) struct KvRouter {
Expand Down Expand Up @@ -165,21 +165,23 @@ impl ZmqKvEventPublisherConfig {

#[pyclass]
pub(crate) struct ZmqKvEventPublisher {
inner: llm_rs::kv_router::publisher::ZmqKvEventPublisher,
inner: llm_rs::kv_router::publisher::KvEventPublisher,
}

#[pymethods]
impl ZmqKvEventPublisher {
#[new]
fn new(component: Component, config: ZmqKvEventPublisherConfig) -> PyResult<Self> {
let mut inner =
llm_rs::kv_router::publisher::ZmqKvEventPublisher::new(config.kv_block_size);
inner.start_background_task(
let inner = llm_rs::kv_router::publisher::KvEventPublisher::new(
component.inner,
config.worker_id,
config.zmq_endpoint,
config.zmq_topic,
);
config.kv_block_size,
Some(KvEventSourceConfig::Zmq {
endpoint: config.zmq_endpoint,
topic: config.zmq_topic,
}),
)
.map_err(to_pyerr)?;
Ok(Self { inner })
}

Expand All @@ -203,8 +205,10 @@ impl KvEventPublisher {
component.inner,
worker_id,
kv_block_size,
None,
)
.map_err(to_pyerr)?;

Ok(Self {
inner: inner.into(),
kv_block_size,
Expand Down
Loading