Skip to content

refactor: rename to llm-account-rotator and introduce Provider protocols#2

Closed
joachimBrindeau wants to merge 4 commits intomainfrom
refactor/rename-llm-account-rotator
Closed

refactor: rename to llm-account-rotator and introduce Provider protocols#2
joachimBrindeau wants to merge 4 commits intomainfrom
refactor/rename-llm-account-rotator

Conversation

@joachimBrindeau
Copy link
Copy Markdown
Owner

Summary

  • Phase 1: Rename package from claude_code_proxy to llm_account_rotator — all imports, pyproject.toml entry points, Docker config, CI, and documentation updated
  • Phase 2: Introduce Provider and ProxyTransport protocols in providers/base.py, move all Anthropic-specific code into providers/anthropic/, implement AnthropicProvider facade, rename Settings.claudeSettings.anthropic, add import-linter boundary rules, and inject resolve_model callable to maintain adapter isolation
  • All 567 tests pass, mypy clean (320 files), import-linter clean (2 boundary contracts)

Key Changes

Package Rename (Phase 1)

  • claude_code_proxyllm_account_rotator across all source, tests, config, Docker, CI
  • Git-tracked renames preserve history

Provider Abstraction (Phase 2)

  • providers/base.py: Provider protocol (messaging, models, auth, lifecycle) + ProxyTransport protocol (HTTP forwarding)
  • providers/anthropic/provider.py: AnthropicProvider — thin facade implementing both protocols
  • config/settings.py: Settings.claudeSettings.anthropic, added active_provider field
  • api/dependencies.py: ProviderDep and ProxyTransportDep for FastAPI DI
  • api/lifespan.py: Provider lifecycle management (start/stop)
  • adapters/openai/adapter.py: resolve_model callable injection (no cross-boundary imports)
  • pyproject.toml: import-linter forbidden contracts enforcing adapter↔provider boundary

Test plan

  • All 567 existing tests pass
  • mypy type checking passes (320 files)
  • ruff lint + format passes
  • vulture dead code check passes
  • import-linter: 2 boundary contracts, 0 violations
  • Runtime protocol conformance verified (isinstance checks)
  • All 20 pre-commit hooks pass

Post-Deploy Monitoring & Validation

No additional operational monitoring required: pure refactoring with no behavioral changes — all existing functionality preserved behind new abstractions.


Compound Engineered 🤖 Generated with Claude Code

joachimBrindeau and others added 4 commits February 18, 2026 14:04
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mechanical rename across 300+ files with zero logic changes:
- Package: claude_code_proxy -> llm_account_rotator
- CLI: claude-code-proxy -> llm-account-rotator
- Env prefix: CCPROXY_ -> LLM_ROTATOR_
- Brand: CCProxy -> LLMRotator
- Docker: ccproxy -> llm-rotator

Security mitigations added:
- Startup detection of legacy CCPROXY_* env vars (fatal error)
- Auth-None warning when proxy runs without authentication

Allowlist preserved (NOT renamed):
- JWT issuer "claude-code-proxy" (existing tokens)
- API key prefix "ccpk_" (existing keys)
- Keyring service "claude-code-proxy" (stored credentials)
- claude_code_sdk (third-party package)

All 567 tests pass. mypy, ruff clean.

BREAKING CHANGE: All env vars, CLI command, package imports renamed.
Run `llm-account-rotator migrate --from-ccproxy` after upgrading.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pic code

Move all Anthropic-specific code into providers/anthropic/, define Provider
and ProxyTransport protocols in providers/base.py, implement AnthropicProvider
facade, rename Settings.claude → Settings.anthropic, add import-linter boundary
rules, and inject resolve_model callable to maintain adapter isolation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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