Are you sure you want to delete this access key?
This example demonstrates how to evaluate xAI's Grok models across their three main capabilities: text generation with reasoning, image creation, and real-time web search.
You can run this example with:
npx promptfoo@latest init --example xai
This example requires the following environment variable:
XAI_API_KEY
- Your xAI API key. You can obtain this from the xAI Console# Set your API key
export XAI_API_KEY=your_api_key_here
# Run the main evaluation
promptfoo eval
# View results in the web interface
promptfoo view
This example includes three separate configurations to test different Grok capabilities:
promptfooconfig.yaml
) - Mathematical reasoning with step-by-step thinking using Grok's analytical capabilitiespromptfooconfig.images.yaml
) - Artistic image creation in Van Gogh and Dali styles using Grok's vision modelspromptfooconfig.search.yaml
) - Real-time information retrieval with citations using Grok's web search integrationYou can run each capability test separately:
# Text generation with mathematical reasoning
promptfoo eval -c promptfooconfig.yaml
# Image generation with artistic styles
promptfoo eval -c promptfooconfig.images.yaml
# Web search with real-time data
promptfoo eval -c promptfooconfig.search.yaml
Press p or to see the previous file or, n or to see the next file
Browsing data directories saved to S3 is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with AWS S3!
Are you sure you want to delete this access key?
Browsing data directories saved to Google Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Google Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to Azure Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Azure Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to S3 compatible storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with your S3 compatible storage!
Are you sure you want to delete this access key?