{"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":895,"forks":238,"topics":[],"archived":false,"github_pushed_at":"2023-06-19T20:23:17+00:00","maintenance_label":"Dormant","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":null,"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-07-11T23:33:41.906432+00:00","categories":[{"slug":"llm-frameworks","name":"LLM Frameworks","url":"https://www.graphcanon.com/categories/llm-frameworks","markdown_url":"https://www.graphcanon.com/categories/llm-frameworks.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/llm-frameworks"},{"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"},{"slug":"vector-databases","name":"Vector Databases","url":"https://www.graphcanon.com/categories/vector-databases","markdown_url":"https://www.graphcanon.com/categories/vector-databases.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/vector-databases"}],"tags":[{"slug":"python","name":"python"}],"trust":{"provenance":{"is_fork":false,"github_id":130418835,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-07-11T23:33:36.461Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":1118,"last_release_at":null},"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-07-11T23:33:36.177Z"},"languages":{"value":["python"],"source":"github.language","observed_at":"2026-07-11T23:33:36.177Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-07-11T23:33:36.177Z"}}}}