sbi
AGENTS.md876 starsChanged 3 months agoApache-2.0View on GitHub
Shared guidance for coding agents working in this repository. Run validation commands through uv run; activating the virtual environment is optional. See docs/contributing.md for the full development workflow and pyproject.toml for the authoritative tool configuration. Start with checks targeted to the files and behavior you changed, then broaden as appropriate: Tests live in *_test.py files. Available markers include slow, gpu, mcmc, and benchmark; their definitions are in pyproject.toml. - Use Google-style docstrings. - Put shared public type aliases in sbi/sbi_types.py.…
- Installs packages
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Run validation commands through uv run.
- Distinctive: line 18
Start with checks targeted to the files and behavior you changed, then broaden as appropriate:
- Very specific: line 36
Put shared public type aliases in sbi/sbi_types.py.
- Very specific: line 37
Keep string identifiers for estimators lowercase (for example, "maf", "nsf", and "mdn").
- Distinctive: line 39
Add or update tests when behavior changes.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — sbi
Shared guidance for coding agents working in this repository.
Setup
uv venv --python 3.12
uv pip install -e ".[dev]"Run validation commands through uv run; activating the virtual environment is
optional. See docs/contributing.md for the full development workflow and
pyproject.toml for the authoritative tool configuration.
Validation
Start with checks targeted to the files and behavior you changed, then broaden as appropriate:
uv run pytest tests/path_to_relevant_test.py
uv run pytest -n auto -m "not slow and not gpu"
uv run ruff check <changed Python paths>
uv run ruff format --check <changed Python paths>
uv run pyright sbi
uv run pre-commit run --files <changed files>Tests live in *_test.py files. Available markers include slow, gpu, mcmc, and
benchmark; their definitions are in pyproject.toml.
Code conventions
- Use Google-style docstrings.
- Put shared public type aliases in
sbi/sbi_types.py. - Keep string identifiers for estimators lowercase (for example,
"maf","nsf", and"mdn"). - Add or update tests when behavior changes.
- Preserve unrelated local changes. If a checkout is already in use, work in a separate Git worktree.
Code map
Inspect the current code rather than relying on a duplicated class inventory:
sbi/inference/__init__.py— public inference methodssbi/inference/trainers/— training workflowssbi/inference/posteriors/— posterior implementationssbi/inference/potentials/— estimator-to-sampler bridgessbi/neural_nets/estimators/— estimator contracts and implementationssbi/samplers/— sampling backends
The documentation is built from docs/. Its curated docs/llms.txt index is served
at https://sbi.readthedocs.io/en/latest/llms.txt for tools that support it.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

