Skip to content

Commit 4bef6b2

Browse files
committed
rebase on top of main
1 parent 691cfa9 commit 4bef6b2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/llm/src/kv_router.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,16 @@ impl AsyncEngine<SingleIn<PreprocessedRequest>, ManyOut<Annotated<LLMEngineOutpu
337337
match self.inner.client.instance_source.as_ref() {
338338
InstanceSource::Static => self.inner.r#static(request).await,
339339
InstanceSource::Dynamic(_) => {
340+
let context_id = request.context().id().to_string();
340341
let (instance_id, overlap_amount) = if let Some(id) = request.backend_instance_id {
341342
// If instance_id is set, use it
342343
(id, 0)
343344
} else {
344345
// Otherwise, find the best match
345-
self.chooser.find_best_match(&request.token_ids).await?
346+
self.chooser
347+
.find_best_match(&context_id, &request.token_ids)
348+
.await?
346349
};
347-
348350
let query_instance_id = request.has_annotation("query_instance_id");
349351
// Extract context information before moving the request
350352
let stream_context = request.context().clone();

lib/llm/src/migration.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ mod tests {
188188
mdc_sum: None,
189189
annotations: vec![],
190190
estimated_prefix_hit_num_blocks: None,
191+
backend_instance_id: None,
191192
}
192193
}
193194

@@ -202,6 +203,7 @@ mod tests {
202203
top_logprobs: None,
203204
finish_reason: None,
204205
index: None,
206+
backend_instance_id: None,
205207
})
206208
}
207209

0 commit comments

Comments
 (0)