Skip to content

Pattern Proposal: LLM provider adapter and test double port

Summary

LiteLLMClient and MockLLMClient provide separate provider clients under an llm package, abstracting LLM transport from business logic.

Candidate Pattern

  • ID: llm-provider-adapter-port
  • Classification: architectural
  • Maturity: emerging
  • Type: emerging

Observed Signals

No specific signals listed.

Evidence

Supporting Evidence

Scope Assessment

  • Evidence Strength: high
  • Confidence: high
  • Applies to: ideas-to-life-cas

Rationale

  • Intent: Decouple application and governance logic from a concrete LLM provider and enable deterministic testing.
  • Context: The project depends on litellm and likely needs both real provider calls and fake responses for tests or dry runs.
  • Force: Real provider calls are expensive and nondeterministic
  • Force: Tests need stable provider behavior
  • Force: Provider APIs may change faster than domain logic

Traceability

Artifact source: proposed-patterns