{"id":26558058,"url":"https://github.com/py-why/pywhyllm","last_synced_at":"2026-03-10T18:03:37.840Z","repository":{"id":180907360,"uuid":"660777161","full_name":"py-why/pywhyllm","owner":"py-why","description":"Experimental library integrating LLM capabilities to support causal analyses ","archived":false,"fork":false,"pushed_at":"2025-10-10T07:16:10.000Z","size":3958,"stargazers_count":270,"open_issues_count":12,"forks_count":32,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-12-15T19:18:12.934Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/py-why.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS.md","copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-30T20:24:30.000Z","updated_at":"2025-12-13T17:46:10.000Z","dependencies_parsed_at":"2024-07-08T18:24:45.827Z","dependency_job_id":"d85f3a0e-6785-4e1c-9979-d68d0d76f3b8","html_url":"https://github.com/py-why/pywhyllm","commit_stats":null,"previous_names":["py-why/pywhy-llm","py-why/pywhyllm"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/py-why/pywhyllm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhyllm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhyllm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhyllm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhyllm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/py-why","download_url":"https://codeload.github.com/py-why/pywhyllm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-why%2Fpywhyllm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30346483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-03-22T12:07:10.528Z","updated_at":"2026-03-10T18:03:37.831Z","avatar_url":"https://github.com/py-why.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyWhy-LLM: Leveraging Large Language Models for Causal Analysis\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n## Introduction\n\nPyWhy-LLM is an innovative library designed to augment human expertise by seamlessly integrating Large Language Models (LLMs) into the causal analysis process. It empowers users with access to knowledge previously only available through domain experts. As part of the DoWhy community, we aim to investigate and harness the capabilities of LLMs for enhancing causal analysis process.\n\n## Documentation and Tutorials\n\nFor detailed usage instructions and tutorials, refer to [Walkthrough Notebook](https://github.com/py-why/pywhyllm/blob/main/docs/notebooks/walkthrough.ipynb) and [Examples Notebook](https://github.com/py-why/pywhyllm/blob/main/docs/notebooks/examples.ipynb).\n\n## Installation\n\nTo install PyWhy-LLM, you can use pip:\n\n```bash\npip install pywhyllm\n```\n\n## Usage\n\nPyWhy-LLM seamlessly integrates into your existing causal inference process. Import the necessary classes and start exploring the power of LLM-augmented causal analysis.\n\n```python\nfrom pywhyllm.suggesters.model_suggester import ModelSuggester \nfrom pywhyllm.suggesters.identification_suggester import IdentificationSuggester\nfrom pywhyllm.suggesters.validation_suggester import ValidationSuggester\nfrom pywhyllm.suggesters.augmented_model_suggester import AugmentedModelSuggester\nfrom pywhyllm import RelationshipStrategy\n\n```\n\n\n### Modeler\n\n```python\n# Create instance of Modeler\nmodeler = ModelSuggester('gpt-4')\n\nall_factors = [\"smoking\", \"lung cancer\", \"exercise habits\", \"air pollution exposure\"]\ntreatment = \"smoking\"\noutcome = \"lung cancer\"\n\n# Suggest a list of domain expertises\ndomain_expertises = modeler.suggest_domain_expertises(all_factors)\n\n# Suggest a set of potential confounders\nsuggested_confounders = modeler.suggest_confounders(treatment, outcome, all_factors, domain_expertises)\n\n# Suggest pair-wise relationships between variables\nsuggested_dag = modeler.suggest_relationships(treatment, outcome, all_factors, domain_expertises, RelationshipStrategy.Pairwise)\n```\n\n### Retrieval Augmented Generation (RAG)-based Modeler\n\n```python\n# Create instance of Modeler\nmodeler = AugmentedModelSuggester('gpt-4')\n\ntreatment = \"smoking\"\noutcome = \"lung cancer\"\n\n# Suggest pair-wise relationship between two given variables, utilizing CauseNet for RAGing the LLM\nsuggested_relationship = modeler.suggest_relationships(treatment, outcome)\n```\n\n### Identifier\n\n\n```python\n# Create instance of Identifier\nidentifier = IdentificationSuggester('gpt-4')\n\n# Suggest a backdoor set, mediator set, and iv set\nsuggested_backdoor = identifier.suggest_backdoor(treatment, outcome, all_factors, domain_expertises)\nsuggested_mediators = identifier.suggest_mediators(treatment, outcome, all_factors, domain_expertises)\nsuggested_iv = identifier.suggest_ivs(treatment, outcome, all_factors, domain_expertises)\n\n```\n\n\n\n### Validator\n\n\n```python\n# Create instance of Validator\nvalidator = ValidationSuggester('gpt-4')\n\n# Suggest a critique of the edges in provided DAG\nsuggested_critiques_dag = validator.critique_graph(all_factors, suggested_dag, domain_expertises, RelationshipStrategy.Pairwise)\n\n# Suggest latent confounders\nsuggested_latent_confounders = validator.suggest_latent_confounders(treatment, outcome, all_factors, domain_expertises)\n\n# Suggest negative controls\nsuggested_negative_controls = validator.suggest_negative_controls(treatment, outcome, all_factors, domain_expertises)\n\n```\n\n## Contributors ✨\nThis project welcomes contributions and suggestions. For a guide to contributing and a list of all contributors, check out [CONTRIBUTING.md](https://github.com/py-why/pywhyllm/blob/main/CONTRIBUTING.md\u003e). Our contributor code of conduct is available [here](https://github.com/py-why/governance/blob/main/CODE-OF-CONDUCT.md\u003e).\n\nIf you encounter an issue or have a specific request for PyWhy-LLM, please [raise an issue](https://github.com/py-why/pywhyllm/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpy-why%2Fpywhyllm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpy-why%2Fpywhyllm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpy-why%2Fpywhyllm/lists"}