This article explores five Python decorators that can be used to optimize LLM-based applications. These decorators leverage libraries like functools, diskcache, tenacity, ratelimit, and magnetic to address common challenges such as caching, network resilience, rate limiting, and structured output binding. The article provides code examples to illustrate how each decorator can be implemented and used to improve the performance and reliability of LLM applications.
An overview of popular techniques to confine LLMs' output to a predefined schema, covering API providers, prompting/reprompting strategies, and constrained decoding.
An article on building an AI agent to interact with Apache Airflow using PydanticAI and Gemini 2.0, providing a structured and reliable method for managing DAGs through natural language queries.
- Agent interacts with Apache Airflow via the Airflow REST API.
- Agent can understand natural language queries about workflows, fetch real-time status updates, and return structured data.
- Sample DAGs are implemented for demonstration purposes.