Skip to main content

inspect4all

Python 3.12+ BSD-3-Clause Work in progress

Inspect Python and Java code repositories, export structured metadata, and optionally enrich missing documentation using an LLM. The core inspection is entirely usable without an OpenAI API key. LLM enrichment is opt-in and needs an accessible model endpoint (for OpenAI, an API key and API credits).

Workflow overview

Features

  • Detect languages using go-enry, parse Python and Java, recover functions, methods, types, dependencies, calls and repository structure.
  • Export repository_analysis.json, optionally HTML and embedding-ready JSON.
  • Optionally generate missing function/method descriptions and backfill Java parse failures with LLMs, retaining the original analysis and provenance metadata.
  • Support mixed Python/Java repositories. Other language adapters and similarity reranking are future work, not current CLI features.

Install from GitHub (verified on macOS Apple Silicon)

Requirements: Git, Python 3.12+, uv, Go compiler, make and a C toolchain (CGo). On macOS you can install Go with Homebrew:

brew install go
curl -LsSf https://astral.sh/uv/install.sh | sh

On Ubuntu/Debian, install Git, Make, a C toolchain and a sufficiently recent Go compiler (distribution package versions vary). Then install uv as above. The Linux path is supported by the Makefile but has not yet been independently verified here. Native Windows installation is not yet documented.

Clone, build the native language detector, and install:

git clone https://github.com/SemanticRepoHub/inspect4all.git
cd inspect4all
make libenry
uv tool install --force .
inspect4all --help
inspect4all inspect --help
inspect4all enrich --help

The order matters: make libenry builds a platform-specific native library required by the wheel build. Direct uv tool install git+https://... is not yet the recommended method, because it does not run that native build step automatically. This exact clone/build/install procedure was verified on macOS Apple Silicon on 2 November 2026.

To update your installed source version:

cd /path/to/inspect4all
git pull --ff-only
make libenry
uv tool install --force .

Test 1: Inspect a repository (NO API key)

Bundled Python fixture:

inspect4all inspect --all -i examples/hello-world-python -o python_inspect
ls -lh python_inspect/

Bundled Java fixture:

inspect4all inspect --all -i examples/hello-world-java -o java_inspect

Any local repository:

inspect4all inspect --all -i /absolute/path/to/your/repository -o repo_inspect

You should see repository_analysis.json, repository_analysis.html, and embedding_export.json with --all. In a fresh GitHub source installation, a local d4py checkout was inspected successfully in approximately 4.713 seconds (one test, not a reproducible performance benchmark).

Real-world example — inspect and enrich StreamingFlow/d4py

Alongside the bundled Python and Java mini-examples, we provide a real, reproducible repository inspection using StreamingFlow/d4py, an open-source scientific-workflow codebase.

Real-world d4py inspection and optional LLM enrichment

Note: Example results may vary by repository revision, model, and configuration.

The diagram distinguishes static inspection (no API key) from optional LLM enrichment (a configured compatible model endpoint and credentials). The reported two successful enrichments come from the supplied d4py test output, not an assertion that every run produces identical text.

git clone https://github.com/StreamingFlow/d4py.git demo-d4py
inspect4all inspect --all -i demo-d4py -o d4py_inspect

This completed successfully on macOS Apple Silicon on 2 November 2026 and produced the JSON, HTML and embedding export outputs. Two functions were then enriched with gpt-5.6-luna using the optional LLM processor (two successes recorded in the cache):

inspect4all enrich -i d4py_inspect --max-records 2 --processors docstrings

See the complete real-world walkthrough and actual before/after metadata. An API key is not required for inspection; enrichment requires an authorised OpenAI-compatible LLM service and its credentials. The University of Edinburgh ELM gateway may be used if configured and authorised; a University key is not interchangeable with a direct OpenAI API key.

Test 2: Optional LLM enrichment (OpenAI API key required for OpenAI)

LLM enrichment

After Test 1, you can ask a configured LLM to enrich a small sample. Inspect4all can use an OpenAI-compatible API: this can be OpenAI's hosted API, or a compatible local model server. It does not automatically provide an OpenAI key or API credits. A ChatGPT subscription is separate from OpenAI API billing.

Option A — OpenAI

  1. Create an API key in your OpenAI API account, and check that API billing and model access are enabled.
  2. Use a model identifier actually available to your API account, rather than an older example name.
  3. Configure the endpoint and key. The following invisible-key prompt works in macOS zsh:
export INSPECT4ALL_LLM_BASE_URL="https://api.openai.com/v1"
export INSPECT4ALL_LLM_MODEL="YOUR_SUPPORTED_OPENAI_API_MODEL"
export INSPECT4ALL_LLM_MAX_TOKENS=4096
read -s "INSPECT4ALL_LLM_API_KEY?OpenAI API key: "
export INSPECT4ALL_LLM_API_KEY
echo

For bash replace the read -s line with read -r -s -p "OpenAI API key: " INSPECT4ALL_LLM_API_KEY.

Small, cost-limited example:

inspect4all enrich -i python_inspect --max-records 2 --processors docstrings
ls -lh python_inspect/

When eligible records are present and the LLM call succeeds, this writes repository_analysis.enriched.json and cache files without overwriting the original. The outputs contain model-derived documentation and provenance; descriptions need human review.

Java recovery, when applicable, uses --processors java-backfill. Run inspect4all enrich --help for all flags, including --docstring-target, --model, --reasoning-effort, and --max-records.

Option B — Local model, no OpenAI API key

If you run a compatible local endpoint (for example LM Studio), you can use:

export INSPECT4ALL_LLM_BASE_URL="http://localhost:1234/v1"
export INSPECT4ALL_LLM_API_KEY="lm-studio"
export INSPECT4ALL_LLM_MODEL="YOUR_LOADED_LOCAL_MODEL_ID"
inspect4all enrich -i python_inspect --max-records 2 --processors docstrings

The local model must already be running and support the necessary response format; compatibility and quality vary. No OpenAI account or OpenAI key is needed for this option.

Security and cost: LLM enrichment may transmit selected source-code snippets to the configured provider. Do not send private code without authorisation. Never commit actual API keys, .env files, or tokens. Don't put secrets directly in command arguments or URLs. Start with --max-records 2 to constrain API usage. When finished, run unset INSPECT4ALL_LLM_API_KEY.

Viewing output and understanding the schema

Inspect the real schema (rather than assuming example fields):

python3 -m json.tool python_inspect/repository_analysis.json | head -100

See the runnable examples and an explicitly illustrative enrichment example. Model-produced outputs can differ across models and runs.

Development and documentation

User documentation

Run local checks after make libenry:

uv sync
uv run pytest tests -q

Some live LLM smoke tests require credentials and can incur cost; they are not part of the documented offline example.

Limitations

Python and Java adapters are implemented; other languages may be detected but not structurally analysed. LLM-generated information is uncertain and optional. Fresh source installation requires a native build; one-command binary distribution and native Windows support are not yet documented as available.

Documentation

Licence

BSD-3-Clause, see LICENSE. See repository history and citation metadata for attribution; third-party example repository licences must also be respected.

Metadata

Release files for inspect4all 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for inspect4all 0.1.1
File Interpreter ABI Platform Actions
inspect4all-0.1.1-py3-none-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64, Linux glibc 2.5+ x86-64 Details for inspect4all-0.1.1-py3-none-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
inspect4all-0.1.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for inspect4all-0.1.1-py3-none-macosx_11_0_arm64.whl
inspect4all-0.1.1-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details for inspect4all-0.1.1-py3-none-macosx_10_9_x86_64.whl

Total release size: 10.9 MB

Release files / inspect4all-0.1.1-py3-none-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl

Download URL inspect4all-0.1.1-py3-none-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 4.9 MB
Tags Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
a349cfb166aca634ee3052de89a64af5dd757a411c3cf5edb747fd1f41499167
BLAKE2b-256 checksum
How to use checksums
42baa15792f4110aa9d2c4c0950cef3a5df7e088a28013fd84707f4acfb1494b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / inspect4all-0.1.1-py3-none-macosx_11_0_arm64.whl

Download URL inspect4all-0.1.1-py3-none-macosx_11_0_arm64.whl
Size 3.0 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b383d03b6f296dd421abf0e836c747de569e95ecc939c265593ed6da0321759c
BLAKE2b-256 checksum
How to use checksums
c516030d0d46f21bf799658c48270c027ef19b15f3e3cde9167bcada11f4f9bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / inspect4all-0.1.1-py3-none-macosx_10_9_x86_64.whl

Download URL inspect4all-0.1.1-py3-none-macosx_10_9_x86_64.whl
Size 3.0 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
4be95e828b2ceee46ea8707a16f93df007ddb1dc334f5d3e19900c49a914a484
BLAKE2b-256 checksum
How to use checksums
8fe46871587f450bd00800219b9795dd0b143cd346d7cfc0efcc0e9134a5a091
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for inspect4all 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for inspect4all-0.1.1-py3-none-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

3 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page