Model Staging
A model lifecycle service that handles the path from raw HuggingFace weights to production-ready deployment. Runs as a REST API on port 8090 with its own Angular UI, or as a CLI tool. For lightweight CLI-first local model serving and the local-runtime companion overlay, see Local Models & local-runtime.
The staging pipeline
Models pass through managed states:
DOWNLOADING -> CONVERTING -> VALIDATING -> READY -> PROMOTING -> COMPLETEDFailed models land in .staging/failed/ with diagnostics.
# Download from HuggingFace
kompile-model-staging download \
--source=huggingface \
--repo=BAAI/bge-base-en-v1.5 \
--format=onnx
# Convert: ONNX, TensorFlow, GGUF/GGML -> SameDiff (sharded .sdnb)
kompile-model-staging convert --input=model.onnx --output=model.sdz
# List registered models
kompile-model-staging list
# Promote a staged model to production
kompile-model-staging promote <modelId>After promotion, the staging service sends an HTTP callback to the running kompile-server telling it to hot-swap the model in memory. No server restart needed.
Local LLM inference
The staging service includes a full inference engine. Load a converted model and query it from any OpenAI client:
curl http://localhost:8090/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "qwen3-0.6b", "messages": [{"role": "user", "content": "Hello"}]}'Supports streaming, speculative decoding, prompt templates, text processing pipelines, and generation cancellation.
Training, fine-tuning, alignment & abliteration
All training and model-editing workflows are backed by TrainingSubprocessMain and AbliterationService with JSONL dataset management, SSE log/metric streaming, and deployable artifact manifests:
- Full fine-tuning & 8 PEFT methods: LoRA, QLoRA (4-bit base /
ggml_qmatmul_lora), AdaLoRA, DyLoRA, DoRA, IA³, Prompt Tuning, and Prefix Tuning, plus adapter weight merging. - Knowledge distillation: Logit Knowledge Distillation (
LOGIT_KD) with temperature-scaled KL divergence. - Post-training alignment: RLHF, DPO, KTO, ORPO, PPO, and GRPO.
- Training-free abliteration (
POST /api/abliteration/apply): Computes or accepts refusal directions (RefusalDirectionFinder) with optional Winsorization and orthogonalizes matching weights (WeightOrthogonalizer) directly in SameDiff without a training loop.
Graph compiler & 23-pass optimizer
SameDiff's 23-pass GraphOptimizer (cleanup, constant folding, algebraic simplification, attention/RMSNorm/SwiGLU/horizontal-MatMul/linear fusion, rematerialization, and INT8/UINT8/FP16/BF16 quantization) plus Triton GPU compilation, graph/quantization comparison benchmarks, and async compilation jobs.
90+ MCP tools (SSE) & inline model_runtime
Model Staging exposes over 90 staging_* MCP tools over SSE (ModelStagingTool) covering registry management, conversion, optimization, Triton compilation, training, PEFT, distillation, alignment, evaluation, LLM/VLM execution, and pipelines. For server-free folder-local import, conversion, and graph optimization directly inside kompile chat, use the inline model_runtime MCP tool.
See Model Import, Optimization, Fine-Tuning & Abliteration for the complete pass catalog, PEFT/alignment/abliteration reference, and inline harness examples.
Kompile Archives (.karch)
Versioned bundles of pre-converted models for redistribution and offline installation. Each archive contains a manifest with checksums, compatibility ranges, and model metadata.
kompile-model-staging archive export --output=models-v1.karch
kompile-model-staging archive import --input=models-v1.karchRemote catalogs at GitHub Releases and kompile.ai are checked every 24 hours for updates.