Pipelines
Kompile uses one unified pipeline contract for VLM, OCR, LLM, embedding, reranking, graph-extraction, and custom processing steps. The harness owns runtime startup, model loading, process reuse, cancellation, and cleanup — you describe what you want in chat (or validate existing definitions with kompile pipeline), without hand-writing large pipeline JSON files.
Managing pipelines through the harness
Ask the agent in plain English to inspect capabilities, test a pipeline on sample data, save a versioned definition, run it on documents, or roll back a version:
"Show me the available pipeline step catalog and templates, then test a two-step chat pipeline that extracts key facts and summarizes
./report.pdf. Once it looks good, save it asdocument-pipelineand promote it."
Behind the scenes, the agent manages immutable pipeline versions under data/pipelines/unified/<pipelineId>/ via the pipeline tool:
| Lifecycle Action | What It Does |
|---|---|
capabilities | Returns the live step catalog, provider-neutral templates, and input/output contracts |
validate / test | Validates a definition or runs a read-only test on sample text/PDF without saving |
create / update | Saves a new immutable version (with optimistic expectedActiveVersion checks) |
run / status / cancel | Executes a saved pipeline asynchronously, tracks status, or cancels an active run |
promote / rollback | Atomically switches the active-version pointer without overwriting prior versions |
list / get | Lists managed definitions alongside active registrations in kompile.project.json (each tagged with its registrySource) |
Local artifact-backed runs share the same pooled runtime: you supply pipeline definitions, model bindings, and input data — never raw worker ports, subprocess flags, or classpaths. If a model binding points to an existing localPath on disk, Kompile consumes it in place without staging or mutating kompile.project.json. Failed tests or runs return a structured diagnostic with run ID, failure stage, exception chain, and bounded stack trace.
Composed pipeline steps
Pipelines compose compatible catalog steps as either a SequencePipeline (steps run in order) or a GraphPipeline (directed graph of nodes with explicit upstream inputs and pipeline_input / outputNodeName boundaries):
text-model-text: Built-in sequence template taking text input through one caller-bound local language model.vision-multimodel: Built-in graph template starting withimage_preprocess, feeding independently boundvisionEncoder,textEmbedding, anddecodermodel roles, and finishing with token decoding.VLM_DOCUMENT: Convenience end-to-end PDF adapter for scanned/image-heavy PDFs (application/pdfinput; renders pages locally for VLM OCR).
Built-in templates use abstract role names, never hardcoded models or providers — you bind your chosen models at runtime. In graphs, a node with one predecessor receives its upstream record directly; multiple predecessors merge in declaration order unless explicit inputDataBindings map specific slots (node.outputKey, node, or pipeline_input[.key]). Loop nodes merge inputs into loop state and update named feedbackKeys on each iteration.
Native chat compositions
You can compose multi-stage text, image, or PDF workflows using your configured Kompile chat providers (CHAT_MODEL stages) — with no local tensor model required:
"Build a two-stage
CHAT_MODELsequence pipeline where stage 1 extracts key facts and stage 2 summarizes them faithfully, and test it on this document."
Key rules for host chat compositions:
- Supports 1–100
CHAT_MODELstages in a sequence (step0,step1, …) or acyclic graph (loops, disconnected stages, and mixed tensor/chat runners are rejected). - Multiple upstream stages join text in declared input order; intermediate outputs are text.
- Original inputs can be text, an image, or a PDF — a later stage that needs the original image or PDF references
pipeline_inputdirectly (file paths never come from model-generated text). - Every stage is preflighted before inference; credentials are always resolved from your host chat configuration and never stored in pipeline definitions.
- Project
source=chat/remotemodel aliases resolve to their exact descriptors (never silently reinterpreted as local artifact paths).
Acquiring, converting & optimizing local models
Model provisioning is cleanly separated from pipeline definitions. Ask the agent in chat — it uses model_runtime behind the scenes:
- Check status & acquire models: "Check local model runtime status and bootstrap the vision encoder, text embedding, and decoder models for this project." (
status,bootstrap, orimportfrom a local directory or configured repository). - Convert local weights to
.sdz: "Convertmodels/raw.onnxtomodels/model.sdz." Supports ONNX, TensorFlow/Keras, GGUF/GGML, and SafeTensors via Kompile's standalone staging worker. - Optimize a
.sdzartifact: "Optimizemodels/model.sdzwith theBASICprofile (dead_code_elimination,algebraic, up to 3 iterations) and keep a backup." Supportsprofile,selectedPasses,maxIterations,quantizationType,dryRun, andcreateBackup. - Register or point directly at a local VLM: Ask the agent to register reusable VLM metadata via
vlm_model_definition, or reference an existing directory on disk directly vialocalPathfor a self-contained run that leaves project manifests untouched.
Model selection follows a strict precedence: modelBindings.default → modelId → vlmModel (legacy alias) → modelSetId (conflicting values are rejected). model_runtime status reports artifactReady separately from runtimeStatus so file presence is never mistaken for verified runtime initialization.
Validating definitions from the CLI
For scripts, CI, or quick offline inspection, the CLI provides direct validation and step listing:
kompile pipeline validate --file=pipeline.json
kompile pipeline list-steps --verboseRelated guides
- Walkthrough: Crawling PDFs & Querying Knowledge Graphs — End-to-end local and remote PDF OCR & graph workflows
- Ingestion Pipeline — How crawl jobs route documents through loading, chunking, graph extraction, and indexing
- Local Models &
local-runtime— Downloading, converting, and running local models