lackpy¶
Python that lacks most of Python. lackpy is a micro-inferencer that turns natural language intent into restricted Python programs, validates them against a safe AST subset, and runs them with full execution tracing.
Why lackpy?¶
- Zero-dependency core. The validator, grader, runner, and trace are pure Python stdlib — no inference dependency is required to validate or run programs.
- AST-first security. Every program is checked at the AST level before any byte of code runs. Imports, class definitions,
whileloops,try/except, and dozens of other constructs are structurally impossible, not just discouraged. - Plugin-based tools. Tools are resolved through provider plugins. The built-in provider covers filesystem primitives; the
pythonprovider wraps any importable function; and you can register your own provider in five lines of code. - Untrusted model output is safe by design. Programs generated by an LLM are validated against the same AST rules as hand-written programs. A hallucinated
import osoropen()call is rejected before execution. - The ratchet pattern. Validated programs can be saved as templates with intent patterns. On future requests, the template tier matches first — no inference needed, zero latency, guaranteed valid.
Quick start — CLI¶
# Initialize a workspace
lackpy init
# Generate and run a program from natural language
lackpy delegate "read the file README.md" --kit read_file,find_files
# Just generate — don't run
lackpy generate "find all Python files" --kit find_files
# Validate a hand-written program
lackpy validate my_program.py --kit read_file,find_files
Quick start — Python API¶
import asyncio
from lackpy import LackpyService
async def main():
svc = LackpyService()
# Generate and run in one call
result = await svc.delegate(
intent="read the file pyproject.toml",
kit=["read_file"],
)
print(result["output"])
print(result["trace"]) # every tool call recorded
asyncio.run(main())
Rigged Suite¶
The "rigged suite" is the property that lackpy's inference pipeline can be made deterministic for any intent that has been seen before. Save a validated program as a template:
On the next delegate call with a matching intent, the template tier fires at tier 0 — before any LLM is consulted. The program is guaranteed valid because it was validated when it was saved.
Next steps¶
- Getting Started — install, initialize, first commands
- Tutorial — step-by-step walkthrough of every feature
- Concepts: Architecture — how the pipeline works
- Python API Reference — full API docs
- CLI Reference — every command