How Callbacks Reduce Latency in AI Models