Skip to content

Latest commit

 

History

9,017 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyAutoFit: Scientific Inference with Natural Language

Project Status: Active Python Versions PyPI Version Colab Tests Build Documentation Status JOSS

AI Assistant | Documentation | Installation Guide | Introduction on Colab | HowToFit

PyAutoFit is designed so scientists can bring their models, data and likelihood code, then fit models, explore results and develop analyses using natural language with an AI coding agent.

Getting Started

PyAutoFit and the autofit_assistant allow one to perform scientific inference using purely natural language. Simply open your AI coding agent (codex or Claude Code are recommended) and input the following prompt:

Example Natural Language Prompt for Claude Code, Codex or other AI coding agent

I want to perform scientific inference with PyAutoFit (https://github.com/PyAutoLabs/PyAutoFit) and the
autofit_assistant (https://github.com/PyAutoLabs/autofit_assistant).

Begin the "start here" guide for a new user.

PyAutoFit is designed to be used entirely through natural language — the natural-language inference page walks through this, including its AI First Design.

Bring Your Own Likelihood (BYOL)

Already have a likelihood function for your science problem? Point the assistant at your existing code and it can set it up with PyAutoFit — defining the model, choosing priors with you, configuring a search and organising the results:

Example Natural Language Prompt for Claude Code, Codex or other AI coding agent

Set up PyAutoFit with my existing science project. An example likelihood function can be found at
[GitHub link or local directory].

First, give me an overview of my project and likelihood function. Compose an appropriate model, explain it to me,
and recommend a non-linear search (for example MCMC, nested sampling or maximum-likelihood estimation).

Do not begin inference until we have discussed the setup and I give you the go-ahead.

Once inference is running, explain how the results are written to disk and show me how to inspect and interpret
them with PyAutoFit.

The assistant answers this prompt with its BYOL mode — bring your own likelihood, the assistant brings the inference. It reads your code and restates what your likelihood scores, composes a model with priors chosen with you, wraps and validates your function unchanged, recommends a search, and runs nothing until you say go.

Your existing science code remains the source of the likelihood. With PyAutoFit built around it, you can perform inference through natural language while gaining access to features such as flexible priors and model composition, MCMC and nested sampling, automated result handling, model comparison and scalable workflows.

What is PyAutoFit?

PyAutoFit is a domain-agnostic Python package for scientific model fitting and Bayesian inference. It supports nested sampling, MCMC and optimisation, alongside advanced methods such as hierarchical models, search chaining and Bayesian model comparison.

autofit_assistant connects natural-language requests to runnable PyAutoFit workflows. Ask it to compose a model, discuss priors, run inference or compare competing explanations. You guide the science; it writes and runs Python scripts you can inspect, rerun and share.

Human Readable Documentation

HowToFit

For users less familiar with Bayesian inference and scientific analysis you may wish to read through the HowToFit lectures. These teach you the basic principles of Bayesian inference, with the content pitched at undergraduate level and above.

The lectures are available in the standalone HowToFit repository.

Use the Jupyter notebooks if you want to run the code (recommended), or read the available Markdown lectures directly on GitHub.

For help alongside the lectures, open the autofit_assistant repository in your AI coding agent, following its setup instructions, and paste:

Enter HowToFit mode.

I want to work through the HowToFit lectures. Show me where to find them
and how to use Jupyter Notebook or Markdown, then help me with questions
as I go.

The assistant will answer questions about concepts, equations, code and results as you study, and help with notebook errors. Share the lecture link and section or the cell you are working on; you choose when to move on.

Support

Support for installation issues, help with Fit modeling and using PyAutoFit is available by raising an issue on the GitHub issues page.

We also offer support on the PyAutoFit Slack channel, where we also provide the latest updates on PyAutoFit. Slack is invitation-only, so if you'd like to join send an email requesting an invite.

Releases

Packages

Used by

Contributors

Languages