Skip to main content

Declarative workflow engine where the LLM is a pluggable, disposable step

Project description

Kerf
Declarative workflow engine for Claude CLI

PyPI Python License


Kerf runs deterministic tools first, calls the LLM only when you need reasoning, and logs every result. Workflows are configured as JSON, custom tools are Python.

  • 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: retry 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)

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.1.tar.gz (33.1 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.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file kerf-0.1.1.tar.gz.

File metadata

  • Download URL: kerf-0.1.1.tar.gz
  • Upload date:
  • Size: 33.1 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.1.tar.gz
Algorithm Hash digest
SHA256 ef7afd8afcaf020c269a9014ae91bdec85da3e6317741e7894ee4e57a255ca87
MD5 95d418667271534493114464743c139f
BLAKE2b-256 e2b579a72d15aa452c17c4976eeb4f6726f546c94955b601a9c1b4ecc08f57f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for kerf-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: kerf-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe366be7136e2c1e445a7305a938af66a47e4a8e9d58329b913cd892941de1b4
MD5 80278a6d13e543e0d9ed220ad1baaac8
BLAKE2b-256 ea69f2a9bcce10afd860e4a76fa8e6c9667d3bad8936b4d2e6cbae4144174ff2

See more details on using hashes here.

Provenance

The following attestation bundles were made for kerf-0.1.1-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