Pattern Proposal: Pluggable LLM Provider Client
Summary
LLM access is isolated into concrete client classes so CAS code can call models through a stable interface.
Candidate Pattern
- ID:
llm-provider-client-abstraction - Classification: intelligence
- Maturity: established
- Type: implemented
Observed Signals
No specific signals listed.
Evidence
Supporting Evidence
- src/cas_runner/llm/litellm_client.py (LiteLLMClient) - Concrete client wraps litellm for model access.
- src/cas_runner/llm/mock_client.py (MockLLMClient) - Alternative client enables controlled LLM responses.
- pyproject.toml - litellm dependency confirms provider abstraction.
Scope Assessment
- Evidence Strength: high
- Confidence: high
- Applies to: ideas-to-life-cas
Rationale
- Intent: Hide provider-specific model invocation and allow deterministic substitutes for local or tested flows.
- Context: src/cas_runner/llm provides LiteLLMClient and MockLLMClient, while pyproject.toml depends on litellm.
- Force: model provider APIs differ across vendors
- Force: agent flows need reproducible execution without network instability
- Force: governance logic should not embed provider details
Traceability
Artifact source: proposed-patterns