# OpenDistillery CLI Reference The OpenDistillery command-line interface provides comprehensive tools for managing compound AI systems, agents, experiments, and integrations. ## Getting Started ```bash # Show help python src/cli.py --help # Enable verbose logging python src/cli.py -v <command> # Use configuration file python src/cli.py -c config.yaml <command> ``` ## System Management ### Create Systems Create specialized compound AI systems for different domains: ```bash # Basic system creation python src/cli.py system create \ --system-id "finance-risk" \ --domain "finance" \ --use-case "risk analysis and trading optimization" # Advanced system with custom parameters python src/cli.py system create \ --system-id "healthcare-clinical" \ --domain "healthcare" \ --use-case "clinical decision support" \ --architecture "mesh" \ --latency-target 500 \ --throughput-rps 200 \ --accuracy-threshold 0.99 ``` ### System Operations ```bash # List all systems python src/cli.py system list # Get detailed system status python src/cli.py system status --system-id "finance-risk" # Add models to existing system python src/cli.py system add-model \ --system-id "finance-risk" \ --model-name "risk-analyzer" \ --provider "openai" \ --model-id "gpt-4" \ --api-key "your-api-key" \ --max-tokens 8192 \ --temperature 0.1 \ --cost-per-token 0.00003 ``` ## Agent Management ### Create Agents ```bash # Create specialized agent python src/cli.py agent create-agent \ --agent-id "risk-analyst" \ --agent-type "financial_analyst" \ --specialization "risk_assessment" \ --capabilities "ANALYSIS" "REASONING" "REPORTING" # Create domain-specific agent python src/cli.py agent create-agent \ --agent-id "clinical-advisor" \ --agent-type "medical_advisor" \ --specialization "clinical_decision_support" \ --capabilities "ANALYSIS" "DIAGNOSIS" "RECOMMENDATION" ``` ## Experiment Management ### Research Experiments ```bash # Create research experiment python src/cli.py experiment create-experiment \ --experiment-id "prompt-optimization-2025" \ --name "Advanced Prompting Strategies" \ --description "Testing next-generation prompting techniques" \ --duration-hours 48 # Track experiment progress python src/cli.py experiment status --experiment-id "prompt-optimization-2025" ``` ## Server Management ### API Server ```bash # Start development server python src/cli.py server start --host 0.0.0.0 --port 8000 --reload # Start production server python src/cli.py server start \ --host 0.0.0.0 \ --port 8000 \ --workers 4 # Start with SSL python src/cli.py server start \ --host 0.0.0.0 \ --port 443 \ --ssl-keyfile /path/to/key.pem \ --ssl-certfile /path/to/cert.pem ``` ## Integration Management ### Enterprise Integrations ```bash # Setup Salesforce integration (when available) python src/cli.py integration setup-salesforce \ --username "user@company.com" \ --password "secure_password" \ --security-token "token123" \ --domain "login" # Setup Microsoft 365 integration python src/cli.py integration setup-microsoft365 \ --tenant-id "your-tenant-id" \ --client-id "your-client-id" \ --client-secret "your-secret" ``` ## Testing and Validation ### System Testing ```bash # Test system with sample prompt python src/cli.py test \ --system-id "finance-risk" \ --prompt "Analyze the risk profile of a tech startup with $10M funding" \ --strategy "adaptive" # Test with specific reasoning strategy python src/cli.py test \ --system-id "healthcare-clinical" \ --prompt "Patient presents with chest pain and shortness of breath" \ --strategy "chain_of_thought" ``` ## Configuration Options ### Architecture Types - `hierarchical`: Top-down decision making - `mesh`: Distributed peer-to-peer processing - `pipeline`: Sequential processing stages - `hybrid`: Adaptive architecture switching - `swarm`: Collaborative agent swarms ### Reasoning Strategies - `react`: Reasoning + Acting cycles - `chain_of_thought`: Step-by-step reasoning - `tree_of_thoughts`: Branching exploration - `graph_of_thoughts`: Network-based reasoning - `self_consistency`: Multiple reasoning paths - `ensemble`: Combining multiple approaches - `adaptive`: Dynamic strategy selection ### Performance Targets - `--latency-target`: Response time in milliseconds - `--throughput-rps`: Requests per second capacity - `--accuracy-threshold`: Minimum accuracy requirement (0-1) ## Advanced Usage ### Batch Operations ```bash # Create multiple systems from config python src/cli.py system batch-create --config systems.yaml # Bulk model deployment python src/cli.py system deploy-models --config models.yaml # Mass experiment execution python src/cli.py experiment batch-run --config experiments.yaml ``` ### Monitoring and Analytics ```bash # Real-time system metrics python src/cli.py monitor --system-id "finance-risk" --interval 5 # Generate performance reports python src/cli.py report --system-id "finance-risk" --format json # Export experiment results python src/cli.py experiment export --experiment-id "prompt-optimization-2025" ``` ## Environment Variables Set these environment variables for enhanced functionality: ```bash export OPENAI_API_KEY="your-openai-key" export ANTHROPIC_API_KEY="your-anthropic-key" export XAI_API_KEY="your-xai-key" export OPENDISTILLERY_CONFIG="/path/to/config.yaml" export OPENDISTILLERY_LOG_LEVEL="INFO" ``` ## Examples ### Complete Workflow ```bash # 1. Create a financial services system python src/cli.py system create \ --system-id "fintech-advisor" \ --domain "finance" \ --use-case "investment advisory and portfolio optimization" # 2. Add multiple models python src/cli.py system add-model \ --system-id "fintech-advisor" \ --model-name "market-analyzer" \ --provider "openai" \ --model-id "gpt-4" # 3. Create specialized agents python src/cli.py agent create-agent \ --agent-id "portfolio-manager" \ --agent-type "investment_advisor" \ --specialization "portfolio_optimization" # 4. Test the system python src/cli.py test \ --system-id "fintech-advisor" \ --prompt "Recommend portfolio allocation for moderate risk investor" \ --strategy "ensemble" # 5. Start the API server python src/cli.py server start --port 8000 ``` ## Troubleshooting ### Common Issues **Command not found**: Ensure you're in the correct directory and Python path is set **Permission denied**: Check file permissions and user access rights **API errors**: Verify API keys are correctly set in environment variables **Port conflicts**: Use different ports or kill existing processes ### Debug Mode ```bash # Enable verbose logging python src/cli.py -v system create --system-id test --domain test --use-case test # Check system configuration python src/cli.py system status --system-id test --debug ``` For additional help, visit our [documentation](https://opendistillery.readthedocs.io) or contact nikjois@llamasearch.ai. 