When to Bring AI to the Edge