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.2.tar.gz (33.7 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.2-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kerf-0.1.2.tar.gz
  • Upload date:
  • Size: 33.7 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.2.tar.gz
Algorithm Hash digest
SHA256 521e49da829b7bd5d4868308a1b63f394c3d12afa1e7adff877a4d0b3fa2d41a
MD5 2bb1fe907d0f4163d6c6fd2fe1400daf
BLAKE2b-256 7e2155160ad80396ce0b862bf6089aefe26fe43ab1959039c318ded03131bbdc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: kerf-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e9e062a8a22778b4471deeddc8be004d695a0daf59098cfdb9550c3c05c9ab4d
MD5 5bb8c8cef5920000fb0b6c66eca27e33
BLAKE2b-256 17cf0bcd1267d65f91c213d296a14b33c0d506318144eb9223a315dd041abdc9

See more details on using hashes here.

Provenance

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