#!/usr/bin/env python3
import json
import os
import sys
from pathlib import Path
# Common stable models to check against
STABLE_MODELS = [
"anthropic/claude-3.5-sonnet",
"anthropic/claude-3-haiku",
"openai/gpt-4o",
"openai/gpt-4o-mini",
"google/gemini-2.0-flash-001",
]
def check_presets():
presets_dir = Path("configs/presets")
if not presets_dir.exists():
print("Presets directory not found.")
return
warnings = 0
for preset_file in presets_dir.glob("*.json"):
with open(preset_file, "r") as f:
try:
data = json.load(f)
rlm_config = data.get("request", {}).get("rlm", {})
model = rlm_config.get("model_name")
other_model = rlm_config.get("other_model_name")
# Simple check: if it's an openrouter preset, check for known stable models
# or just warn if it looks like a versioned/dated ID that might be deprecated
for m in [model, other_model]:
if m and "openrouter" in str(data.get("request", {}).get("provider", {}).get("provider_preset", "")):
# If it has a very specific dated version like -001, -2024, etc.
if any(x in m for x in ["-001", "-002", "2024", "2023"]):
print(f"Warning: Preset '{preset_file.name}' uses potentially dated model ID: {m}")
warnings += 1
except Exception as e:
print(f"Error parsing {preset_file}: {e}")
if warnings == 0:
print("✓ All presets use seemingly stable model IDs.")
else:
print(f"Found {warnings} warnings.")
if __name__ == "__main__":
check_presets()