calm.pipeline — Lilush API

←index

← calm

Overview

CALM pipeline utilities. Shared helpers for tool scripts and builtins: path resolution, default templates/stop-conditions, and model size presets.

Functions

NameSignature
resolve_pathsresolve_paths() -> paths
ensure_calm_dirensure_calm_dir() -> ok, err
active_model_pathactive_model_path() -> path
set_active_modelset_active_model(target) -> path, err
size_name_from_configsize_name_from_config(d_model, n_layers) -> name

resolve_paths() -> paths

Resolve standard CALM file paths under $HOME/.local/share/lilush/calm/

ensure_calm_dir() -> ok, err

Ensure the CALM data directory exists (recursive mkdir)

active_model_path() -> path

Resolve the active CALM model path

Returns $LILUSH_CALM_MODEL if set and non-empty, otherwise the default active-model symlink ~/.local/share/lilush/calm/active.cwgt. Used by both the calm builtin and LEM prose completion.

set_active_model(target) -> path, err

Switch the active model by repointing the active.cwgt symlink

target is a model name (resolved to <calm_dir>/<target>.cwgt) or a path containing / (used directly). Repoints <calm_dir>/active.cwgt to it. Refuses if active.cwgt exists as a regular file (not a symlink), so a user-placed real model is never clobbered. Returns the resolved target path.

size_name_from_config(d_model, n_layers) -> name

Look up a model size name from d_model and n_layers