This guide gets a new llmff user from install to a working pipeline without
requiring provider credentials. It uses the deterministic mock backend first,
then shows the smallest real-backend configuration.
Use llmff when you want explicit, typed inference sub-pipelines that can be
inspected, versioned, run as a subprocess, and supervised from files. Do not use
it as an agent framework, model server, scheduler, memory system, or autonomous
planner. See docs/when-to-use-llmff.md for the
decision guide.
Install the latest tagged release with Cargo:
cargo install --git https://github.com/syndicalt/llmff --tag v1.1.0 llmffIf you downloaded a release archive instead, unpack it and put the llmff
binary on your PATH. Platform-specific release asset installation and
checksum verification are documented in
docs/github-release-installation.md.
Verify the binary:
llmff --version
llmff stages listExpected version:
llmff 1.1.0
Clone the repository, then run the JSON repair example:
git clone https://github.com/syndicalt/llmff.git
cd llmff
LLMFF_MOCK_BAD_RESPONSE='{"wrong":true}' \
LLMFF_MOCK_GOOD_RESPONSE='{"answer":"ok"}' \
llmff run examples/json-repair.yaml --trace /tmp/llmff-trace.jsonlThe run writes:
examples/answer.json
Confirm the output:
cat examples/answer.jsonExpected output:
{"answer":"ok"}The example intentionally asks one mock model for invalid JSON, validates it
against examples/answer.schema.json, repairs it with a second mock model, and
writes the repaired object.
Use inspect when editing a pipeline. It validates references, stage
requirements, type compatibility that can be proven statically, and backend
availability without calling model servers.
llmff inspect examples/json-repair.yamlExpected output:
ok
For agents, dashboards, and CI jobs that need a machine-readable preflight, use the JSON inspect report:
llmff inspect examples/json-repair.yaml --format jsonThe report includes the manifest hash, resolved inputs and outputs, execution stage order, model/backend aliases, per-stage capability constraints, plugin directories, stdout ownership, artifact paths, checkpoint/resume intent, and the requested default execution controls.
Inline graphs are useful for shell workflows and quick experiments:
LLMFF_MOCK_GOOD_RESPONSE='{"answer":"ok"}' \
llmff run -i examples/question.txt \
-g 'load | infer(model=mock:good) | write(-)'Expected output:
{"answer":"ok"}llmff v1.1 adds op: loop for bounded refinement, retry, and agent-style
sub-pipelines. Loops always require max_iterations, an explicit break_on
condition, and a body DAG.
Inspect the self-refining answer loop before running it:
llmff inspect examples/loops/self-refining-answer-loop.yaml --format jsonRun it with the mock backend and write a trace:
LLMFF_MOCK_GOOD_RESPONSE='{"answer":"Use llmff for bounded, inspectable LLM pipelines.","confidence":0.93}' \
llmff run examples/loops/self-refining-answer-loop.yaml \
--trace /tmp/llmff-self-refining-answer.trace.jsonlThe loop writes:
examples/loops/self-refining-answer.output.json
Inspect the trace summary:
llmff trace /tmp/llmff-self-refining-answer.trace.jsonlLoop body records include loop_id, loop_iteration, and loop_stage_id, so
supervisors can explain which iteration produced each body-stage event.
More loop patterns are documented in
examples/loops/README.md.
Register an OpenAI-compatible backend explicitly:
export OPENAI_API_KEY='...'
llmff run examples/json-repair.yaml \
--backend openai=https://api.openai.com/v1 \
--api-key-env openai=OPENAI_API_KEYManifests reference that backend with model ids such as:
model: openai:gpt-4.1-miniFor a local Ollama server:
llmff run pipeline.yaml \
--ollama ollama=http://localhost:11434Then use model ids such as:
model: ollama:llama3.1The --trace file is JSONL. Summarize it with:
llmff trace /tmp/llmff-trace.jsonlTrace output reports run status, stage status, durations, safe model metadata, validation errors, cache hits, and token usage when a backend reports it. It does not include full prompts, tool bodies, headers, cached values, or secrets.
llmff: command not found: confirm Cargo's bin directory is onPATH. Cargo usually installs to$HOME/.cargo/bin.mock backend does not serve model: set the matching mock response variable for the model id in the manifest.mock:goodusesLLMFF_MOCK_GOOD_RESPONSE;mock:badusesLLMFF_MOCK_BAD_RESPONSE.backend alias is not registered: pass--backend alias=urlor--ollama alias=url, and make sure the manifest model id uses the same alias before the first colon.missing API key environment variable: export the secret and pass--api-key-env alias=ENV_NAME.- Windows and macOS release installers are unsigned in
v1.1.0; expect normal OS trust prompts until paid signing and notarization are added.
- See
examples/README.mdfor the example catalog. - See
examples/loops/README.mdfor bounded loop examples introduced in v1.1. - See
docs/cookbook.mdfor workflow patterns routed to existing offline examples. - See
docs/provider-troubleshooting.mdfor OpenAI-compatible and Ollama setup notes. - See
README.mdfor the CLI reference and stage semantics. - See
docs/platform-support.mdfor release artifacts and installer assumptions. - See
docs/github-release-installation.mdfor direct GitHub Release installation.