Skip to content

feat(llm): add generic multi-provider LLM support#101

Draft
danieljustus wants to merge 1 commit into
mainfrom
feature/generic-llm-providers
Draft

feat(llm): add generic multi-provider LLM support#101
danieljustus wants to merge 1 commit into
mainfrom
feature/generic-llm-providers

Conversation

@danieljustus
Copy link
Copy Markdown
Owner

Replace hardcoded AnthropicClient dependency with a provider-agnostic
LLMClient protocol and factory pattern.

New providers supported:

  • Anthropic (existing, refactored to implement protocol)
  • OpenAI (new adapter with retry logic and JSON mode)
  • Ollama (new stdlib-only adapter for local models)

Key changes:

  • LLMClient Protocol with structural subtyping
  • create_llm_client() factory with env-var config
  • Generic exceptions (LLMClientError, LLMProviderError)
  • ReplyClassifier and generate_rebuttal accept optional client param
  • CLI commands gain --provider and --model options
  • New OPENERASEME_LLM_PROVIDER and OPENERASEME_LLM_MODEL env vars
  • Backward compatible: ANTHROPIC_API_KEY still works

New test coverage: 146 tests across 8 new test files.

Replace hardcoded AnthropicClient dependency with a provider-agnostic
LLMClient protocol and factory pattern.

New providers supported:
- Anthropic (existing, refactored to implement protocol)
- OpenAI (new adapter with retry logic and JSON mode)
- Ollama (new stdlib-only adapter for local models)

Key changes:
- LLMClient Protocol with structural subtyping
- create_llm_client() factory with env-var config
- Generic exceptions (LLMClientError, LLMProviderError)
- ReplyClassifier and generate_rebuttal accept optional client param
- CLI commands gain --provider and --model options
- New OPENERASEME_LLM_PROVIDER and OPENERASEME_LLM_MODEL env vars
- Backward compatible: ANTHROPIC_API_KEY still works

New test coverage: 146 tests across 8 new test files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant