{"data":{"slug":"dragonfly-dragonfly","name":"dragonfly","tagline":"An open source Python library for scalable Bayesian optimisation.","github_url":"https://github.com/dragonfly/dragonfly","owner":"dragonfly","repo":"dragonfly","owner_avatar_url":"https://avatars.githubusercontent.com/u/38572935?v=4","primary_language":"Python","stars":894,"forks":238,"topics":[],"archived":false,"github_pushed_at":"2023-06-19T20:23:17+00:00","maintenance_label":"Dormant","stars_delta_30d":0,"url":"https://www.graphcanon.com/tools/dragonfly-dragonfly","markdown_url":"https://www.graphcanon.com/tools/dragonfly-dragonfly.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/dragonfly-dragonfly","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=dragonfly-dragonfly","description":"An open source python library for scalable Bayesian optimisation.","homepage_url":null,"license":"MIT","open_issues":43,"watchers":25,"ai_summary":"Provides APIs and command-line utilities to perform Bayesian optimisation suitable for large-scale problems.","readme_excerpt":"## Installation\n\nSee \n[here](https://dragonfly-opt.readthedocs.io/en/master/install/)\nfor detailed instructions on installing Dragonfly and its dependencies.\n\n**Quick Installation:**\nIf you have done this kind of thing before, you should be able to install\nDragonfly via `pip`.\n\n```bash\n$ sudo apt-get install python-dev python3-dev gfortran # On Ubuntu/Debian\n$ pip install numpy\n$ pip install dragonfly-opt -v\n```\n\n\n**Testing the Installation**:\nYou can import Dragonfly in python to test if it was installed properly.\nIf you have installed via source, make sure that you move to a different directory \n to avoid naming conflicts.\n```bash\n$ python\n>>> from dragonfly import minimise_function\n>>> # The first argument below is the function, the second is the domain, and the third is the budget.\n>>> min_val, min_pt, history = minimise_function(lambda x: x ** 4 - x**2 + 0.1 * x, [[-10, 10]], 10);  \n...\n>>> min_val, min_pt\n(-0.32122746026750953, array([-0.7129672]))\n```\nDue to stochasticity in the algorithms, the above values for `min_val`, `min_pt` may be\ndifferent. If you run it for longer (e.g.\n`min_val, min_pt, history = minimise_function(lambda x: x ** 4 - x**2 + 0.1 * x, [[-10, 10]], 100)`),\nyou should get more consistent values for the minimum. \n\n\nIf the installation fails or if there are warning messages, see detailed instructions\n[here](https://dragonfly-opt.readthedocs.io/en/master/install/).\n\n\n&nbsp;\n\n---\n\n## Quick Start\n\nDragonfly can be\nused directly in the command line by calling\n[`dragonfly-script.py`](bin/dragonfly-script.py)\nor be imported in python code via the `maximise_function` function in the main library\nor in <em>ask-tell</em> mode.\nTo help get started, we have provided some examples in the\n[`examples`](examples) directory.\nSee our readthedocs getting started pages\n([command line](https://dragonfly-opt.readthedocs.io/en/master/getting_started_cli/),\n[Python](https://dragonfly-opt.readthedocs.io/en/master/getting_started_py/),\n[Ask-Tell](https://dragonfly-opt.readthedocs.io/en/master/getting_started_ask_tell/))\nfor examples and use cases.\n\n**Command line**:\nBelow is an example usage in the command line.\n```bash\n$ cd examples\n$ dragonfly-script.py --config synthetic/branin/config.json --options options_files/options_example.txt\n```\n\n**In Python code**:\nThe main APIs for Dragonfly are defined in\n[`dragonfly/apis`](dragonfly/apis).\nFor their definitions and arguments, see\n[`dragonfly/apis/opt.py`](dragonfly/apis/opt.py) and\n[`dragonfly/apis/moo.py`](dragonfly/apis/moo.py).\nYou can import the main API in python code via,\n```python\nfrom dragonfly import minimise_function, maximise_function\nfunc = lambda x: x ** 4 - x**2 + 0.1 * x\ndomain = [[-10, 10]]\nmax_capital = 100\nmin_val, min_pt, history = minimise_function(func, domain, max_capital)\nprint(min_val, min_pt)\nmax_val, max_pt, history = maximise_function(lambda x: -func(x), domain, max_capital)\nprint(max_val, max_pt)\n```\nHere, `func` is the function to be maximised,\n`domain` is the domain over which `func` is to be optimised,\nand `max_capital` is the capital available for optimisation.\nThe domain can be specified via a JSON file or in code.\nSee\n[here](examples/synthetic/branin/in_code_demo.py),\n[here](examples/synthetic/hartmann6_4/in_code_demo.py),\n[here](examples/synthetic/discrete_euc/in_code_demo_1.py),\n[here](examples/synthetic/discrete_euc/in_code_demo_2.py),\n[here](examples/synthetic/hartmann3_constrained/in_code_demo.py),\n[here](examples/synthetic/park1_constrained/in_code_demo.py),\n[here](examples/synthetic/borehole_constrained/in_code_demo.py),\n[here](examples/synthetic/multiobjective_branin_currinexp/in_code_demo.py),\n[here](examples/synthetic/multiobjective_hartmann/in_code_demo.py),\n[here](examples/tree_reg/in_code_demo.py),\nand\n[here](examples/nas/demo_nas.py)\nfor more detailed examples.\n\n**In Ask-Tell Mode**:\nAsk-tell mode provides you more control over your experiments where you can supply past results\nto our API in order to obtain a recommendation.\nSee","github_created_at":"2018-04-20T22:19:50+00:00","created_at":"2026-07-11T23:33:31.796915+00:00","updated_at":"2026-09-30T06:00:49.775827+00:00","categories":[{"slug":"model-training","name":"Model Training","url":"https://www.graphcanon.com/categories/model-training","markdown_url":"https://www.graphcanon.com/categories/model-training.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/model-training"}],"tags":[{"slug":"bayesian-optimisation","name":"bayesian optimisation"},{"slug":"python-library","name":"python library"},{"slug":"scalable-optimisation","name":"scalable optimisation"}],"trust":{"provenance":{"is_fork":false,"github_id":130418835,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-09-30T06:00:48.968Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":1198,"last_release_at":null,"stars_delta_30d":0,"open_issues_delta_30d":0},"security_summary":{"status":"ok","scanner":"osv@v1","low_count":0,"high_count":0,"last_scan_at":"2026-07-11T23:33:36.973Z","medium_count":0,"scan_profile":"deps","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-09-30T06:00:49.424Z"},"languages":{"value":["python"],"source":"github.language","observed_at":"2026-09-30T06:00:49.424Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-09-30T06:00:49.424Z"}},"decision_facts":{"hosting":null,"pricing":{"model":"freemium","summary":"Available under the MIT License, free to use but does require attention to licensing when redistributing derivative works."},"requirements":{"notes":["Installation requires Python and gfortran.","Additional dependencies can be installed via the `pip` package manager."],"min_ram_gb":null,"requires_docker":false},"constraints":{"min_ram_gb":null,"pricing_model":"freemium","requires_docker":false},"when_to_use":["When dealing with large-scale problems where traditional optimization methods may not be efficient enough.","For tasks requiring robust handling of noisy data, as Dragonfly's approach to Bayesian optimization includes stochastic algorithms designed for such scenarios."],"when_not_to_use":["If the problem at hand can be effectively managed by simpler or more lightweight optimization tools; Dragonfly’s strength lies in scalability and complex scenario management.","In environments where Python or extensive dependencies are not desirable, as installing and running Dragonfly requires specific setup including gfortran for certain operations."],"source":"enrich:decision_facts","observed_at":"2026-07-17T05:22:35.089Z"},"constraint_facets":{"min_ram_gb":null,"pricing_model":"freemium","requires_docker":false},"decision_summary":[{"label":"Pricing","value":"freemium - Available under the MIT License, free to use but does require attention to licensing when redistributing derivative works."},{"label":"Requirements","value":"Installation requires Python and gfortran.; Additional dependencies can be installed via the `pip` package manager."},{"label":"Adopt for","value":"Dragonfly is an open-source Python library that specializes in scalable Bayesian optimization"}]}}