Pattern Proposal: Provider-Agnostic LLM Gateway with Dual Client Contract
Summary
Abstracts language model calls behind a standardized client interface with production and mock implementations.
Candidate Pattern
- ID:
provider-agnostic-llm-client - Classification: intelligence
- Maturity: established
- Type: implemented
Observed Signals
No specific signals listed.
Evidence
Supporting Evidence
- src/cas_runner/llm/litellm_client.py (LiteLLMClient) - Standardized runtime provider client.
- src/cas_runner/llm/mock_client.py (MockLLMClient) - Deterministic test double for model responses.
Scope Assessment
- Evidence Strength: high
- Confidence: high
- Applies to: ideas-to-life-cas
Rationale
- Intent: Isolate agent orchestration logic from model provider SDK churn and support deterministic offline testing.
- Context: Agent components like AgenticMerger require model completions, but testing requires offline predictability.
- Force: Model vendor SDK APIs change frequently
- Force: Unit and CI test suites cannot rely on live LLM API keys or incur token costs
Traceability
Artifact source: proposed-patterns