Install PromptArena
Learn how to install and set up PromptArena for testing LLM applications.
Installation Methods
Section titled “Installation Methods”Option 1: npm/npx (Recommended for JavaScript/TypeScript Projects)
Section titled “Option 1: npm/npx (Recommended for JavaScript/TypeScript Projects)”The easiest way to use PromptArena, especially if you’re working in a JavaScript/TypeScript environment:
# Use without installation (recommended for trying it out)npx @altairalabs/promptarena run -c config.arena.yaml
# Install globallynpm install -g @altairalabs/promptarena
# Or add to your project as a dev dependencynpm install --save-dev @altairalabs/promptarenaBenefits:
- No Go toolchain required
- Works with npm, yarn, and pnpm
- Easy integration with package.json scripts
- Automatic platform detection
Add to your package.json:
{ "scripts": { "test:prompts": "promptarena run -c ./tests/config.arena.yaml", "test:watch": "promptarena run -c ./tests/config.arena.yaml --watch" }, "devDependencies": { "@altairalabs/promptarena": "^0.0.1" }}Option 2: Homebrew (macOS/Linux)
Section titled “Option 2: Homebrew (macOS/Linux)”# Install PromptKit (includes PromptArena)brew install promptkit
# Verify installationpromptarena --versionOption 3: Go Install
Section titled “Option 3: Go Install”# Install directly with Gogo install github.com/altairalabs/promptkit/tools/arena@latest
# The binary will be in your $GOPATH/binpromptarena --versionOption 4: Download Pre-built Binary
Section titled “Option 4: Download Pre-built Binary”Visit the PromptKit Releases page and download the appropriate binary for your platform.
# Example for macOS (adjust version and platform as needed)curl -LO https://github.com/AltairaLabs/PromptKit/releases/latest/download/promptarena-darwin-amd64chmod +x promptarena-darwin-amd64sudo mv promptarena-darwin-amd64 /usr/local/bin/promptarenaFor Developers: Build from Source
Section titled “For Developers: Build from Source”# Clone the repositorygit clone https://github.com/AltairaLabs/PromptKit.gitcd PromptKit
# Build and installmake install-arenaVerify Installation
Section titled “Verify Installation”# Check that Arena is installedpromptarena --help
# Should display command usage and available commandsEnable Shell Completions (Optional)
Section titled “Enable Shell Completions (Optional)”Enable tab completion for commands, flags, and dynamic values:
# Bashpromptarena completion bash > ~/.local/share/bash-completion/completions/promptarena
# Zshpromptarena completion zsh > ~/.zsh/completions/_promptarena
# Fishpromptarena completion fish > ~/.config/fish/completions/promptarena.fishSee Configure Shell Completions for detailed setup instructions.
Create Your First Project
Section titled “Create Your First Project”After installation, use the project generator to get started instantly:
# Create a new test project with guided setuppromptarena init my-llm-tests
# Or use quick mode with defaultspromptarena init my-llm-tests --quick --provider mock
# Navigate to your projectcd my-llm-tests
# Run your first testpromptarena runThe init command creates everything you need:
- Arena configuration (
config.arena.yaml) - Provider setup (
providers/) - Sample test scenario (
scenarios/) - Prompt configuration (
prompts/) - Environment variables (
.env) - README with next steps
Manual Configuration (Advanced)
Section titled “Manual Configuration (Advanced)”If you prefer to create files manually:
# Create a test directorymkdir my-llm-testscd my-llm-tests
# Create a minimal config filecat > config.arena.yaml << 'EOF'apiVersion: promptkit.altairalabs.ai/v1alpha1kind: Arenametadata: name: my-llm-tests
spec: prompts: - path: ./prompts
providers: - path: ./providers
scenarios: - path: ./scenariosEOFNext Steps
Section titled “Next Steps”- Write Your First Test Scenario - Create test scenarios
- Configure Providers - Set up LLM providers
- Tutorial: First Test - Complete hands-on guide
Troubleshooting
Section titled “Troubleshooting”Command Not Found (Go Install)
Section titled “Command Not Found (Go Install)”If promptarena is not found after go install:
# Ensure Go bin is in your PATHexport PATH=$PATH:$(go env GOPATH)/bin
# Add to your shell profile (~/.zshrc or ~/.bashrc)echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrcsource ~/.zshrcPermission Denied (Binary Download)
Section titled “Permission Denied (Binary Download)”# Make the binary executablechmod +x promptarena-*Homebrew Not Found
Section titled “Homebrew Not Found”Install Homebrew first:
# macOS/Linux/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"