Declarative workflow engine where the LLM is a pluggable, disposable step
Project description
Kerf
Declarative workflow engine for Claude CLI
Kerf runs deterministic tools first, calls the LLM only when you need reasoning, and logs every result. Pipelines are defined as JSON — no Python required to configure a workflow.
- Deterministic-first — preprocessing runs without the LLM until you actually need it
- JSON workflows — define tool chains, prompt templates, and fallback policies as config
- Per-workflow fallback —
retrythe LLM, degrade todeterministicoutput, orflagfor review - Full execution logging — every run gets a UUID-stamped log you can audit and learn from
- Auto-discovered tools — drop a Python file in
tools/, it gets picked up
Install
uv tool install kerf
Requires Python 3.10+ and Claude CLI (claude login).
Quick Start
kerf init
Kerf project initialized.
kerf run summarize "Kerf is a workflow engine that wraps Claude CLI..."
{
"summary": "Kerf is a declarative workflow engine that wraps Claude CLI for structured, deterministic text processing."
}
A workflow is a JSON file in workflows/:
{
"task_type": "summarization",
"tool_chain": [{ "tool": "normalize_text", "condition": "always_true" }],
"fallback": "retry"
}
tool_chain runs deterministic preprocessing. task_type sends the result to Claude. fallback controls what happens when the LLM fails.
Custom tools go in tools/ as Python files with a register(manager) function:
# tools/uppercase.py
def uppercase(input_data, params):
return input_data.upper()
def register(manager):
manager.register_tool("uppercase", uppercase)
Documentation
Full docs at derek-yn-zhang.github.io/kerf.
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 kerf-0.1.0.tar.gz.
File metadata
- Download URL: kerf-0.1.0.tar.gz
- Upload date:
- Size: 32.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09cc096a85e65fed377e47c35e5afb3f06e1f6fb4b5fdbd81b2958d0c98d1a18
|
|
| MD5 |
9a4f2702c90b5ceeac3ab2331957ac61
|
|
| BLAKE2b-256 |
3e0aa7e96780bd49dbb91c981b91d6c820025eea31221c5419a2ddde7ba86f9d
|
Provenance
The following attestation bundles were made for kerf-0.1.0.tar.gz:
Publisher:
publish.yml on derek-yn-zhang/kerf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kerf-0.1.0.tar.gz -
Subject digest:
09cc096a85e65fed377e47c35e5afb3f06e1f6fb4b5fdbd81b2958d0c98d1a18 - Sigstore transparency entry: 1025431377
- Sigstore integration time:
-
Permalink:
derek-yn-zhang/kerf@4d45900ecd43baaa7a5857d2e5ba6dae43cee64a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/derek-yn-zhang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4d45900ecd43baaa7a5857d2e5ba6dae43cee64a -
Trigger Event:
push
-
Statement type:
File details
Details for the file kerf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kerf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d9d44d27afc21fd3da05da7cd245b342e29d06b21ad790791d13c91d481f313
|
|
| MD5 |
18cf5ce115fb5d0d7537631410289884
|
|
| BLAKE2b-256 |
20ce9ababa224d5917e9ec3fae2282b5ae7d2667d38ea08c84cc663e00745a12
|
Provenance
The following attestation bundles were made for kerf-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on derek-yn-zhang/kerf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kerf-0.1.0-py3-none-any.whl -
Subject digest:
3d9d44d27afc21fd3da05da7cd245b342e29d06b21ad790791d13c91d481f313 - Sigstore transparency entry: 1025431425
- Sigstore integration time:
-
Permalink:
derek-yn-zhang/kerf@4d45900ecd43baaa7a5857d2e5ba6dae43cee64a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/derek-yn-zhang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4d45900ecd43baaa7a5857d2e5ba6dae43cee64a -
Trigger Event:
push
-
Statement type: