› cavi-ai/
GitHub ↗

Command line

Run python3 scripts/mlx-agent from the repository root. The provider-neutral core covers the seven host capabilities and additional model lifecycle commands.

Use --help at any level for current arguments, choices, and defaults:

bash
python3 scripts/mlx-agent --help
python3 scripts/mlx-agent serve start --help
python3 scripts/mlx-agent intake fetch --help

Discovery and configuration#

CommandPurpose
inspect-hostInspect host memory and runtime inventory.
discoverRank candidates using metadata and fit estimates.
adopt start/resume/statusRetain verification and recommendation state.
researchWrite a domain research pack; --no-write renders only.
blueprintWrite a project design pack; --no-write renders only.
labManage retained experiments, studies, datasets, and training through the optional engine.
bench run/aggregateMeasure an already-served model or aggregate exports.
wire render/apply/status/rollbackRender and manage configuration transactions.
fleet render/applyRender or apply per-role LiteLLM routing configuration.

Model lifecycle#

CommandPurpose
intake resolveClassify a Hugging Face source against backend registries.
intake fetch/statusReview/download a model source; inspect job receipts.
intake port-analysis/port-planInspect architecture facts or draft guidance with a local model.
backend list/install/removeInspect or manage optional dependencies.
convert scanInventory GGUF files and candidate duplicates without deletion.
convert start/statusQuantize local checkpoints; inspect conversion jobs.
convert transcribe/decide/generate/speak/music/describe/videoExecute supported local inference tasks.
serve start/status/stopLaunch and inspect receipt-owned local servers.
serve unload/policyRelease JIT workers or replace an owned gateway's memory policy.
lora start/statusTrain an adapter on a cached base and local dataset.
fuse start/statusMerge an adapter into standalone weights.
doctor modelsInspect model inventory, config drift, and endpoint health.
watch snapshot/diffRetain and compare owned-model Hub state.

Provider lifecycle#

providers lists detected hosts. install, update, uninstall, and doctor <provider> manage adapters in user or project scope. Installer previews use --dry-run --json; confirmed changes require the returned hash. Provider Doctor inspects state without requiring confirmation.

Output and exit status#

Most commands support --json with the versioned result envelope: schema_version, operation, status, data, warnings, and generated_at. Errors add an error object with code, message, remediation, and retryable.

Exit 0 indicates a successful command. Several mutation previews exit 2 with status: "ok" and data.requires_confirmation: true; failures also exit 2 but have status: "error". Argument-parser errors exit 2 and may not emit a JSON envelope. Inspect the result rather than treating every exit 2 as the same condition.

Preview typeHash location with --json
Provider install/update/uninstall, Wire apply, Fleet applydata.preview.preview_hash
Serve start, Intake fetch, backend install/remove, Convert/LoRA/Fuse start, model prunedata.plan.preview_hash
Wire rollbackdata.preview.preview_hash

Repeat the same arguments with --confirm --preview-hash <hash>. Rollback needs its own preview. Job starts return before work finishes; inspect the relevant status and log before consuming outputs.

State and receipts#

Discovery accepts --state-dir or MLX_AGENT_STATE_DIR. Adoption uses --state; Watch uses --state-dir. Keep paths consistent across runs.

Wire defaults to .mlx-agent-receipts beside its target. Serve and model jobs use .mlx-agent-receipts/<kind> under the current directory, or under the base selected by --receipts-dir. Provider installers have separate user/project receipt storage. See Security.

Configuration rollback restores receipt backups. Downloads, training, conversion, inference, server policy, and cache pruning have different lifecycle semantics; a receipt does not make every operation reversible.