Explore the Core Python interface, data models, typed plugin contracts and command-line options. Each entry includes a source link or an example. This reference describes the v0.8.0 release, not unreleased main-branch changes.
Python API · from promptledger import PromptLedger. Examples use the initialized ledger from Getting started; label and evaluation examples assume their prerequisite records exist.
Append a prompt version with metadata. Newlines are normalized and content is hashed; identical latest content is a no-op. Returns created, prompt_id, version and content_hash. expected_base_version rejects stale edits. Secret detection is a warning, not a guarantee.
Python API · from promptledger import PromptLedger. Examples use the initialized ledger from Getting started; label and evaluation examples assume their prerequisite records exist.
Python API · from promptledger import PromptLedger. Examples use the initialized ledger from Getting started; label and evaluation examples assume their prerequisite records exist.
Guarded compare-and-set promotion. Requires an existing label at baseline, concrete positive versions, explicit suite/model and matching nonempty dataset hashes. Returns gate and promotion status; updates only when checks pass.
Python API · from promptledger import PromptLedger. Examples use the initialized ledger from Getting started; label and evaluation examples assume their prerequisite records exist.
Record numeric, finite evaluation metrics against a resolved concrete version; metadata must be JSON-compatible. This records evidence, not a model call.
Compare the latest matching baseline and candidate runs with a common suite and model. Returns metric deltas and missing metrics. Check dataset identity for meaningful comparisons.
EXAMPLE / SIGNATURE
PromptLedger.compare_evaluations(prompt_id: str, from_ref: int | str, to_ref: int | str, suite: str | None=None, model: str | None=None) -> EvaluationComparison
Public typed interfaces. Plugins are independently installed, trusted Python code; not sandboxed. The host resolves concrete versions and owns persistence.
Execute a declared capability after confirmation and activation checks. Options are a JSON object; data operations resolve prompt identity and refs; the host persists imported prompts or evaluations.
Exact usage and options generated from the v0.8.0 argparse definition. Run promptledger COMMAND --help for the same information. Commands may require an initialized workspace; provider operations require the appropriate package and configuration.
usage: promptledger list [-h] [--id PROMPT_ID] [--collection COLLECTION]
[--role {system,user,template,modelfile,eval}]
options:
-h, --help show this help message and exit
--id PROMPT_ID
--collection COLLECTION
--role {system,user,template,modelfile,eval}
usage: promptledger label [-h] {set,get,list,history} ...
positional arguments:
{set,get,list,history}
set Set a label to a version.
get Get a label version.
list List labels.
history Show label history.
options:
-h, --help show this help message and exit
usage: promptledger label set [-h] --id PROMPT_ID --version VERSION
--name LABEL
options:
-h, --help show this help message and exit
--id PROMPT_ID
--version VERSION
--name LABEL
usage: promptledger marker [-h] {set,remove,list,show} ...
positional arguments:
{set,remove,list,show}
set Attach a marker to a version.
remove Remove a marker from a version.
list List markers for a prompt.
show Show markers for a prompt version.
options:
-h, --help show this help message and exit
usage: promptledger marker set [-h] --id PROMPT_ID --version VERSION
--name {milestone,stable}
options:
-h, --help show this help message and exit
--id PROMPT_ID
--version VERSION
--name {milestone,stable}
usage: promptledger marker remove [-h] --id PROMPT_ID --version VERSION
--name {milestone,stable}
options:
-h, --help show this help message and exit
--id PROMPT_ID
--version VERSION
--name {milestone,stable}
usage: promptledger marker show [-h] --id PROMPT_ID --version VERSION
options:
-h, --help show this help message and exit
--id PROMPT_ID
--version VERSION
usage: promptledger eval [-h] {record,list,show,compare,gate,export} ...
positional arguments:
{record,list,show,compare,gate,export}
record Record an external evaluation run.
list List evaluation runs.
show Show one evaluation run.
compare Compare latest compatible runs.
gate Apply a regression gate policy.
export Export evaluation runs as JSONL.
options:
-h, --help show this help message and exit
usage: promptledger eval list [-h] [--id PROMPT_ID] [--ref REF]
[--suite SUITE] [--model MODEL] [--limit LIMIT]
options:
-h, --help show this help message and exit
--id PROMPT_ID
--ref REF
--suite SUITE
--model MODEL
--limit LIMIT
usage: promptledger eval export [-h] [--id PROMPT_ID] --format {jsonl}
--out OUT
options:
-h, --help show this help message and exit
--id PROMPT_ID
--format {jsonl}
--out OUT
usage: promptledger stable [-h] --id PROMPT_ID [--version VERSION]
options:
-h, --help show this help message and exit
--id PROMPT_ID
--version VERSION
usage: promptledger milestone [-h] --id PROMPT_ID [--version VERSION]
options:
-h, --help show this help message and exit
--id PROMPT_ID
--version VERSION
usage: promptledger dashboard [-h] [--host HOST] [--port PORT] [--no-open]
options:
-h, --help show this help message and exit
--host HOST
--port PORT
--no-open Do not open the dashboard in a browser automatically.
usage: promptledger integrations [-h]
{ollama-import,ollama-export,ollama-test,promptfoo-import,mlflow-import,mlflow-publish,hf-publish,artifact} ...
positional arguments:
{ollama-import,ollama-export,ollama-test,promptfoo-import,mlflow-import,mlflow-publish,hf-publish,artifact}
options:
-h, --help show this help message and exit
usage: promptledger integrations ollama-export [-h] --id ID --ref REF
--file FILE [--overwrite]
options:
-h, --help show this help message and exit
--id ID
--ref REF
--file FILE
--overwrite
usage: promptledger integrations ollama-test [-h] --id ID --ref REF
--model MODEL --expected EXPECTED
[--confirm]
options:
-h, --help show this help message and exit
--id ID
--ref REF
--model MODEL
--expected EXPECTED
--confirm
Import saved report metrics for a selected version.
EXAMPLE / SIGNATURE
usage: promptledger integrations promptfoo-import [-h] --id ID --ref REF
--file FILE [--model MODEL]
options:
-h, --help show this help message and exit
--id ID
--ref REF
--file FILE
--model MODEL
usage: promptledger integrations mlflow-import [-h] --id ID --uri URI
[--confirm]
options:
-h, --help show this help message and exit
--id ID
--uri URI
--confirm
Publish a selected text prompt to a configured registry.
EXAMPLE / SIGNATURE
usage: promptledger integrations mlflow-publish [-h] --id ID --ref REF
--name NAME [--confirm]
options:
-h, --help show this help message and exit
--id ID
--ref REF
--name NAME
--confirm
Publish an artifact to an existing private dataset.
EXAMPLE / SIGNATURE
usage: promptledger integrations hf-publish [-h] --id ID --ref REF --repo REPO
[--confirm]
options:
-h, --help show this help message and exit
--id ID
--ref REF
--repo REPO
--confirm
usage: promptledger plugins [-h]
{list,doctor,enable,disable,scaffold,info,validate,run,conformance} ...
positional arguments:
{list,doctor,enable,disable,scaffold,info,validate,run,conformance}
doctor Inspect installed entry points without executing
plugin code
scaffold Create a standalone typed plugin project
options:
-h, --help show this help message and exit
Load trusted provider code and display its manifest. Requires confirmation.
EXAMPLE / SIGNATURE
usage: promptledger plugins info [-h] [--confirm] name
positional arguments:
name
options:
-h, --help show this help message and exit
--confirm Allow trusted third-party Python code to execute
Load a trusted provider and check its manifest and interfaces. Requires confirmation.
EXAMPLE / SIGNATURE
usage: promptledger plugins validate [-h] [--confirm] name
positional arguments:
name
options:
-h, --help show this help message and exit
--confirm Allow trusted third-party Python code to execute
Execute a named capability with JSON options and explicit confirmation.
EXAMPLE / SIGNATURE
usage: promptledger plugins run [-h] [--confirm] [--options OPTIONS]
[--options-file OPTIONS_FILE]
name
{evaluate,export,healthcheck,import,publish}
positional arguments:
name
{evaluate,export,healthcheck,import,publish}
options:
-h, --help show this help message and exit
--confirm Allow trusted third-party Python code to execute
--options OPTIONS JSON object
--options-file OPTIONS_FILE
Read JSON options from a file instead
Check the loaded provider contract; this does not verify safety or runtime correctness.
EXAMPLE / SIGNATURE
usage: promptledger plugins conformance [-h] [--confirm] name
positional arguments:
name
options:
-h, --help show this help message and exit
--confirm Allow trusted third-party Python code to execute