Pattern Proposal: Pluggable LLM Provider Abstraction
Summary
Wraps LLM invocations in a standardized client interface enabling transparent switching between production multi-provider models and deterministic test mock clients.
Candidate Pattern
- ID:
pluggable-llm-provider-abstraction - Classification: intelligence
- Maturity: established
- Type: implemented
Observed Signals
No specific signals listed.
Evidence
Supporting Evidence
- src/cas_runner/llm/litellm_client.py (LiteLLMClient) - Production implementation for multi-provider invocation
- src/cas_runner/llm/mock_client.py (MockLLMClient) - Deterministic test mock implementation
Scope Assessment
- Evidence Strength: high
- Confidence: high
- Applies to: ideas-to-life-cas
Rationale
- Intent: Decouple orchestration and governance agents from provider-specific APIs while facilitating deterministic local testing.
- Context: Agentic components (merger, compliance engine) require model completions but must remain agnostic to specific LLM endpoints and testable without active API keys.
- Force: Need multi-model flexibility across distinct providers without changing prompt consumption logic.
- Force: Requirement to test agent pipelines offline in CI without consuming API budget.
Traceability
Artifact source: proposed-patterns