Quick Start
This guide focuses on AI21 Maestro’s Validated Output.
What is AI21 Maestro’s Validated Output?
One of AI21 Maestro’s core capabilities is providing validated output, which addresses a critical problem that even advanced language models can struggle with - consistently following complex instructions that include multiple constraints.
AI21 Maestro ensures your language model’s outputs meet your specific requirements. Instead of relying on prompts to work reliably on their own, it uses computational resources to validate and refine outputs until they satisfy your constraints.
AI21 Maestro’s Validated Output addresses this by:
- Validating outputs against your explicit requirements
- Automatically fixes outputs that don’t meet the requirements
- Provides a report on requirement fulfillment with detailed scores
Key Concepts
- Requirements: Explicit constraints you define for your outputs (e.g., format, tone, content rules).
- Budget: Controls computational effort and trade-offs—higher budgets use more resources (increasing cost and latency) to achieve better adherence to requirements (high/medium/low).
- Requirements Report: Provides detailed scoring and feedback on how well each requirement was met.
- Model Agnostic: Maestro works with both AI21’s first-party models and popular third-party models (e.g., GPT-4, Claude, Gemini)—choose the model that best fits your needs.
Basic Usage
Simple Example
Understanding Asynchronous Execution
Maestro runs execute asynchronously in the backend. The create() method returns immediately with a run ID, while processing happens in the background:
Budget Levels
- Low: Lower latency and lighter approach for getting a validated output
- Medium: Balanced approach with moderate fix attempts
- High: Maximum reliability with multiple fix attempts and parallel processing
Quick Tips
- Be Specific: Write clear, measurable requirements
- Start Small: Begin with 2-3 requirements and expand
- Use the Playground: Test your requirements in our web interface before implementing
- Check Scores: Review requirement scores to understand what’s working
Next Steps
- Log in to AI21 Studio and experiment the Maestro Playground.
- Set up a 3rd party model in AI21 Studio’s Model Integrations Page.
- Read the Complete Walkthrough Guide for advanced usage patterns.
- Explore the API Reference for full parameter details.
- If you have any technical questions about Maestro, feel free to reach out to our support team via email or click the chat icon in the lower right corner.