Redirect llama.cpp logs through tracing to avoid polluting CLI stdout/stderr (#7434)

This commit is contained in:
jh-block
2026-02-23 17:04:17 +01:00
committed by GitHub
parent ffed9dfc4f
commit 8182a6c7d7
@@ -29,7 +29,7 @@ use futures::future::BoxFuture;
use llama_cpp_2::llama_backend::LlamaBackend;
use llama_cpp_2::model::params::LlamaModelParams;
use llama_cpp_2::model::{LlamaChatMessage, LlamaChatTemplate, LlamaModel};
use llama_cpp_2::{list_llama_ggml_backend_devices, LlamaBackendDeviceType};
use llama_cpp_2::{list_llama_ggml_backend_devices, LlamaBackendDeviceType, LogOptions};
use rmcp::model::{Role, Tool};
use serde_json::{json, Value};
use std::collections::HashMap;
@@ -80,6 +80,7 @@ impl InferenceRuntime {
}
Err(e) => panic!("Failed to init llama backend: {}", e),
};
llama_cpp_2::send_logs_to_tracing(LogOptions::default());
let runtime = Arc::new(Self {
models: StdMutex::new(HashMap::new()),
backend,