Skip to main content

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 fallbackretry the LLM, degrade to deterministic output, or flag for 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kerf-0.1.0.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kerf-0.1.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

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

Hashes for kerf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 09cc096a85e65fed377e47c35e5afb3f06e1f6fb4b5fdbd81b2958d0c98d1a18
MD5 9a4f2702c90b5ceeac3ab2331957ac61
BLAKE2b-256 3e0aa7e96780bd49dbb91c981b91d6c820025eea31221c5419a2ddde7ba86f9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for kerf-0.1.0.tar.gz:

Publisher: publish.yml on derek-yn-zhang/kerf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for kerf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d9d44d27afc21fd3da05da7cd245b342e29d06b21ad790791d13c91d481f313
MD5 18cf5ce115fb5d0d7537631410289884
BLAKE2b-256 20ce9ababa224d5917e9ec3fae2282b5ae7d2667d38ea08c84cc663e00745a12

See more details on using hashes here.

Provenance

The following attestation bundles were made for kerf-0.1.0-py3-none-any.whl:

Publisher: publish.yml on derek-yn-zhang/kerf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page