e.stopPropagation()}
role="dialog"
diff --git a/src/exo/api/main.py b/src/exo/api/main.py
index 3927ee5e..7862801f 100644
--- a/src/exo/api/main.py
+++ b/src/exo/api/main.py
@@ -129,6 +129,7 @@ from exo.shared.logging import InterceptLogger
from exo.shared.models.model_cards import (
ModelCard,
ModelId,
+ add_to_card_cache,
get_card,
get_model_cards,
)
@@ -1587,6 +1588,10 @@ class API:
)
)
+ # Immediately update the local cache so the subsequent GET /models
+ # returns the new model without waiting for the event round-trip.
+ add_to_card_cache(card)
+
return ModelListModel(
id=card.model_id,
hugging_face_id=card.model_id,