Skip to content

Commit 90d51df

Browse files
fix: MetalRT-only mode no longer requires llama.cpp models
When engine preference is "metalrt", the pipeline now treats llama.cpp STT/LLM/TTS init failures as warnings instead of fatal errors. This allows users who only selected MetalRT in setup to run without needing any GGUF models, Zipformer, or Piper TTS files on disk. Made-with: Cursor
1 parent 537c897 commit 90d51df

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if(POLICY CMP0177)
55
endif()
66
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 CACHE STRING "" FORCE)
77

8-
project(rcli VERSION 0.2.9 LANGUAGES C CXX)
8+
project(rcli VERSION 0.3.0 LANGUAGES C CXX)
99

1010
set(CMAKE_CXX_STANDARD 17)
1111
set(CMAKE_CXX_STANDARD_REQUIRED ON)

src/pipeline/orchestrator.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,26 @@ bool Orchestrator::init(const PipelineConfig& config) {
4343
pool_->total_size() / (1024.0*1024.0),
4444
pool_->utilization_pct());
4545

46+
// llama.cpp STT/LLM/TTS — required for llamacpp/auto, optional for metalrt-only
47+
bool need_llamacpp = (config.llm_backend != LlmBackend::METALRT);
48+
4649
if (!stt_.init(config.stt)) {
47-
LOG_ERROR("Pipeline", "STT init failed");
48-
return false;
50+
if (need_llamacpp) { LOG_ERROR("Pipeline", "STT init failed"); return false; }
51+
LOG_WARN("Pipeline", "llama.cpp STT not available (MetalRT will handle STT)");
4952
}
5053

5154
if (!offline_stt_.init(config.offline_stt)) {
5255
LOG_WARN("Pipeline", "Offline STT init failed (will use streaming STT)");
5356
}
5457

5558
if (!llm_.init(config.llm)) {
56-
LOG_ERROR("Pipeline", "LLM init failed");
57-
return false;
59+
if (need_llamacpp) { LOG_ERROR("Pipeline", "LLM init failed"); return false; }
60+
LOG_WARN("Pipeline", "llama.cpp LLM not available (MetalRT will handle LLM)");
5861
}
5962

6063
if (!tts_.init(config.tts)) {
61-
LOG_ERROR("Pipeline", "TTS init failed");
62-
return false;
64+
if (need_llamacpp) { LOG_ERROR("Pipeline", "TTS init failed"); return false; }
65+
LOG_WARN("Pipeline", "llama.cpp TTS not available (MetalRT will handle TTS)");
6366
}
6467

6568
if (!audio_.init(config.audio, capture_rb_.get(), playback_rb_.get())) {
@@ -72,13 +75,13 @@ bool Orchestrator::init(const PipelineConfig& config) {
7275
}
7376

7477
tools_.register_defaults();
75-
tools_.set_model_profile(&llm_.profile());
7678

77-
// Cache tool-aware system prompt (includes tool definitions) in KV cache.
78-
// When external tool defs are set, they'll be included automatically.
79-
std::string tool_system = llm_.profile().build_tool_system_prompt(
80-
config.system_prompt, tools_.get_tool_definitions_json());
81-
llm_.cache_system_prompt(tool_system);
79+
if (llm_.is_initialized()) {
80+
tools_.set_model_profile(&llm_.profile());
81+
std::string tool_system = llm_.profile().build_tool_system_prompt(
82+
config.system_prompt, tools_.get_tool_definitions_json());
83+
llm_.cache_system_prompt(tool_system);
84+
}
8285

8386
// --- MetalRT backend (optional) ---
8487
if (config.llm_backend == LlmBackend::METALRT ||

0 commit comments

Comments
 (0)