Standalone three-line LLM streaming-halt guard — model-free, zero dependencies
Project description
Director-AI Lite
director-ai-lite is a standalone, dependency-free LLM streaming-halt guard:
it stops a token stream before a hallucination finishes generating. It installs
with zero heavy dependencies (standard library only) and does not require the
full director-ai package.
pip install director-ai-lite
from director_ai_lite import guard
result = guard(
token_stream,
facts={"capital": "Paris is the capital of France."},
prompt="What is the capital of France?",
)
print(result.output) # surviving text (halted tokens removed)
print(result.halted) # True if the stream was stopped
print(result.halt_reason) # why it was stopped
How it works
The default path is model-free: each accumulated prefix is scored by a
grounding heuristic (content-word overlap against the supplied facts) and the
same calibrated coherence combination the full package uses in its no-model path.
The stream hard-halts on the first token whose coherence drops below threshold
(default 0.5). With no facts, scoring stays neutral and nothing is halted.
Because the grounding heuristic and the coherence calibration match the full package, you can upgrade to model-backed (NLI/RAG) scoring without changing the call site.
Upgrade to model-backed scoring
pip install "director-ai-lite[full]"
Then pass the full package's scorer to StreamGuard:
from director_ai_lite import StreamGuard
guard = StreamGuard(facts=..., scorer=my_nli_scorer) # any review(prompt, text) scorer
Tiers
Director-Lite is the free, standalone entry point. The wider product ladder:
| Tier | What it is |
|---|---|
| Director-Lite | Free. This package — standalone, model-free streaming halt, zero dependencies. |
| Director-AI | The full runtime — model-backed NLI/RAG scoring, REST/gRPC server, framework integrations, sealed evidence packets, tamper-evident audit. |
| Director-AI Pro | Production-tier licence and support on top of the full runtime. |
| Director-AI Full | The complete advanced + labs capability set. |
| Director-Class AI | Enterprise: managed/on-prem deployment, domain tuning, evidence reviews, SLA, procurement support. |
Support development
Director-Lite is free forever, including in production. If it helps you, you can sponsor development via GitHub Sponsors — entirely optional, and it keeps the free tier moving.
License
Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file director_ai_lite-3.16.0.tar.gz.
File metadata
- Download URL: director_ai_lite-3.16.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2f0859df28469bdff611038cb1679c72fe1ac57b8d23d3144de676721d51896
|
|
| MD5 |
57dc39e02e400ecea1697fefa13edc8b
|
|
| BLAKE2b-256 |
cd0bedbf60120a2f4ac7fb74c1caa5feda9a4bb947a8331685e6aeb2324d5837
|
Provenance
The following attestation bundles were made for director_ai_lite-3.16.0.tar.gz:
Publisher:
publish-lite.yml on anulum/director-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
director_ai_lite-3.16.0.tar.gz -
Subject digest:
d2f0859df28469bdff611038cb1679c72fe1ac57b8d23d3144de676721d51896 - Sigstore transparency entry: 1899192109
- Sigstore integration time:
-
Permalink:
anulum/director-ai@8904072a254678cb2637823928156cb45dc32320 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/anulum
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-lite.yml@8904072a254678cb2637823928156cb45dc32320 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file director_ai_lite-3.16.0-py3-none-any.whl.
File metadata
- Download URL: director_ai_lite-3.16.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9975d7c0b5165fbc2616ce81b8f6f64ef55ef15156ce3b7b8c6c8b2171e853dd
|
|
| MD5 |
5d2ec7d15c7c87c9dc744326776a7cf0
|
|
| BLAKE2b-256 |
e6b501edcd1aa4b664753228618823ae4dc1ceb0439ee231ee8941e913c6f479
|
Provenance
The following attestation bundles were made for director_ai_lite-3.16.0-py3-none-any.whl:
Publisher:
publish-lite.yml on anulum/director-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
director_ai_lite-3.16.0-py3-none-any.whl -
Subject digest:
9975d7c0b5165fbc2616ce81b8f6f64ef55ef15156ce3b7b8c6c8b2171e853dd - Sigstore transparency entry: 1899192199
- Sigstore integration time:
-
Permalink:
anulum/director-ai@8904072a254678cb2637823928156cb45dc32320 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/anulum
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-lite.yml@8904072a254678cb2637823928156cb45dc32320 -
Trigger Event:
workflow_dispatch
-
Statement type: