From c637d68d74e8bd8c6b78e8b99965ba4eb22970fc Mon Sep 17 00:00:00 2001 From: drbh Date: Mon, 25 Nov 2024 12:36:31 -0500 Subject: [PATCH] feat: concat the adapter id to the model id in chat response (#2779) * feat: concat the adapter id to the model id in chat response * fix: updated to include only the adapter id in chat response --- router/src/server.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/router/src/server.rs b/router/src/server.rs index 6001e2dd09c..f253cb633ad 100644 --- a/router/src/server.rs +++ b/router/src/server.rs @@ -1228,6 +1228,7 @@ pub(crate) async fn chat_completions( let span = tracing::Span::current(); metrics::counter!("tgi_request_count").increment(1); let ChatRequest { + model, stream, stream_options, logprobs, @@ -1238,8 +1239,11 @@ pub(crate) async fn chat_completions( let logprobs = logprobs.unwrap_or_default(); - // static values that will be returned in all cases - let model_id = info.model_id.clone(); + // extract model id from request if specified + let model_id = match model.as_deref() { + Some("tgi") | None => info.model_id.clone(), + Some(m_id) => m_id.to_string(), + }; let system_fingerprint = format!("{}-{}", info.version, info.docker_label.unwrap_or("native")); // switch on stream if stream {