thehallucinatedlab
The Hallucinated Lab toolkit — local-first tools you can call as ordinary Python methods.
Every tool runs on your machine. There is no API key, no account, no service to be up, and nothing is uploaded anywhere.
pip install thehallucinatedlab
Use it
from thehallucinatedlab import convert
result = convert("photo.jpg", format="png")
print(result.path, result.bytes)
Forgot what a tool takes? The argument reference lives on the website, generated from the same spec this package validates against — so the docs cannot describe an argument the code does not accept:
https://thehallucinatedlab.space/convert.html
Plain english works too
The same intent parser that powers the website's assistant ships in the package:
from thehallucinatedlab import parse
parse("convert it to webp at 80")
# {'tool': 'convert', 'args': {'format': 'webp', 'quality': 80}, 'missing': [], ...}
And from a shell:
thl tools # every tool and its arguments
thl convert photo.jpg --format webp -q 80
thl "convert photo.jpg to webp at 80"
Tools
convert
Convert an image between PNG, JPEG, WebP and AVIF.
| Argument | Accepts | Default | What it does |
|---|---|---|---|
format |
png | jpeg | webp | avif |
required | Target format. Aliases like jpg are accepted. |
quality |
int 1–100 | 92 |
Encoder quality. Ignored for PNG, which is lossless. |
background |
hex colour | #ffffff |
Fills transparency when the target has no alpha channel (JPEG). |
convert("logo.png", format="jpeg", quality=85, background="#000000")
convert(raw_bytes, "out.webp", format="webp") # bytes and file objects work too
Converting a transparent PNG to JPEG flattens it onto background rather than leaving black
where the transparency was. AVIF needs Pillow 11.3+ or pillow-avif-plugin; if your install
cannot encode a format, you get an UnsupportedFormat error rather than a file whose
extension lies about its contents.
Companion projects
NexusLink Engine is reachable through the same namespace once its binding is installed:
from thehallucinatedlab import nexuslink
if nexuslink.is_available():
...
It is built and released separately and is not yet on PyPI, so the import raises
NexusLinkNotInstalled with a pointer to the repository until it ships.
Errors
Everything deliberate inherits from THLError:
ToolNotFound · InvalidArgument · MissingArgument · UnsupportedFormat ·
NexusLinkNotInstalled
Licence
MIT.
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 thehallucinatedlab-0.2.0.tar.gz.
File metadata
- Download URL: thehallucinatedlab-0.2.0.tar.gz
- Upload date:
- Size: 72.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02d0011aa0fd2dacc76a8484c6328c2855410c259ea96414ce8c19895632b965
|
|
| MD5 |
bb9ff8a7f95ce8d642c6d6c8f9bce570
|
|
| BLAKE2b-256 |
2e63f7c53d09cdec4fa6ebf8b9ecb9cbe9752c10caffa4f0fff6be894ed311e8
|
Provenance
The following attestation bundles were made for thehallucinatedlab-0.2.0.tar.gz:
Publisher:
release.yml on The-Hallucinated-Lab/thehallucinatedlab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thehallucinatedlab-0.2.0.tar.gz -
Subject digest:
02d0011aa0fd2dacc76a8484c6328c2855410c259ea96414ce8c19895632b965 - Sigstore transparency entry: 2348329647
- Sigstore integration time:
-
Permalink:
The-Hallucinated-Lab/thehallucinatedlab@70cb2a9eaa656b6439667fd4ae503701ba993490 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/The-Hallucinated-Lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@70cb2a9eaa656b6439667fd4ae503701ba993490 -
Trigger Event:
push
-
Statement type:
File details
Details for the file thehallucinatedlab-0.2.0-py3-none-any.whl.
File metadata
- Download URL: thehallucinatedlab-0.2.0-py3-none-any.whl
- Upload date:
- Size: 62.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c33662034e282e37014c455a41f17392e49df2b2625252c4f4e2b865f1eb9d3
|
|
| MD5 |
5bc5f05573fdb6424939baccaf619c7d
|
|
| BLAKE2b-256 |
2b04b548e51dc55814cafd5c9a01a637951bfbba05d8df131387b5e2fae66d3f
|
Provenance
The following attestation bundles were made for thehallucinatedlab-0.2.0-py3-none-any.whl:
Publisher:
release.yml on The-Hallucinated-Lab/thehallucinatedlab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thehallucinatedlab-0.2.0-py3-none-any.whl -
Subject digest:
4c33662034e282e37014c455a41f17392e49df2b2625252c4f4e2b865f1eb9d3 - Sigstore transparency entry: 2348330469
- Sigstore integration time:
-
Permalink:
The-Hallucinated-Lab/thehallucinatedlab@70cb2a9eaa656b6439667fd4ae503701ba993490 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/The-Hallucinated-Lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@70cb2a9eaa656b6439667fd4ae503701ba993490 -
Trigger Event:
push
-
Statement type: