Python that lacks most of Python. Restricted program generation and execution for tool composition.
Project description
lackpy
Python that lacks most of Python. A micro-inferencer that translates natural language intent into sandboxed tool-composition programs.
What it does
$ lackpy -c "read file main.py and count its lines" --kit read_file,find_files
lackpy takes an intent, generates a restricted Python program using a local model you configure (any Ollama-served coder model), validates it against a strict AST whitelist, and runs it with traced tool calls. One MCP call replaces N tool round-trips.
Install
pip install lackpy # runtime + local/cloud model inference (via woollama)
pip install lackpy[full] # + all optional features (sandbox, mcp, blq, …)
pip install lackpy-lang # JUST the language (grammar/validator/grader/spec),
# no runtime — for tools that only reason about programs
Model inference is built in — calls route through woollama's core (a dependency), so local Ollama and cloud backends (Anthropic, OpenAI, …) all work without a per-vendor extra; cloud backends just need the relevant API key in your environment.
lackpy and lackpy-lang share the lackpy namespace (PEP 420);
neither ships a top-level lackpy/__init__.py, so import from submodules
(from lackpy.lang import validate, from lackpy.service import LackpyService).
Development (monorepo)
This repo builds two distributions. For a working editable checkout, install both —
lackpy pins lackpy-lang, which isn't on PyPI until its own tag, so install the local
copy first:
pip install -e ./packages/lackpy-lang -e ".[dev]"
Quick start
lackpyctl init --ollama-url http://localhost:11434 # writes .lackpy/config.toml
lackpy -c "find all python files" --kit read_file,find_files
lackpyctl init wires a local Ollama model into the inference order — pick the model
with --ollama-model (the choice is per-machine, not a package default). Without it,
only the deterministic templates/rules tiers run and compositional intents won't generate.
from lackpy.service import LackpyService
from lackpy.kit.toolbox import ToolSpec, ArgSpec
import asyncio
async def main():
svc = LackpyService()
result = await svc.delegate("read file README.md", kit=["read_file"])
print(result["output"])
asyncio.run(main())
Documentation
Full docs at lackpy.readthedocs.io:
Part of the Rigged Suite
lackpy is part of the Rigged developer tool suite but is independently installable.
License
MIT
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 lackpy-0.12.0.tar.gz.
File metadata
- Download URL: lackpy-0.12.0.tar.gz
- Upload date:
- Size: 533.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e09e8e025a02583cedce1425eae6b44d908a3b5967393d9bc65f0ba1eda769b
|
|
| MD5 |
3a430deb74967df0681afc2ed127837e
|
|
| BLAKE2b-256 |
fa5dfaedaa38d14e2da008c45ced70da46a69837a17d041cd506ab2bcaca0364
|
Provenance
The following attestation bundles were made for lackpy-0.12.0.tar.gz:
Publisher:
ci.yml on teaguesterling/lackpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lackpy-0.12.0.tar.gz -
Subject digest:
5e09e8e025a02583cedce1425eae6b44d908a3b5967393d9bc65f0ba1eda769b - Sigstore transparency entry: 1819072362
- Sigstore integration time:
-
Permalink:
teaguesterling/lackpy@fc04cf4b0247e1f76e85e216ca193e22967d490b -
Branch / Tag:
refs/tags/v0.12.0 - Owner: https://github.com/teaguesterling
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@fc04cf4b0247e1f76e85e216ca193e22967d490b -
Trigger Event:
push
-
Statement type:
File details
Details for the file lackpy-0.12.0-py3-none-any.whl.
File metadata
- Download URL: lackpy-0.12.0-py3-none-any.whl
- Upload date:
- Size: 159.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a5716295ea7d2b5987fc91f44be421b1b18b1578e95fa64fe39feeb1acb809b
|
|
| MD5 |
11a2c1b6a360f361361f2c825e83fa32
|
|
| BLAKE2b-256 |
ee2e2095c1958dd32a1d76947933cdebca74019d7000789a02f0ee9d1960e159
|
Provenance
The following attestation bundles were made for lackpy-0.12.0-py3-none-any.whl:
Publisher:
ci.yml on teaguesterling/lackpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lackpy-0.12.0-py3-none-any.whl -
Subject digest:
9a5716295ea7d2b5987fc91f44be421b1b18b1578e95fa64fe39feeb1acb809b - Sigstore transparency entry: 1819072546
- Sigstore integration time:
-
Permalink:
teaguesterling/lackpy@fc04cf4b0247e1f76e85e216ca193e22967d490b -
Branch / Tag:
refs/tags/v0.12.0 - Owner: https://github.com/teaguesterling
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@fc04cf4b0247e1f76e85e216ca193e22967d490b -
Trigger Event:
push
-
Statement type: