How to Build a Secure LLM for Application Development Then you instantiate a FastAPI object and define invoke_agent_with_retry(), a function that runs your agent asynchronously. The @async_retry decorator above invoke_agent_with_retry() ensures the function will be retried ten times with a delay of one second before failing. FastAPI is a modern, high-performance web framework for buildingBuilding Your Own Large Language Model LLM from Scratch: A Step-by-Step Guide