{"id":13572143,"url":"https://github.com/ezelikman/parsel","last_synced_at":"2025-04-04T09:31:49.889Z","repository":{"id":65852214,"uuid":"593432192","full_name":"ezelikman/parsel","owner":"ezelikman","description":"Code for Parsel 🐍 - generate complex programs with language models","archived":false,"fork":false,"pushed_at":"2023-09-17T12:51:01.000Z","size":174,"stargazers_count":377,"open_issues_count":7,"forks_count":32,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-05-22T15:32:54.967Z","etag":null,"topics":["ai","lean","machine-learning","ml","program-synthesis","python","robotics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ezelikman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-01-26T01:06:31.000Z","updated_at":"2024-05-18T02:34:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"24c5100b-2e0c-4967-9cdd-8e378b49a32a","html_url":"https://github.com/ezelikman/parsel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezelikman%2Fparsel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezelikman%2Fparsel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezelikman%2Fparsel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezelikman%2Fparsel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ezelikman","download_url":"https://codeload.github.com/ezelikman/parsel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247153517,"owners_count":20892682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","lean","machine-learning","ml","program-synthesis","python","robotics"],"created_at":"2024-08-01T14:01:14.804Z","updated_at":"2025-04-04T09:31:44.868Z","avatar_url":"https://github.com/ezelikman.png","language":"Python","funding_links":[],"categories":["Tools/Products","LLM-powered natural language compilers","Python","⚙️ Natural Language to Code Tools"],"sub_categories":["LLM-powered natural language compilers"],"readme":"# 🐍 Parsel\n\n**Parsel** is a natural language framework for writing programs for any target language using code language models. Parsel considers multiple implementations for each function, searching sets of implementations to find programs passing unit tests (more generally, program constraints). It can be used for many kinds of algorithmic tasks, e.g. code synthesis, robotic planning, and theorem proving.\n\n- 🕸️ [Website](http://zelikman.me/parselpaper/)\n- 📜 [Preprint](https://arxiv.org/abs/2212.10561)\n- 🐦 Twitter threads: [Current paper version](https://twitter.com/ericzelikman/status/1618426056163356675), [automatic test generation](https://twitter.com/ericzelikman/status/1622605951835705344), and [automatic function naming](https://twitter.com/ericzelikman/status/1625593237946912768).\n\n## Installation\nTo get use this repo, it should be enough to just:\n\n```\ngit clone https://github.com/ezelikman/parsel.git\npip install openai\n```\n## Notebook\nWe provide an [intro notebook](https://github.com/ezelikman/parsel/blob/main/parsel.ipynb) showing how to interact with Parsel.\n\n## Examples\nIn order to run this project, here are some example commands:\n- `python parsel.py programs/problem_solving.ss` will run and transpile the program in the file `programs/problem_solving.ss`.\n- `python parsel.py programs/collatz_recursion.ss` shows an example of a recursive function.\n- `python parsel.py programs/problem_solving_no_tests.ss -g` shows how you can use automatic test generation to write programs without tests.\n- `python parsel.py programs/game_of_life_inverse_no_args.ss -n` shows how you can use natural language to write programs without argument names.\n- `python parsel.py programs/problem_solving_no_args_no_tests.ss -g -n` shows how you can use automatic test generation to write programs without tests or argument names, i.e. in entirely natural language.\n- To run `python parsel.py programs/and_commute.ss`, change the mode in `consts/__init__.py` to `lean` and (assuming you have Lean installed), it will generate a Lean file in the same directory as the input file.\n- To run `game_of_life_inverse_expand.ss` you will need to use the `-e` flag to automatically expand / decompose it.\n- To run `game_of_life_inverse_fill.ss` you will need to use the `-a` to autofill the program with functions that are called but not used.\n\nIn general, to configure Parsel for a new target programming, you'll need to create a new file in `consts/` and add it to `consts/__init__.py`. In addition, to use the OpenAI models, you'll need to create a `keys/codex_key.txt` file in the format `organization_id:api_key`.\n\n## Citation\n\nIf you find this repo or the paper useful in your research, please feel free to cite [our paper](https://arxiv.org/abs/2212.10561):\n```\n@misc{zelikman2022parsel,\n  url = {https://arxiv.org/abs/2212.10561},\n  author = {Zelikman, Eric and Huang, Qian and Poesia, Gabriel and Goodman, Noah D and Haber, Nick},\n  keywords = {Computation and Language (cs.CL); Artificial Intelligence (cs.AI); Machine Learning (cs.LG)},\n  title = {Parsel 🐍: A (De-)compositional Framework for Algorithmic Reasoning with Language Models},\n  publisher = {arXiv},\n  year = {2022},\n  copyright = {arXiv.org perpetual, non-exclusive license}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezelikman%2Fparsel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fezelikman%2Fparsel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezelikman%2Fparsel/lists"}