-
-
Notifications
You must be signed in to change notification settings - Fork 56
fix(chutes): enable quota display in TUI #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| import httpx | ||
| import os | ||
| from typing import Any, Dict, List, Optional, TYPE_CHECKING | ||
| from .provider_interface import ProviderInterface | ||
| from .provider_interface import ProviderInterface, UsageResetConfigDef | ||
| from .utilities.chutes_quota_tracker import ChutesQuotaTracker | ||
|
|
||
| if TYPE_CHECKING: | ||
|
|
@@ -22,6 +22,25 @@ class ChutesProvider(ChutesQuotaTracker, ProviderInterface): | |
| Provider implementation for the chutes.ai API with quota tracking. | ||
| """ | ||
|
|
||
| # Enable environment variable overrides (e.g., QUOTA_GROUPS_CHUTES_GLOBAL) | ||
| provider_env_name = "chutes" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix confirmed: Added |
||
|
|
||
| # Quota groups for tracking daily limits | ||
| # Uses a virtual model "_quota" for credential-level quota tracking | ||
| model_quota_groups = { | ||
| "chutes_global": ["_quota"], | ||
| } | ||
|
|
||
| # Usage reset configuration for daily quota | ||
| usage_reset_configs = { | ||
| "default": UsageResetConfigDef( | ||
| window_seconds=86400, # 24 hours (daily quota reset) | ||
| mode="per_model", | ||
| description="Chutes daily quota", | ||
| field_name="daily", | ||
| ) | ||
| } | ||
|
Comment on lines
+35
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix confirmed: Switched to |
||
|
|
||
| def __init__(self, *args, **kwargs): | ||
| """Initialize ChutesProvider with quota tracking.""" | ||
| super().__init__(*args, **kwargs) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.