refactor: improve model name redaction in analytics and model info handling

This commit is contained in:
Paul Gauthier 2024-10-30 14:29:29 -07:00 committed by Paul Gauthier (aider)
parent a565a63436
commit e94e60b1d2
3 changed files with 8 additions and 5 deletions

View file

@ -114,7 +114,9 @@ class Analytics:
properties = {}
if main_model:
if main_model.info:
# Redact the main model name unless it is in the public litellm db
info = model_info_manager.get_model_from_cached_json_db(main_model.name)
if info:
properties["main_model"] = main_model.name
elif "/" in main_model.name:
properties["main_model"] = main_model.name.split("/")[0] + "/REDACTED"