### Install and Configure optillm Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/web_scraper_optillm/README.md Clone the optillm repository, install dependencies, and start the optillm proxy with a local inference server. Ensure the OPTILLM_API_KEY is set. ```bash git clone https://github.com/codelion/optillm.git cd optillm pip install -r requirements.txt export OPTILLM_API_KEY=optillm python optillm.py --port 8000 ``` -------------------------------- ### Install Dependencies Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/llm_prompt_optimization/README.md Install necessary Python packages for prompt optimization. Navigate to the example directory first. ```bash cd examples/llm_prompt_optimization pip install -r requirements.txt ``` -------------------------------- ### Install and Run OptiLLM Proxy Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/README.md Install OptiLLM and start its proxy to enable advanced features like rate limiting and test-time compute. Then, point OpenEvolve to the OptiLLM API. ```bash # Install OptiLLM pip install optillm # Start OptiLLM proxy optillm --port 8000 # Point OpenEvolve to OptiLLM export OPENAI_API_KEY="your-actual-key" ``` ```yaml llm: api_base: "http://localhost:8000/v1" model: "moa&readurls-o3" # Test-time compute + web access ``` -------------------------------- ### Clone and Navigate OpenEvolve Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/attention_optimization/README.md Clone the OpenEvolve repository and navigate to the attention optimization example directory. Verify MLIR tool installations. ```bash # Clone OpenEvolve git clone https://github.com/codelion/openevolve cd openevolve/examples/attention_optimization # Verify MLIR tools mlir-opt --version mlir-translate --version ``` -------------------------------- ### Install OpenEvolve Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/k_module_problem/README.md Install the OpenEvolve library using pip. This is a prerequisite for running the provided examples. ```bash pip install -e . ``` -------------------------------- ### Bash: Run Signal Processing Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/README.md Navigate to the signal processing example directory and run OpenEvolve with the specified configuration. ```bash cd examples/signal_processing python ../../openevolve-run.py initial_program.py evaluator.py --config config.yaml ``` -------------------------------- ### Install and Run OpenEvolve CLI Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/README.md Installs OpenEvolve via pip and runs an example evolution using command-line arguments. Ensure your Gemini API key is set as an environment variable. ```bash pip install openevolve export OPENAI_API_KEY="your-gemini-api-key" python openevolve-run.py examples/function_minimization/initial_program.py \ examples/function_minimization/evaluator.py \ --config examples/function_minimization/config.yaml \ --iterations 50 ``` -------------------------------- ### Bash: Run Circle Packing Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/README.md Navigate to the circle packing example directory and run OpenEvolve with the specified configuration for phase 1. ```bash cd examples/circle_packing python ../../openevolve-run.py initial_program.py evaluator.py --config config_phase_1.yaml ``` -------------------------------- ### Install OpenEvolve Source: https://context7.com/algorithmicsuperintelligence/openevolve/llms.txt Install OpenEvolve from PyPI or clone the repository and install from source. Remember to set your LLM API key. ```bash pip install openevolve ``` ```bash git clone https://github.com/algorithmicsuperintelligence/openevolve.git cd openevolve pip install -e ".[dev]" ``` ```bash export OPENAI_API_KEY="your-api-key" ``` -------------------------------- ### Install Web Scraping Dependencies Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/web_scraper_optillm/README.md Install the necessary Python packages required for the web scraper example. This command should be run from the openevolve root directory. ```bash pip install -r examples/web_scraper_optillm/requirements.txt ``` -------------------------------- ### Start optillm Server Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/tests/integration/README.md Start the optillm server with a specified model and port. This is a prerequisite for running slow integration tests that require LLM inference. ```bash OPTILLM_API_KEY=optillm optillm --model google/gemma-3-270m-it --port 8000 ``` -------------------------------- ### Run OpenEvolve with Docker Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/README.md This command demonstrates how to pull the OpenEvolve Docker image and run an example, mounting the current directory for access to examples. ```bash # Pull the image docker pull ghcr.io/algorithmicsuperintelligence/openevolve:latest # Run an example docker run --rm -v $(pwd):/app ghcr.io/algorithmicsuperintelligence/openevolve:latest \ examples/function_minimization/initial_program.py \ examples/function_minimization/evaluator.py --iterations 100 ``` -------------------------------- ### Test Signal Processing Setup Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/signal_processing/README.md Runs a test script to validate the initial signal processing implementation and the evaluator. This is recommended before starting the main evolution process. ```bash cd examples/signal_processing python test_setup.py ``` -------------------------------- ### Initialize OpenEvolve with Configuration Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/configs/README.md Example of initializing the OpenEvolve engine with specified program paths and a custom configuration file. ```python from openevolve import OpenEvolve evolve = OpenEvolve( initial_program_path="program.py", evaluation_file="evaluator.py", config_path="my_config.yaml" ) ``` -------------------------------- ### Running the Circle Packing Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/circle_packing_with_artifacts/README.md Command to execute the initial phase of the circle packing example using OpenEvolve, specifying the main Python scripts and a configuration file. ```bash # Phase 1: Initial exploration python openevolve-run.py examples/circle_packing/initial_program.py \ examples/circle_packing/evaluator.py \ --config examples/circle_packing/config_phase_1.yaml \ --iterations 100 ``` -------------------------------- ### Set Up Development Environment Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/CONTRIBUTING.md Installs the package in development mode and sets up the environment for testing. The OPENAI_API_KEY must be set, even for unit tests. ```bash export OPENAI_API_KEY=test-key-for-unit-tests ``` -------------------------------- ### Install Dependencies and Set API Key Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/mlx_metal_kernel_opt/README.md Installs necessary Python packages and sets the API key for the evolution process. Ensure you replace 'your-gemini-key' with your actual key. ```bash pip install mlx mlx-lm openevolve # Set API key (Gemini via OpenAI-compatible endpoint) export OPENAI_API_KEY="your-gemini-key" ``` -------------------------------- ### Install optillm Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/tests/integration/README.md Install the optillm library, which is required for running slow integration tests that involve LLM inference. ```bash pip install optillm ``` -------------------------------- ### Run Function Minimization Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/function_minimization/README.md Command to execute the function minimization example using OpenEvolve. Ensure you are in the correct directory. ```bash cd examples/function_minimization python ../../openevolve-run.py initial_program.py evaluator.py --config config.yaml ``` -------------------------------- ### Run Evolution from Example Directory Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/signal_processing/README.md Executes the OpenEvolve evolutionary process using the specified configuration file. This command can be run from within the signal_processing example directory. ```bash python ../../openevolve-run.py config.yaml ``` -------------------------------- ### Copy Default Configuration Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/configs/README.md Use this command to copy the default configuration file as a starting point for your custom OpenEvolve setup. ```bash cp configs/default_config.yaml my_config.yaml # Edit my_config.yaml for your specific needs ``` -------------------------------- ### Install OpenEvolve via PyPI Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/README.md Use this command to install the OpenEvolve package using pip, the recommended installation method. ```bash pip install openevolve ``` -------------------------------- ### Create and Activate Virtual Environment Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/CONTRIBUTING.md Sets up a virtual environment for development and installs the project dependencies. The OPENAI_API_KEY should be set for testing. ```bash python -m venv env source env/bin/activate # On Windows: env\Scripts\activate pip install -e ".[dev]" # For running tests (no actual API calls are made) export OPENAI_API_KEY=test-key-for-unit-tests # For testing with real LLMs during development # export OPENAI_API_KEY=your-actual-api-key ``` -------------------------------- ### Run LLM Prompt Optimization Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/README.md Execute an example for evolving prompts to improve LLM performance. This demonstrates self-improving AI systems and prompt evolution techniques. ```bash cd examples/llm_prompt_optimazation python ../../openevolve-run.py initial_prompt.txt evaluator.py --config config.yaml ``` -------------------------------- ### Run Web Scraper with optillm Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/README.md Execute a web scraping example that integrates with optillm, readurls, and MoA. This demonstrates integration with LLM proxy systems and test-time compute. ```bash cd examples/web_scraper_optillm python ../../openevolve-run.py initial_program.py evaluator.py --config config.yaml ``` -------------------------------- ### File Structure for Signal Processing Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/signal_processing/README.md Outlines the directory structure for the signal processing example, including configuration, initial implementation, evaluation scripts, and output directories. ```text signal_processing/ ├── README.md # This documentation ├── config.yaml # OpenEvolve configuration ├── initial_program.py # Initial signal processing implementation ├── evaluator.py # Multi-objective evaluation system ├── requirements.txt # Python dependencies └── results/ # Generated results (after running) ``` -------------------------------- ### Install Rust Toolchain Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/rust_adaptive_sort/README.md Install the Rust toolchain using rustup. This is a prerequisite for compiling and running Rust code. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.cargo/env ``` -------------------------------- ### HotpotQA Evolved Prompt Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/llm_prompt_optimization/README.md An example of an evolved prompt for the HotpotQA dataset, achieving 88.62% accuracy. It guides the LLM to synthesize information from multiple paragraphs and cite sources. ```text Answer the following question using the provided context. The answer must integrate information from multiple paragraphs and follow these steps: 1. Paragraph Analysis: Extract key details from each relevant paragraph... 2. Synthesis: Combine these details into a single, coherent response... 3. Citation: Attribute all assertions to their source paragraphs... ``` -------------------------------- ### Bash: Run MLX Metal Kernel Optimization Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/README.md Navigate to the MLX Metal kernel optimization example directory and run OpenEvolve with the specified configuration for performance tuning. ```bash cd examples/mlx_metal_kernel_opt python ../../openevolve-run.py initial_program.py evaluator.py --config config.yaml ``` -------------------------------- ### Install OpenEvolve in Development Mode Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/CLAUDE.md Installs the package in development mode with all necessary dependencies. Alternatively, use the Makefile. ```bash pip install -e ".[dev"] ``` ```bash make install ``` -------------------------------- ### Development Install for OpenEvolve Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/README.md Clone the repository and install OpenEvolve in development mode for contributing or making modifications. ```bash git clone https://github.com/algorithmicsuperintelligence/openevolve.git cd openevolve pip install -e ".[dev]" ``` -------------------------------- ### Bash: Run Rust Adaptive Sort Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/README.md Navigate to the Rust adaptive sort example directory and run OpenEvolve with the specified configuration. Supports multi-language execution. ```bash cd examples/rust_adaptive_sort python ../../openevolve-run.py initial_program.rs evaluator.py --config config.yaml ``` -------------------------------- ### Prompt Engineering Example: Boundaries Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/README.md Shows how to set clear boundaries in system messages, specifying what must not change and what is allowed for optimization. This helps guide the LLM effectively. ```yaml system_message: | MUST NOT CHANGE: ❌ Function signatures ❌ Algorithm correctness ❌ External API ALLOWED: ✅ Internal implementation ✅ Data structures ✅ Performance optimizations ``` -------------------------------- ### Effective JAX Hint Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/algotune/README.md Provides high-level guidance for JAX optimization, focusing on JIT compilation and pure functions. Avoids implementation details. ```yaml • **JAX** - JIT compilation for numerical computations that can provide 100x+ speedups JAX offers drop-in NumPy replacements (jax.numpy) that work with JIT compilation Works best with pure functions (no side effects) and may require code restructuring • Lower-order interpolation: Try order=0,1,2,3 - lower orders can provide dramatic speedups ``` -------------------------------- ### Diff User Prompt Format Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/lm_eval/prompts/diff_user.txt This example demonstrates the required SEARCH/REPLACE format for suggesting code modifications. Ensure the SEARCH section exactly matches the text in the current solution. ```text <<<<<<< SEARCH # Original text to find and replace (must match exactly) ======= # New replacement text >>>>>>> REPLACE ``` ```text <<<<<<< SEARCH poem stub ======= Tyger Tyger, burning bright, In the forests of the night; What immortal hand or eye >>>>>>> REPLACE ``` -------------------------------- ### Run OpenEvolve Robust Regression Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/r_robust_regression/README.md Execute the OpenEvolve robust regression evolution process. This command starts the evolution from the 'initial_program.r' script, using 'evaluator.py' for evaluation, and runs for 100 iterations. ```bash cd examples/r_robust_regression python ../../openevolve-run.py initial_program.r evaluator.py --config config.yaml --iterations 100 ``` -------------------------------- ### Install Visualization Dependencies Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/README.md Command to install the necessary Python packages for the OpenEvolve visualization tool. Run this before launching the visualizer. ```bash # Install visualization dependencies pip install -r scripts/requirements.txt ``` -------------------------------- ### Install SLDBench Dependencies Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/sldbench/README.md Install the necessary libraries for SLDBench. Ensure you are using the latest version of openevolve. ```bash pip install datasets numpy scipy # Ensure the latest version of openevolve is installed ``` -------------------------------- ### Run Online Judge Programming Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/README.md Execute an example for solving competitive programming problems using automated solution generation and submission. This showcases integration with external evaluation systems. ```bash cd examples/online_judge_programming python ../../openevolve-run.py initial_program.py evaluator.py --config config.yaml ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/r_robust_regression/README.md Install the necessary Python packages using pip. Ensure you have a 'requirements.txt' file in your project directory. ```bash pip install -r requirements.txt ``` -------------------------------- ### Effective Hint Structure Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/algotune/README.md Demonstrates an effective structure for performance optimization hints, separating library capabilities from problem-specific guidance. ```yaml PERFORMANCE OPTIMIZATION OPPORTUNITIES: • **[Library]** - High-level capability description Technical requirements without implementation details PROBLEM-SPECIFIC OPTIMIZATION HINTS: • Parameter exploration guidance • Algorithmic approach suggestions • Performance vs accuracy tradeoffs ``` -------------------------------- ### Launch Interactive Visualizer Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/README.md Command to start the OpenEvolve interactive visualizer. This tool provides real-time tracking of the evolution process. ```bash # Launch interactive visualizer python scripts/visualizer.py ``` -------------------------------- ### Example Output of Optimization Process Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/attention_optimization/README.md Illustrates the expected output format during the OpenEvolve optimization process, showing baseline measurement, parameter evaluation, pipeline used, and optimization results. ```text Measuring baseline performance... Evaluating parameters: {'tile_size_m': 64, 'tile_size_n': 128, ...} Using pipeline: builtin.module(canonicalize,cse,linalg-fold-unit-extent-dims,...) Optimization succeeded (compile time: 0.123s) Result: error=15.234, speedup=1.18x, runtime=0.003421 Target missed: 1.18x < 1.32x ``` -------------------------------- ### Prompt Engineering Example: Domain Knowledge Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/README.md Demonstrates how to incorporate domain-specific knowledge into prompts for better optimization guidance, using GPU kernel optimization as an example. Avoid generic optimization advice. ```yaml # Good: "For GPU kernels: 1) Memory coalescing 2) Occupancy 3) Shared memory usage" # Avoid: "Optimize the algorithm" ``` -------------------------------- ### Dataset Configuration Example (YAML) Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/llm_prompt_optimization/README.md Defines the configuration for a dataset used in prompt evolution, specifying input fields, target fields, and special handling flags. ```yaml # Example: ifeval_prompt_dataset.yaml dataset_name: "google/IFEval" input_field: "prompt" target_field: "instruction_id_list" split: "train" is_ifeval: true # Special handling flag ``` -------------------------------- ### Run TSP Minimization Evolution Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/tsp_tour_minimization/README.md Execute the OpenEvolve process for TSP tour length minimization. This command navigates to the example directory, installs Python dependencies, and starts the evolution process, specifying directories for initial programs and OpenEvolve output. ```bash cd examples/tsp_tour_minimization pip install -r requirements.txt python start_evolution.py --initial_program_dir initial_program --openevolve_output_dir openevolve_output ``` -------------------------------- ### Install R Packages Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/r_robust_regression/README.md Install the 'jsonlite' package for R. This is a prerequisite for running the R components of the robust regression example. ```r install.packages(c("jsonlite")) ``` -------------------------------- ### Prompt Engineering Example: Specificity Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/README.md Illustrates effective prompt engineering by providing a specific example for reducing memory allocations, contrasting it with a vague instruction. Use concrete examples to guide LLMs. ```yaml # Good: "Focus on reducing memory allocations. Example: Replace `new Vector()` with pre-allocated arrays." # Avoid: "Make the code faster" ``` -------------------------------- ### Example Evolution with Artifacts Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/circle_packing_with_artifacts/README.md Illustrates how specific overlap violation artifacts guide an LLM to correct faulty code in the next generation. ```python # Faulty code centers[5] = [0.3, 0.3] centers[6] = [0.3, 0.3] # Same position! radii[5] = radii[6] = 0.1 ``` ```python # Fixed code centers[5] = [0.3, 0.3] centers[6] = [0.5, 0.3] # Different position! radii[5] = radii[6] = 0.1 ``` -------------------------------- ### Evolve Arbitrary Code with Custom Evaluator (Initial Code) Source: https://context7.com/algorithmicsuperintelligence/openevolve/llms.txt Provides an initial code string for evolving arbitrary code using `evolve_code`. This example shows a basic Fibonacci function as the starting point. ```python from openevolve import evolve_code from openevolve.config import Config, LLMModelConfig config = Config() config.llm.models = [LLMModelConfig(name="gpt-4o-mini", api_key="sk-...")] initial_code = """ # EVOLVE-BLOCK-START def fibonacci(n): if n <= 1: return n return fibonacci(n - 1) + fibonacci(n - 2) # EVOLVE-BLOCK-END """ # Example usage would follow, calling evolve_code with initial_code, an evaluator, and config. ``` -------------------------------- ### Running lm-eval.py with 15 Iterations Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/lm_eval/README.md Example with 15 iterations, illustrating potential performance changes. Do not cite metrics blindly; review solutions first, especially with early implementations. ```bash python3 examples/lm_eval/lm-eval.py --tasks gsm8k --limit 10 --iterations 15 [..] Headline metrics: gsm8k exact_match,strict-match 70.000% [..] ``` -------------------------------- ### Run Circle Packing Phase 1 Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/circle_packing/README.md Executes the initial exploration phase for the circle packing problem using OpenEvolve. Requires the main script, evaluator, and configuration file. ```bash python openevolve-run.py examples/circle_packing/initial_program.py \ examples/circle_packing/evaluator.py \ --config examples/circle_packing/config_phase_1.yaml \ --iterations 100 ``` -------------------------------- ### OpenEvolve Configuration Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/k_module_problem/README.md Configuration settings for the OpenEvolve algorithm, optimized for combinatorial problems. Key parameters include high temperature for exploration, a significant exploration ratio, and multiple islands for parallel search with frequent migration. ```yaml temperature: 0.9 exploration_ratio: 0.6 exploitation_ratio: 0.25 num_islands: 5 migration_interval: 3 migration_rate: 0.3 population_size: 25 ``` -------------------------------- ### Full Rewrite Prompt Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/lm_eval/prompts/full_rewrite_user.txt This prompt is used to instruct a user to rewrite a program for performance improvement. It includes placeholders for current metrics, improvement areas, evolution history, and the current program, followed by a clear instruction to provide the rewritten answer. ```text Project: /algorithmicsuperintelligence/openevolve Content: # Current Solution Information - Current metrics: {metrics} - Areas identified for improvement: {improvement_areas} # Evolution History {evolution_history} # Current Solution ``` {current_program} ``` # Task Rewrite the answer to improve its performance on the specified metrics. Provide the complete new answer. # Your rewritten answer here ``` -------------------------------- ### IFEval Evolved Prompt Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/llm_prompt_optimization/README.md An example of an evolved prompt for the IFEval dataset, demonstrating a 97.41% accuracy rate. It emphasizes precise instruction following and structured output. ```text Follow the instruction below precisely. Structure your response into two distinct parts: 1) a step-by-step reasoning process that explicitly identifies the task, constraints, and required output format, and 2) the final answer in the exact format specified... ``` -------------------------------- ### Generate Benchmark Tasks and Initial Programs Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/symbolic_regression/README.md Run this script to prepare tasks from the LLM-SRBench dataset. It generates initial Python programs, evaluators, and configuration files for each task. ```bash python data_api.py ``` -------------------------------- ### Run the Web Scraper Evolution Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/web_scraper_optillm/README.md Execute the OpenEvolve run script with the initial program, evaluator, and configuration files. Set the OPENAI_API_KEY to 'optillm' to enable optillm proxy. ```bash # From the openevolve root directory export OPENAI_API_KEY=optillm python openevolve-run.py examples/web_scraper_optillm/initial_program.py \ examples/web_scraper_optillm/evaluator.py \ --config examples/web_scraper_optillm/config.yaml \ --iterations 100 ``` -------------------------------- ### Performance Artifacts Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/circle_packing_with_artifacts/README.md Always included, this artifact reports the total execution time of the program. ```text ### Execution_time ``` 12.45s ``` ``` -------------------------------- ### Failure Artifacts Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/circle_packing_with_artifacts/README.md Captures stderr, failure stage, and a suggestion when compilation or runtime errors occur. ```text ## Last Execution Output ### Stderr ``` Invalid shapes: centers=(25, 2), radii=(26,), expected (26, 2) and (26,) ``` ### Failure_stage ``` shape_validation ``` ### Suggestion ``` Check for syntax errors, import issues, or runtime exceptions ``` ``` -------------------------------- ### Running lm-eval.py with 1 Iteration Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/lm_eval/README.md Example of running the benchmark with a single iteration. Note the initial performance metrics. Use the --limit parameter only for tests, not for metric generation. ```bash python3 examples/lm_eval/lm-eval.py --tasks gsm8k --limit 10 --iterations 1 [..] Headline metrics: gsm8k exact_match,strict-match 80.000% [..] ``` -------------------------------- ### Bash: Basic OpenEvolve Run Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/README.md Execute a basic OpenEvolve run with initial program, evaluator, configuration, and iterations. ```bash # Basic run python openevolve-run.py path/to/initial_program.py path/to/evaluator.py --config path/to/config.yaml --iterations 100 ``` -------------------------------- ### Post-Evolution Evaluation Result (ARC Benchmark) Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/arc_benchmark/README.md JSON output detailing the evaluation metrics for the test example. ```json { "metrics": { "runs_successfully": 1.0, "combined_score": 1.0, "test_example_0_pass_at_2": 1, "test_example_0_attempt_0": true, "test_example_0_attempt_1": true }, "artifacts": {} } ``` -------------------------------- ### Configure LLM Provider via YAML Source: https://context7.com/algorithmicsuperintelligence/openevolve/llms.txt Shows an example of configuring an OpenAI-compatible LLM provider using YAML. ```yaml ``` -------------------------------- ### Validation Artifacts Example Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/examples/circle_packing_with_artifacts/README.md Details boundary and overlap violations when geometric constraints are not met, along with a validation report. ```text ## Last Execution Output ### Boundary_violations ``` Circle 23 at (0.950000, 0.950000) with radius 0.055000 is outside unit square Circle 24 at (0.980000, 0.980000) with radius 0.030000 is outside unit square ``` ### Overlap_violations ``` Circles 5 and 12 overlap: dist=0.180000, r1+r2=0.190000 ``` ### Validation_report ``` Valid: False, Violations: 2 boundary, 1 overlaps ``` ``` -------------------------------- ### Run Basic OpenEvolve Evolution Source: https://github.com/algorithmicsuperintelligence/openevolve/blob/main/CLAUDE.md Initiates a basic evolution run with an initial program, evaluator, configuration file, and a specified number of iterations. ```bash python openevolve-run.py path/to/initial_program.py path/to/evaluator.py --config path/to/config.yaml --iterations 1000 ``` -------------------------------- ### OpenEvolve Configuration (`config.yaml`) Source: https://context7.com/algorithmicsuperintelligence/openevolve/llms.txt This is a sample configuration file for an OpenEvolve project. It defines parameters for evolution, LLM integration, database settings, and evaluation. ```yaml max_iterations: 500 random_seed: 42 diff_based_evolution: true early_stopping_patience: 50 convergence_threshold: 0.001 early_stopping_metric: "combined_score" llm: api_base: "https://generativelanguage.googleapis.com/v1beta/openai/" api_key: "${GEMINI_API_KEY}" temperature: 0.7 max_tokens: 4096 models: - name: "gemini-2.5-pro" weight: 0.6 - name: "gemini-2.5-flash" weight: 0.4 prompt: system_message: | You are an expert GPU programmer specializing in Apple Silicon Metal kernels. Optimize memory access patterns, use SIMD vectorization, and exploit threadgroup shared memory. DO NOT change kernel function signatures or template parameter names. num_top_programs: 3 num_diverse_programs: 2 include_artifacts: true use_template_stochasticity: true template_variations: improvement_suggestion: - "Here's how we could improve this code:" - "I suggest the following optimizations:" database: population_size: 1000 num_islands: 5 migration_interval: 50 migration_rate: 0.1 feature_dimensions: - "complexity" - "diversity" feature_bins: 10 evaluator: timeout: 300 parallel_evaluations: 4 cascade_evaluation: true cascade_thresholds: [0.5, 0.75, 0.9] use_llm_feedback: false evolution_trace: enabled: true format: "jsonl" include_prompts: true compress: false ```