Skip to content

[BUG] Model naming prefixes filtering is too strict #5893

@Ducnguyen147

Description

@Ducnguyen147

Description

The prefix naming is too strict for our usecases. Here is the code:

model_lower.startswith(prefix) for prefix in ["claude-", "anthropic."]

We have our own-deployed model so called 'anthropic--claude-...', however the CrewAI code above just filter out my models because it only supports ["claude-", "anthropic."] prefixes

Steps to Reproduce

  1. Tried own Anthropic model with different naming prefixes rather than ["claude-", "anthropic."]
  2. CrewAI will filter out these models which lead to incorrect behavior in the output

Expected behavior

We should think about updating this function:

def _matches_provider_pattern(cls, model: str, provider: str) -> bool:

so that it can support wider range of models (e.g., own deployed model with different naming convention)

Screenshots/Code snippets

def _matches_provider_pattern(cls, model: str, provider: str) -> bool:

Operating System

macOS Catalina

Python Version

3.12

crewAI Version

1.14.2

crewAI Tools Version

1.14.2

Virtual Environment

Venv

Evidence

Incorrect output behavior

Possible Solution

Update list of filtering prefixes

Additional context

None

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions