API fault tolerance: Implementing retries and fallback for LLM calls