feat: concat the adapter id to the model id in chat response

This commit is contained in:
drbh 2024-11-25 09:46:42 -05:00
parent 780531ec77
commit 651a039dd3

View File

@ -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) => format!("{}+{}", info.model_id, m_id),
};
let system_fingerprint = format!("{}-{}", info.version, info.docker_label.unwrap_or("native"));
// switch on stream
if stream {