inspect4all
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).
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 libenrybuilds a platform-specific native library required by the wheel build. Directuv 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.
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)
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
- Create an API key in your OpenAI API account, and check that API billing and model access are enabled.
- Use a model identifier actually available to your API account, rather than an older example name.
- 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
-
User guide — installation and usage
-
Understanding outputs — JSON, HTML and provenance
-
Evaluation and limitations — dissertation findings
-
Troubleshooting — common errors
-
Complete original technical reference — architecture, CLI flags, internal EIDF/GitLab deployments and release procedures. Some internal instructions are retained for reference and are not the public installation path.
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
- User guide — Installation and usage.
- Output formats — JSON, HTML and provenance.
- Technical reference — Architecture, CLI and extension development.
- Evaluation — Study design and findings.
- Evaluation evidence — Detailed supporting evidence.
- Troubleshooting — Common problems.
- Legacy GitLab and EIDF deployment — Historical internal procedures.
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| inspect4all-0.1.0-py3-none-manylinux_2_34_x86_64.whl | Python 3 | none | Linux glibc 2.34+ x86-64 | Details for inspect4all-0.1.0-py3-none-manylinux_2_34_x86_64.whl |
| inspect4all-0.1.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for inspect4all-0.1.0-py3-none-macosx_11_0_arm64.whl |
Total release size: 7.9 MB
Release files / inspect4all-0.1.0-py3-none-manylinux_2_34_x86_64.whl
| Download URL | inspect4all-0.1.0-py3-none-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | Linux glibc 2.34+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
796bdf006194bf8175d3dcafb71a2130db04a112ad5247b64d5ac41a64f6d76d
|
|
BLAKE2b-256 checksum How to use checksums |
c05f23dd1c1c0ef35817bc7867ad5b95773db98509e1b08a0246a83dbd2e1d85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / inspect4all-0.1.0-py3-none-macosx_11_0_arm64.whl
| Download URL | inspect4all-0.1.0-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 |
40c680595082eb8df0d302b931f540946fe4ce1c6bdd6ad1c97876901de7519c
|
|
BLAKE2b-256 checksum How to use checksums |
7fc93ac7e494c3d50fb1674eb6a09f074b31168474a3bfc668f096df45275c3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.3
|
Security for inspect4all 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.