-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_models.py
More file actions
32 lines (25 loc) · 983 Bytes
/
Copy pathupdate_models.py
File metadata and controls
32 lines (25 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""CLI tool to refresh model pricing data.
Usage:
python update_models.py # Update if stale (>7 days)
python update_models.py --force # Force update regardless of freshness
"""
import argparse
import sys
from model_fetcher import update_models_pricing
from model_registry import DEFAULT_CONFIG_PATH
def main():
parser = argparse.ArgumentParser(description="Update model pricing data")
parser.add_argument("--force", action="store_true", help="Force update regardless of freshness")
parser.add_argument("--config", default=DEFAULT_CONFIG_PATH, help="Path to models_pricing.json")
args = parser.parse_args()
try:
updated = update_models_pricing(args.config, force=args.force)
if updated:
print("Done.")
else:
print("No update needed. Use --force to override.")
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()