fix(rlm): wire LlmClient through LlmBridge, replace silent stub Refs #1744#880
Merged
Merged
Conversation
…#1744 Replace the [LLM Bridge stub] fake response with actual LLM delegation when the llm feature is enabled and a provider is detectable. Without a client, return RlmError::LlmNotConfigured instead of a silent fake. - LlmBridge: stores Option<Arc<dyn LlmClient>> via cfg(feature=llm) - query(): delegates to real client, or returns LlmNotConfigured - TerraphimRlm::create_llm_bridge(): auto-detects via build_llm_client() - Auto-detection: Ollama (free) > OpenRouter (cheap) > proxy > error - terraphim_config added as optional dep behind llm feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the
[LLM Bridge stub]fake response with proper LLM delegation through the orchestrator's routing pipeline.Design
TerraphimRlm::set_llm_client()accepts a pre-routedArc<dyn LlmClient>from the orchestrator.LlmBridge::query()returnsRlmError::LlmNotConfigured— no more silent fake responses.LlmBridge::with_llm_client()constructor for the configured path.Changes
llm_bridge.rs: struct holdsOption<Arc<dyn LlmClient>>behindcfg(feature=llm). Newwith_llm_client()constructor.query()delegates to real client or returns error.rlm.rs: newset_llm_client()method.new()creates bare bridge, waiting for orchestrator injection.error.rs: newLlmNotConfiguredvariant.Orchestrator Integration (separate follow-up)
The orchestrator must call
rlm.set_llm_client(client)after construction, passing its routed client frombuild_llm_from_role()+ provider budget tracking.Refs terraphim/terraphim-ai#1744 (Gitea)