CLI Reference

Every stage of the lucid command.

Every stage is available under the lucid command. Run lucid <command> --help for full flag details.

Automated pipeline

lucid run

Runs the full workflow automatically: model inspection, prompt rendering, activation capture, direction analysis, auto-basis selection, preflight check, search, verification, and baking/patching.

lucid run <model> -o <output> [options]

Key flags:

FlagDefaultDescription
-o, --outNoneOutput path for the baked checkpoint directory or patched GGUF
--ggufNoneOptional GGUF used for fast capture/search while baking into <model>
--backendautoauto, llama_cpp, vllm, or hf_torch (auto uses llama_cpp for GGUF, vllm on CUDA when installed, else hf_torch)
--budgetbalancedfast (20 trials), balanced (45), or thorough (80)
--taskrefusalBuilt-in behavior preset: refusal, noslop, nosyco, or concise
--datasetmrfakename/harmHugging Face dataset ID for default prompts
--include-cnfalseAdd the China-sensitive topic arm and enable reframe detection
--promptsNoneLocal directory with capture.jsonl and eval JSONLs
--bad / --goodNonePlain-text files (one prompt per line) for custom behaviors
--interactivefalsePause after search to inspect Pareto trials, live-chat, and pick a trial
--load-in-4bitfalseLoad PyTorch models in 4-bit NF4 via bitsandbytes during capture/search
--batch-size0Batch size for hf_torch (0 = auto-probe max VRAM batch size)
--tp0Tensor parallel size for vllm (0 = all visible CUDA GPUs)
--gpu-memory-utilization0.90GPU memory utilization fraction for vllm
--winsorize0.001Activation winsorization quantile before computing directions (0 disables)
--configNoneOptional TOML/JSON/YAML config override
--no-manage-serverfalseConnect to an already-running llama-server at --server-url
--tensor-splitNoneMulti-GPU layer split string (-ts) for llama.cpp
--llama-argsNoneExtra flags forwarded to llama-ablate-capture and llama-server
--skip-preflightfalseBypass pre-search LoRA routing check
--no-bakefalseStop after producing edit.npz
--push-to-hubNoneUpload the baked checkpoint and model card to a Hugging Face repo ID
--privatefalseCreate the destination Hub repo as private
--revisionNoneOptional source Hugging Face Hub branch/tag/commit

Hugging Face Jobs (lucid hf-job)

Run full abliteration remotely on Hugging Face Jobs from a source Hub model to a destination Hub repo:

lucid hf-job <source_model> <dest_repo> [options]

Subcommands:

  • lucid hf-job run <source_model> <dest_repo> (also works without typing run) - Submit a remote GPU job that downloads <source_model>, runs Lucid end-to-end, bakes the weights, and pushes to <dest_repo>.
    • Key flags: --flavor (default a100-large), --timeout (default 4h), --budget, --task, --include-cn, --load-in-4bit, --batch-size, --winsorize, --private, --namespace, --lucid-source, --follow, --dry-run, --emit-script <path.py>.
  • lucid hf-job flavors - List recommended HF Jobs GPU flavors and VRAM tiers.
  • lucid hf-job status <job_id> - Inspect job status and stage.
  • lucid hf-job logs <job_id> [--follow] - Fetch or stream job logs.
  • lucid hf-job cancel <job_id> - Cancel an active or queued job.

Discovery and setup

  • lucid presets - List built-in model architecture presets.
  • lucid tasks - List built-in behavior task presets (refusal, noslop, nosyco, concise).
  • lucid inspect <path> [--write-config lucid.toml] - Inspect a GGUF or safetensors checkpoint and optionally emit a starter config.
  • lucid prompts <config> --src <dir> --out <dir> [--model-source <path>] - Render capture and eval JSONLs with the model's chat template.
  • lucid chat <work_dir> [--trial base|N] [--mode chat|think] [--server-url ...] - Interactive terminal chat against the base model or a chosen 0-indexed search trial.

llama.cpp build and graph helpers

  • lucid audit-lcpp <src/models/arch.cpp> - Static check for pre-FFN capture hooks and raw ggml_mul_mat writers that would bypass LoRA adapters.
  • lucid patch-lcpp <llama.cpp_root> --arch <arch> [--dry-run] - Apply built-in declarative capture/LoRA graph patches idempotently.
  • lucid export-cpp <dest_dir> - Copy the bundled ablate-capture.cpp and CMakeLists.txt source files.
  • lucid plan-split <gguf_dir> <n_gpu> [--cap-gib 79.2] - Compute an even per-GPU -ts layer split from GGUF header sizes.
  • lucid capture <config> --model <path> --prompts <capture.jsonl> --out <acts.f32> [--backend llama_cpp|hf_torch] [--load-in-4bit] [--batch-size 0]
  • lucid directions <acts.f32> <capture.jsonl> <dirs.npz> [--n-embd N] [--method diff_means|trimmed_mean|whitened|pca] [--winsorize 0.001]
  • lucid basis <dirs.npz> <spec> - Inspect singular spectrum energy for a basis spec (or auto).
  • lucid adapters <config> --gguf <dir> --dirs <dirs.npz> --out <adapters_dir> [--spec ...]
  • lucid preflight <config> --adapters <dir> --data <dir> - Verify each component's LoRA adapters shift logits on llama-server.
  • lucid search <config> --adapters <dir> --data <dir> --out <search_dir> [--warm-start prev_trials.jsonl]
  • lucid pareto <trials.jsonl> [--kl-budget 0.15] - Print the Pareto frontier and recommended knee trial.
  • lucid verify <config> --data <dir> --out <verify.json> [--trial base|N] [--artifact] (--trial is 0-indexed, matching trials.jsonl)
  • lucid audit-judge <verify.json> [--config <config>] - Breakdown of which markers fired where plus unflagged openings.

Editing, baking, and reporting

  • lucid make-edit <config> --dirs <dirs.npz> --trials <trials.jsonl> --trial <N> --adapters <dir> --out <edit.npz> (--trial is 0-indexed, matching the trial field in trials.jsonl and lucid pareto)
  • lucid bake [--config <config>] --model-dir <dir> --edit <edit.npz> [--shards-only] [--only-shards s1,s2]
  • lucid patch-gguf <shard.gguf> <edit.npz> [-o <out.gguf>] [--config <config>] [--libggml <dir>]
  • lucid merge-lora <gguf_dir> <edit.npz> <out.gguf> [--config <config>] [--arch <arch>]
  • lucid report <config> --edit <edit.npz> --trials <trials.jsonl> --base <v_base.json> --edited <v_edited.json> --out-dir <dir>

Remote GPU control

  • lucid agent [--host 127.0.0.1] [--port 7777] [--work-dir /work] [--token ...]
  • lucid remote <profile> <exec|bg|jobs|kill|get|put|log> ...

Edit this page on GitHub