[BUG] Anthropic model prefix filtering rejects custom deployments (refs #5893)
Description
LLM._matches_provider_pattern (lib/crewai/src/crewai/llm.py:405) only
accepts ["claude-", "anthropic."] for the Anthropic provider, while the
module constant ANTHROPIC_PREFIXES is ("anthropic/", "claude-", "claude/") — the two lists are inconsistent, and neither accepts
self-hosted variants such as anthropic--claude-..., which then fail
provider routing.
Reproduced on main@738c8e19:
LLM._matches_provider_pattern("anthropic--claude-xyz", "anthropic")
returns False.
Predecessor #5893 reported the same bug (assigned, several community PRs)
but was closed as NOT_PLANNED by the stale bot (no-issue-activity);
the bug is still present, so re-opening per the contributing guide (PRs
need a linked open issue).
Proposed fix
Unify both match sites (_matches_provider_pattern and
_is_anthropic_model) on
(*ANTHROPIC_PREFIXES, "anthropic.", "anthropic--", "anthropic:", "claude--"). Existing prefixes keep working; no new dependencies. PR
incoming.
Willingness to Contribute
Yes, PR incoming.
Note for maintainers: this issue was drafted with AI assistance — please
apply the llm-generated label per CONTRIBUTING.md (I don't have triage
permission to set labels myself).
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.