Skip to main content

gfg-adr-detection

A packaged, importable build of ADR Detection from uber/ADR, maintained by Global Fashion Group for internal use and published so it can be installed with pip rather than cloned.

Not affiliated with or endorsed by Uber. This is a modified redistribution under the Apache License 2.0; the original copyright and LICENSE are retained. For the upstream project, its paper and its benchmark, go to github.com/uber/ADR.

⚠️ Not a general-purpose library

ADR Detection is a research artifact. Several of its dependencies are pinned to exact versions for benchmark reproducibility and carry known CVEs, which upstream documents and accepts under an isolated threat model. Run it in a container, VM or dedicated host — not alongside your application.

It is also unusually heavy: the dependency closure includes torch, transformers and the LangChain stack, and its hard == pins will conflict with most other packages. Install it into a dedicated virtualenv.

What this package changes

Upstream resolves its runtime data relative to __file__, three directories up — which is the source tree in a checkout, and site-packages once installed. The practical effect was that an installed copy discovered zero MCP context providers and silently degraded from two detection tiers to one, with no error. This build fixes that and the related path assumptions:

  • context providers resolve from inside the package (ADR_CONTEXT_PROVIDERS_DIR overrides; the original layout is still honoured for source checkouts)
  • the reasoning workspace is relocatable via ADR_WORKSPACE_ROOT, instead of being created inside site-packages
  • MCP servers launch with sys.executable rather than uv run, which resolved an unrelated environment when installed as a wheel
  • the import package is adr_guardrail, not guardrail, which PyPI already assigns to an unrelated project
  • the dependency axios is dropped — it is a JavaScript library, and the PyPI project of that name is unrelated to it and to ADR
  • the 16 MB benchmark corpus is not shipped, so the source-code context provider is disabled by default (enable_source_code: false)

Install

python -m venv .venv && .venv/bin/pip install gfg-adr-detection

Requires Python 3.10–3.12.

Use

from adr_guardrail.adr_agent.adr_baseline import ADRBaseline

detector = ADRBaseline(config_data=config, benchmark_type="adr_bench")
verdict = detector.analyze_conversation(messages).to_dict()

config is the parsed config_detector.yaml structure documented upstream. The high-precision tier shells out to the Claude CLI, which refuses to run as root — so give the container an unprivileged user.

Licence

Apache-2.0, as the original. See LICENSE.

Release files for gfg-adr-detection 0.1.0

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

Source distribution (sdist)

Source distribution for gfg-adr-detection 0.1.0
File Size Uploaded
gfg_adr_detection-0.1.0.tar.gz 59.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gfg-adr-detection 0.1.0
File Interpreter ABI Platform
gfg_adr_detection-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 135.0 kB

Release files / gfg_adr_detection-0.1.0.tar.gz

Download URL gfg_adr_detection-0.1.0.tar.gz
Size 59.9 kB
Tags Source
SHA-256 checksum
How to use checksums
999fe30325a557c6335f53870edf1d5935453dbf1d624968cc1526b1667afd36
BLAKE2b-256 checksum
How to use checksums
3f78d3dfdc62b49b93a3ab30af36a8eff98fb1c200a9789cc510f41f73a8b102
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / gfg_adr_detection-0.1.0-py3-none-any.whl

Download URL gfg_adr_detection-0.1.0-py3-none-any.whl
Size 75.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c95c18dbaa29f3e3c57163111283a5db51988b00d4be91674cae891a985cc78
BLAKE2b-256 checksum
How to use checksums
2db378b41341f5a5dae8b6570bf70cb5a5e07a7dbab9070a424e448cde895ad6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

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