Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

3.2. Flags

Global flags

FlagDefaultCommandsDescription
--model-path PATH(none)allPath to GGUF file (required)
--dtype FLOAT32|FLOAT16|INT8FLOAT16cluster, localActivation wire format
--byteOrder BE|LEBEclusterActivation byte order. Must match across all JVMs; propagated automatically by ClusterHarness and juno-deploy.sh.
--max-tokens N200cluster, local, loraMaximum tokens per response. Same default as the REST API and SamplingParams.defaults().
--temperature F0.7allSampling temperature (0.0 = deterministic)
--top-k N50allTop-K sampling cutoff (0 = disabled)
--top-p F0.9allNucleus sampling cutoff (0 = disabled). Same default as the REST API and SamplingParams.defaults().
--heap SIZE4gallJVM heap per node, for example 4g, 8g
--nodes N3localNumber of in-process shards
--pType pipeline|tensorpipelinecluster, testParallelism type
--jfr DURATION(none)cluster, local, loraJava Flight Recording, for example 30s, 5m
--verbose / -v(none)cluster, local, loraFull logging; LoRA default is a progress bar
--cpu(none)cluster, localForce CPU inference: sets JUNO_USE_GPU=false. Does not enable LoRA mode.
--lora-play PATH(none)cluster, localApply a pre-trained .lora adapter at inference (read-only, no training). In cluster mode the file is forwarded as -Djuno.lora.play.path to every forked node JVM.
--api-port N(none)cluster, localStart the OpenAI-compatible REST API server on port N alongside the REPL. Exposes POST /v1/chat/completions, GET /v1/models, GET /v1/models/{model}. Environment override: API_PORT.

LoRA-specific flags (lora command only)

FlagDefaultDescription
--lora-path PATH<model>.loraAdapter checkpoint (auto-loaded if it exists)
--lora-rank N8Low-rank bottleneck dimension
--lora-alpha Fequal to rankDeclared alpha (standard scale = alpha/rank; rsLoRA = alpha/sqrt(rank))
--lora-modeloralora or dora
--lora-scalingstandardstandard or rslora
--lora-initkaiming-uniformkaiming-uniform or legacy-normal
--lora-lr F1e-4Peak / base AdamW learning rate
--lora-max-iters N50Max training passes per /train, /train-qa, or /train-file-qa (safety cap)
--lora-loss-target-text F1.8Stop /train when loss is at or below F
--lora-loss-target-qa F1.2Stop /train-qa / /train-file-qa when loss is at or below F
--lora-steps N(none)Alias for --lora-max-iters (/train cap)
--lora-steps-qa N50Max passes for /train-qa / /train-file-qa
--lora-early-stop F0.25Overfit guard: stop when loss is below F (set 0 to disable)
--lora-targets SPECqvqv, all / all-linear, or comma-separated keys (wq,wk,wv,wo,wgate,wup,wdown)
--lora-gradient-accumulation N1Chunks accumulated per optimizer update (token-weighted)
--lora-max-grad-norm F1.0Global L2 clip after token normalization; 0 disables clipping
--lora-lr-schedule Mconstantconstant or cosine (warmup then cosine decay)
--lora-warmup-steps N0Warmup optimizer updates for the cosine schedule
--lora-min-lr F0Cosine floor learning rate
--lora-weight-decay F0.01Decoupled AdamW decay on A only
--lora-plus-ratio F1.0B/A learning-rate ratio (1.0 is ordinary LoRA)
--lora-dropout F0Train-only inverted dropout on the LoRA branch input
--lora-seed N42Seed for init, validation split, dropout masks, and corpus caps
--lora-validation-split F0Fraction of units held out (0 disables)
--lora-validation-patience N0Validation checks without improvement before stop
--lora-validation-min-delta F0Minimum validation improvement to reset patience
--lora-chunk-tokens N32Truncated-BPTT window size; use 128 for large /train-file runs
--lora-max-train-tokens N0Cap on supervised prediction tokens per train (0 is unlimited); seeded whole-chunk subsample

merge-specific flags

FlagDefaultDescription
--model-path PATH(none)Source GGUF or llamafile (required)
--lora-path PATH<model>.loraTrained adapter checkpoint
--output PATH<model>-merged.ggufOutput file (always plain GGUF, even if source is a llamafile)
--heap SIZE4gJVM heap; use at least 2x the model file size

Environment variable overrides

MODEL_PATH, JUNO_USE_GPU, PTYPE, DTYPE, BYTE_ORDER, MAX_TOKENS, TEMPERATURE, TOP_K, TOP_P, HEAP, NODES, JAVA_HOME, LORA_PATH, LORA_RANK, LORA_ALPHA, LORA_LR, LORA_MAX_ITERS, LORA_LOSS_TARGET_TEXT, LORA_LOSS_TARGET_QA, LORA_STEPS (alias), LORA_PLAY_PATH, LORA_TARGETS, LORA_GRADIENT_ACCUMULATION, LORA_MAX_GRAD_NORM, LORA_CHUNK_TOKENS, LORA_MAX_TRAIN_TOKENS, LORA_TRAIN_DEVICE, LORA_MICROBATCH, API_PORT.

GPU backend selection for LoRA

For the lora command and ForwardPassHandlerLoader.selectLoraBackend(), an unset JUNO_USE_GPU means Juno tries GPU (CUDA first, then ROCm) when available. Set JUNO_USE_GPU=false or pass --cpu to force CPU under --lora-train-device=auto (the default). Use --lora-train-device=gpu to fail closed when CUDA/ROCm is unavailable, or --lora-train-device=cpu to force CPU MatVec for LoRA regardless of --gpu.

With GPU LoRA, the default --lora-microbatch 8 (LORA_MICROBATCH) uses FP32 resident GEMM for frozen linears; set 1 for sequential GEMV / FP16 residency, or let VRAM out-of-memory auto-retry drop to 1. Phi-3.5 on roughly 8 GB cards should use --lora-microbatch 1 rather than JAVA_TOOL_OPTIONS=-Djuno.lora.microbatch=1.

Cluster and local modes use selectBackend(), where unset defaults to CPU for safety. Override the vendor with -Djuno.gpu.backend=cuda|rocm|auto (default: auto).

See also


<- 3.1 Commands  |  Table of Contents  |  3.3 Local Mode ->