Use Project Templates
Learn how to quickly scaffold new PromptArena test projects using templates.
Overview
Section titled “Overview”The promptarena init command uses templates to generate complete, ready-to-use test projects. This eliminates manual file creation and ensures your projects follow best practices from the start.
Quick Mode
Section titled “Quick Mode”The fastest way to create a new project:
# Create with mock provider (no API calls needed)promptarena init my-test --quick --provider mock
# Or with a real LLM providerpromptarena init my-test --quick --provider openaiQuick mode uses sensible defaults and creates:
- config.arena.yaml - Main configuration with your project name
- prompts/assistant.yaml - Basic prompt configuration
- providers/{provider}.yaml - Provider configuration for your chosen LLM
- scenarios/basic-test.yaml - Sample test scenario with assertions
- .env - Environment variables (with placeholders for API keys)
- .gitignore - Ignores .env and temporary files
- README.md - Project documentation and next steps
Available Built-In Templates
Section titled “Available Built-In Templates”PromptArena includes 6 built-in templates for common testing scenarios:
| Template | Description | Use Case |
|---|---|---|
basic-chatbot | Simple conversational testing | General purpose, beginners |
customer-support | Support agent with KB and order tools | Customer service testing |
code-assistant | Separate generator and reviewer prompts | Code generation workflows |
content-generation | Creative content for blogs, products, social | Marketing and content testing |
multimodal | Vision analysis with image inputs | Image/audio/video AI |
mcp-integration | MCP filesystem server configuration | Tool calling and MCP testing |
List Available Templates
Section titled “List Available Templates”View all available templates:
promptarena init --list-templatesCommunity Templates (Remote)
Section titled “Community Templates (Remote)”You can fetch templates from a community index (default points to the promptkit-templates repo).
# List remote templates (uses default index)promptarena templates list
# Fetch a remote template into cachepromptarena templates fetch --template basic-chatbot --version 1.0.0
# Render a template to a temp/out directorypromptarena templates render --template basic-chatbot --version 1.0.0 --values values.yaml --out ./out
# Update all cached templatespromptarena templates update
# Init a project using a remote templatepromptarena init my-project --template basic-chatbot --template-index https://raw.githubusercontent.com/AltairaLabs/promptkit-templates/main/index.yamlFlags:
--index/--template-index: override index URL/path--cache-dir/--template-cache: override cache location--values/--set: provide variables for render
Provider Options
Section titled “Provider Options”# Mock provider (no API required, great for testing)promprarena init my-test --quick --provider mock
# OpenAI (GPT models)promptarena init my-test --quick --provider openai
# Anthropic (Claude models)promptarena init my-test --quick --provider anthropic
# Google (Gemini models)promptarena init my-test --quick --provider googleInteractive Mode
Section titled “Interactive Mode”For more control over your project configuration:
promptarena init my-project
# You'll be prompted for:# - Project name and description# - Provider selection# - System prompt customization# - Model parameters (temperature, max_tokens)# - Test scenario detailsExample interactive session:
? Project Name: customer-support-tests? Description: Testing customer support conversation flows? Select LLM Provider: openai? System Prompt: You are a helpful customer support agent...? Temperature (0.0-2.0): 0.7? Max Tokens: 2000? Create sample test scenario? Yes? Scenario Name: basic-greetingCommand-Line Variables
Section titled “Command-Line Variables”Override template variables directly:
promptarena init my-test \ --quick \ --provider openai \ --var project_name="My Custom Project" \ --var description="Custom description" \ --var temperature=0.8 \ --var max_tokens=4000What Gets Generated
Section titled “What Gets Generated”1. Arena Configuration
Section titled “1. Arena Configuration”# config.arena.yamlapiVersion: promptkit.altairalabs.ai/v1alpha1kind: Arenametadata: name: my-test
spec: prompts: - path: ./prompts
providers: - path: ./providers
scenarios: - path: ./scenarios2. Prompt Configuration
Section titled “2. Prompt Configuration”# prompts/assistant.yamlapiVersion: promptkit.altairalabs.ai/v1alpha1kind: PromptConfigmetadata: name: assistant
spec: task_type: assistant system_prompt: | You are a helpful AI assistant.
defaults: temperature: 0.7 max_tokens: 20003. Provider Configuration
Section titled “3. Provider Configuration”# providers/openai.yaml (example)apiVersion: promptkit.altairalabs.ai/v1alpha1kind: Providermetadata: name: openai-gpt4o-mini
spec: type: openai model: gpt-4o-mini
defaults: temperature: 0.7 max_tokens: 20004. Test Scenario
Section titled “4. Test Scenario”# scenarios/basic-test.yamlapiVersion: promptkit.altairalabs.ai/v1alpha1kind: Scenariometadata: name: basic-test
spec: task_type: assistant description: Basic conversation test
turns: - role: user content: "Hello! Can you help me?" assertions: - type: content_not_empty params: message: "Should respond to greeting"5. Environment Setup
Section titled “5. Environment Setup”# .envOPENAI_API_KEY=your-api-key-here# ANTHROPIC_API_KEY=your-api-key-here# GOOGLE_API_KEY=your-api-key-hereUsing Generated Projects
Section titled “Using Generated Projects”After generation, your project is ready to use:
cd my-test
# Add your API key to .envecho "OPENAI_API_KEY=sk-..." > .env
# Run testspromptarena run
# View resultscat output/results.jsonCustomizing After Generation
Section titled “Customizing After Generation”All generated files are standard PromptKit YAML and can be edited freely:
# Edit the promptvim prompts/assistant.yaml
# Add more scenarioscp scenarios/basic-test.yaml scenarios/advanced-test.yamlvim scenarios/advanced-test.yaml
# Configure additional providersvim providers/claude.yamlBest Practices
Section titled “Best Practices”1. Start with Quick Mode
Section titled “1. Start with Quick Mode”Begin with quick mode to understand the structure:
promptarena init learning --quick --provider mockcd learningcat config.arena.yaml prompts/assistant.yaml scenarios/basic-test.yaml2. Use Mock Provider for Development
Section titled “2. Use Mock Provider for Development”Mock provider responses are instant and free:
promptarena init dev-test --quick --provider mockSwitch to real providers when ready:
# Edit providers/mock.yaml -> change type to openai# Or create a new provider file3. Version Control from Day One
Section titled “3. Version Control from Day One”Generated projects include .gitignore:
promptarena init my-test --quick --provider openaicd my-testgit initgit add .git commit -m "Initial project setup"4. Organize Multiple Projects
Section titled “4. Organize Multiple Projects”# Create separate projects for different use casespromptarena init customer-support --quick --provider openaipromptarena init content-generation --quick --provider anthropicpromptarena init qa-testing --quick --provider mockAdvanced Usage
Section titled “Advanced Usage”Custom Template Variables
Section titled “Custom Template Variables”Pass variables for fine-grained control:
promptarena init api-tests \ --quick \ --provider openai \ --var project_name="API Integration Tests" \ --var description="Tests for API endpoint conversations" \ --var system_prompt="You are an API assistant" \ --var temperature=0.3 \ --var max_tokens=1000Inspect Generated Files
Section titled “Inspect Generated Files”Review what was created:
promptarena init my-test --quick --provider openaicd my-testtree .
# Output:# .# ├── .env# ├── .gitignore# ├── README.md# ├── config.arena.yaml# ├── prompts/# │ └── assistant.yaml# ├── providers/# │ └── openai.yaml# └── scenarios/# └── basic-test.yamlTroubleshooting
Section titled “Troubleshooting””Directory already exists"
Section titled “”Directory already exists"”# Choose a different namepromptarena init my-test-2 --quick --provider openai
# Or remove the existing directoryrm -rf my-testpromptarena init my-test --quick --provider openai"Provider not recognized”
Section titled “"Provider not recognized””Valid providers are: mock, openai, anthropic, google
# Use a valid providerpromptarena init my-test --quick --provider openaiMissing API Key
Section titled “Missing API Key”Generated projects create .env with placeholders:
cd my-testecho "OPENAI_API_KEY=sk-your-actual-key" > .envNext Steps
Section titled “Next Steps”- Write Test Scenarios - Customize your test scenarios
- Configure Providers - Set up additional providers
- Tutorial: First Test - Complete walkthrough
Related Documentation
Section titled “Related Documentation”- CLI Reference - All
promptarenacommands - Configuration Schema - Full schema documentation
- Examples - Real-world project examples