Skip to content

Commit

Permalink
feat: adjust anthropic (#1387)
Browse files Browse the repository at this point in the history
  • Loading branch information
takatost authored Oct 20, 2023
1 parent 288705f commit 4c63cbf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/core/model_providers/providers/anthropic_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def is_provider_type_system_supported(cls) -> bool:

def should_deduct_quota(self):
if hosted_model_providers.anthropic and \
hosted_model_providers.anthropic.quota_limit and hosted_model_providers.anthropic.quota_limit > 0:
hosted_model_providers.anthropic.quota_limit and hosted_model_providers.anthropic.quota_limit > -1:
return True

return False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def is_provider_type_system_supported(cls) -> bool:

def should_deduct_quota(self):
if hosted_model_providers.azure_openai \
and hosted_model_providers.azure_openai.quota_limit and hosted_model_providers.azure_openai.quota_limit > 0:
and hosted_model_providers.azure_openai.quota_limit and hosted_model_providers.azure_openai.quota_limit > -1:
return True

return False
Expand Down
6 changes: 3 additions & 3 deletions api/core/model_providers/providers/hosted.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class HostedOpenAI(BaseModel):
api_organization: str = None
api_key: str
quota_limit: int = 0
"""Quota limit for the openai hosted model. 0 means unlimited."""
"""Quota limit for the openai hosted model. -1 means unlimited."""
paid_enabled: bool = False
paid_stripe_price_id: str = None
paid_increase_quota: int = 1
Expand All @@ -21,14 +21,14 @@ class HostedAzureOpenAI(BaseModel):
api_base: str
api_key: str
quota_limit: int = 0
"""Quota limit for the azure openai hosted model. 0 means unlimited."""
"""Quota limit for the azure openai hosted model. -1 means unlimited."""


class HostedAnthropic(BaseModel):
api_base: str = None
api_key: str
quota_limit: int = 0
"""Quota limit for the anthropic hosted model. 0 means unlimited."""
"""Quota limit for the anthropic hosted model. -1 means unlimited."""
paid_enabled: bool = False
paid_stripe_price_id: str = None
paid_increase_quota: int = 1000000
Expand Down
2 changes: 1 addition & 1 deletion api/core/model_providers/providers/openai_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def is_provider_type_system_supported(cls) -> bool:

def should_deduct_quota(self):
if hosted_model_providers.openai \
and hosted_model_providers.openai.quota_limit and hosted_model_providers.openai.quota_limit > 0:
and hosted_model_providers.openai.quota_limit and hosted_model_providers.openai.quota_limit > -1:
return True

return False
Expand Down
2 changes: 1 addition & 1 deletion api/core/model_providers/rules/anthropic.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"trial"
],
"quota_unit": "tokens",
"quota_limit": 600000
"quota_limit": 0
},
"model_flexibility": "fixed",
"price_config": {
Expand Down

0 comments on commit 4c63cbf

Please sign in to comment.