Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MakazhanAlpamys/Soup
/ functions
Functions
20,206 in github.com/MakazhanAlpamys/Soup
⨍
Functions
20,206
◇
Types & classes
3,423
↳
Endpoints
121
↓ 504 callers
Function
load_config_from_string
Parse a YAML string and return validated SoupConfig. Unlike load_config(), raises ValueError on errors instead of SystemExit, making it suita
src/soup_cli/config/loader.py:35
↓ 443 callers
Method
print
(self, msg)
tests/test_v07200.py:2117
↓ 322 callers
Method
get
(self, idx: int, name: str)
src/soup_cli/utils/layer_stream_runtime.py:360
↓ 285 callers
Method
get
(self, entry_id: str)
src/soup_cli/registry/store.py:311
↓ 187 callers
Method
get
(self, eid)
tests/test_v0713.py:508
↓ 147 callers
Method
resolve
(self, eid)
tests/test_v0713.py:505
↓ 131 callers
Function
is_under_cwd
Whether ``path`` is inside the current working directory.
src/soup_cli/utils/paths.py:38
↓ 105 callers
Function
enforce_under_cwd_and_no_symlink
Apply cwd containment + ``os.lstat + S_ISLNK`` rejection (TOCTOU defence). Shared helper for v0.53.1 export / merge / advanced-GGUF dispatch.
src/soup_cli/utils/paths.py:43
↓ 101 callers
Method
to
(self, _device)
tests/test_v07116.py:58
↓ 97 callers
Function
create_app
Create the Soup Web UI FastAPI application.
src/soup_cli/ui/app.py:76
↓ 93 callers
Function
format_to_messages
Convert any format to normalized structure for training. Returns: - SFT formats: {"messages": [{"role": ..., "content": ...}, ...]} - Vis
src/soup_cli/data/formats.py:80
↓ 88 callers
Method
update
(self, n=1)
src/soup_cli/trainer/sft.py:1603
↓ 85 callers
Method
search
Case-insensitive search across name, base_model, task, notes. User query is parameterised AND ``%`` / ``_`` wildcards are escaped so
src/soup_cli/registry/store.py:371
↓ 84 callers
Method
from_pretrained
(*a, **kw)
tests/test_v07133.py:89
↓ 84 callers
Method
json
(self)
tests/test_v0716.py:1578
↓ 83 callers
Method
keys
(self)
src/soup_cli/trainer/mlx_routing.py:35
↓ 79 callers
Method
add
Append a (key, value, label) triple. Enforces dim + size caps.
src/soup_cli/utils/grace_codebook.py:157
↓ 69 callers
Method
encode
(row: dict)
src/soup_cli/trainer/asr.py:281
↓ 66 callers
Method
train
(self, mode=True)
tests/test_v07116.py:227
↓ 65 callers
Method
is_available
(self)
tests/test_v0533.py:384
↓ 62 callers
Function
atomic_write_text
Atomically write ``text`` to ``output_path`` under cwd containment. Pipeline: ``enforce_under_cwd_and_no_symlink`` -> ``mkstemp`` in the pare
src/soup_cli/utils/paths.py:86
↓ 62 callers
Function
shard_checkpoint
Rewrite an HF checkpoint into per-layer safetensors shards. ``quant='nf4'`` quantises every per-layer key named in ``quant_suffixes`` (short
src/soup_cli/utils/layer_shard.py:528
↓ 62 callers
Method
values
(self)
tests/test_peft_patches.py:128
↓ 60 callers
Method
push
Create a new registry entry. Returns the new entry's id.
src/soup_cli/registry/store.py:252
↓ 56 callers
Method
save_pretrained
(self, path)
tests/test_code_review_high.py:419
↓ 54 callers
Function
_chat_row
(*turns)
tests/test_v07127.py:212
↓ 53 callers
Method
eval
(self)
tests/test_v07115.py:124
↓ 51 callers
Function
get_recipe
Get a recipe by name. Returns None if not found.
src/soup_cli/recipes/catalog.py:24
↓ 51 callers
Method
run
()
tests/test_v07202.py:1886
↓ 49 callers
Function
build_task_win
Build a leg-1 ``TaskWin``. ``won`` is the STRICT inequality tuned > base. With a ``noise_floor``, the margin must also clear what the instrument
src/soup_cli/utils/ship_verdict.py:287
↓ 49 callers
Function
looks_like_refusal
Heuristic refusal detector with multilingual dispatch. By default scans for English refusal phrasings (v0.56.0 back-compat surface). Pass ``l
src/soup_cli/utils/diagnose/refusal.py:194
↓ 49 callers
Method
parameters
(self)
tests/test_v0534.py:386
↓ 46 callers
Function
detect_format
Auto-detect dataset format from first few rows.
src/soup_cli/data/formats.py:42
↓ 44 callers
Function
load_raw_data
Load raw data from a file into list of dicts.
src/soup_cli/data/loader.py:25
↓ 44 callers
Method
start_run
Insert a new run and return its run_id.
src/soup_cli/experiment/tracker.py:162
↓ 43 callers
Function
run_soup
Run soup CLI as a subprocess and return CompletedProcess.
tests/test_cli_subprocess.py:30
↓ 41 callers
Method
close
(self)
src/soup_cli/registry/store.py:237
↓ 41 callers
Function
get_profile
Return the profile for ``name`` (case-insensitive).
src/soup_cli/utils/deploy_autopilot.py:161
↓ 41 callers
Function
init_local_rl_db
Atomically create the local-RL SQLite schema. Idempotent.
src/soup_cli/utils/local_rl.py:249
↓ 41 callers
Function
resolve_trust_remote_code
Decide whether to pass ``trust_remote_code=True`` to HF loaders. Args: model_name: HF repo id or local path. requested: ``True``
src/soup_cli/utils/trust_remote.py:88
↓ 40 callers
Method
decode
(self, _tokens, skip_special_tokens=True)
tests/test_v0536.py:423
↓ 40 callers
Function
model_requires_trust_remote_code
Best-effort local probe of ``config.json`` for ``auto_map``. Returns: True if config has ``auto_map`` (HF custom-code marker). Fa
src/soup_cli/utils/trust_remote.py:59
↓ 39 callers
Function
_set_nested_param
Set a nested parameter in a config dict using dot notation. Supports keys like: lr, lora.r, training.epochs, etc. Maps common short names to
src/soup_cli/commands/sweep.py:266
↓ 37 callers
Function
_load
(yaml_text)
tests/test_v07200.py:751
↓ 37 callers
Function
_stream_yaml
Minimal valid streaming config; `training` overlays the training block.
tests/test_v07200.py:728
↓ 37 callers
Function
_torch_or_skip
()
tests/test_v0532.py:256
↓ 37 callers
Function
score_bundled_suite
Score suite ``name`` for one model, returning an absolute ``[0, 1]``. MCQ / arithmetic suites route through the (fixed) ``ForgettingDetector``
src/soup_cli/eval/gate_suites.py:421
↓ 36 callers
Function
decide_ship
Fuse leg 1 + leg 2 into a single SHIP / DON'T-SHIP verdict. ``decide_ship`` is the SINGLE source of truth for the threshold: it recomputes ea
src/soup_cli/utils/ship_verdict.py:357
↓ 34 callers
Function
compute_benchmark_deltas
Turn two ``{benchmark: score}`` maps into sorted ``BenchmarkDelta``s. Only benchmarks present in BOTH maps are compared (a one-sided benchmark
src/soup_cli/utils/ship_verdict.py:311
↓ 33 callers
Method
close
Close the database connection.
src/soup_cli/experiment/tracker.py:419
↓ 33 callers
Function
model_size_from_name
Model size in billions: exact for a local checkpoint, else guessed. A LOCAL path is measured, not guessed — `soup merge` writes directories l
src/soup_cli/utils/gpu.py:192
↓ 32 callers
Function
_create_app
Create the FastAPI application with OpenAI-compatible endpoints. Args: auth_token: optional Bearer-token gate for the v0.53.7 tool
src/soup_cli/commands/serve.py:1520
↓ 31 callers
Function
create_branch
Snapshot a training environment as an immutable branch pointer. The config file is hashed (SHA-256) and the dataset file (if provided) is has
src/soup_cli/utils/adapter_branch.py:119
↓ 31 callers
Function
parse_lr_groups
Parse + validate the raw schema value. Accepts: - ``None`` → returns None (feature off). - List of dicts ``[{pattern: str, lr: float}, ..
src/soup_cli/utils/lr_groups.py:41
↓ 31 callers
Method
resolve
Resolve a reference (id, prefix, name:tag, or registry://id) to an id. Returns ``None`` on miss. Raises :class:`AmbiguousRefError` when a
src/soup_cli/registry/store.py:403
↓ 30 callers
Function
_locate_decoder_layers
Return the decoder-layer ``ModuleList`` for a supported model. Supports the Llama-family ``model.model.layers`` and the GPT-2-family ``model.
src/soup_cli/utils/edit_kernels.py:109
↓ 30 callers
Function
score_uncertainty
Compute uncertainty from K reward-model scores (``1 <= K <= 32``). - K=1: max-entropy distance from 0.5 (peak at 0.5 -> uncertainty 1.0) - K=
src/soup_cli/utils/active_sampler.py:112
↓ 28 callers
Method
on_step_end
(self, args: Any, state: Any, control: Any = None, **kwargs: Any)
src/soup_cli/utils/lisa.py:128
↓ 28 callers
Function
resolve_device_map
``device_map`` for ``from_pretrained``, correct under a distributed launch. ``device_map="auto"`` shards one model across every visible GPU. Unde
src/soup_cli/utils/gpu.py:63
↓ 28 callers
Method
setup
Load Whisper + processor, encode the dataset, build Seq2SeqTrainer.
src/soup_cli/trainer/asr.py:183
↓ 27 callers
Function
_make_config
Create a minimal SoupConfig for testing.
tests/test_trainer_init.py:6
↓ 27 callers
Method
add_callback
(self, callback)
src/soup_cli/trainer/embedding.py:514
↓ 27 callers
Function
build_edit_plan
Resolve + validate an edit request into an :class:`EditPlan`. Validates every operator-supplied field at construction time so misconfigured e
src/soup_cli/utils/knowledge_edit.py:221
↓ 27 callers
Function
build_raft_prompt
Compose a RAFT row into ``(prompt, answer, golden_doc_id, doc_ids)``. ``row`` is a ``{query, golden_doc, distractor_docs, answer}`` mapping (the
src/soup_cli/utils/raft.py:77
↓ 27 callers
Function
design_evals_from_data
Produce an :class:`EvalDesign` for a dataset + goal. Heuristic — no GPU. The dimensions are derived from the top TF-IDF terms over the output
src/soup_cli/utils/eval_design.py:231
↓ 27 callers
Function
sign_adapter
Compute the manifest, sign it, and write ``.soup-signature.json``. Args: adapter_dir: cwd-contained adapter directory. backend: `
src/soup_cli/utils/adapter_sign.py:338
↓ 26 callers
Method
close
(self)
src/soup_cli/utils/edit_governor.py:443
↓ 25 callers
Function
_clean
Strip ANSI + collapse whitespace. Rich splits flag names with color codes and wraps at terminal width; asserting on raw output has broken CI
tests/test_v07136.py:13
↓ 25 callers
Function
_write_jsonl
(path: Path, rows: list[dict])
tests/test_v07127.py:216
↓ 25 callers
Function
compute_dataset_profile
Compute size / diversity / shape signals for a dataset. ``base_model_proximity`` is left ``None`` by default; the optional ``--probe`` path c
src/soup_cli/utils/advise.py:385
↓ 25 callers
Function
detect_prequantized_format
Detect a pre-quantized base model's quant format. Returns a canonical Quant Menu format string (``gptq`` / ``awq`` / ``hqq:4bit`` / ``aqlm``
src/soup_cli/autopilot/decisions.py:127
↓ 25 callers
Function
format_friendly_error
Display a friendly error message for the given exception. In normal mode: 2-3 lines with error + fix suggestion. In verbose mode: full traceb
src/soup_cli/utils/errors.py:242
↓ 24 callers
Method
apply_chat_template
( self, messages: Any, tokenize: bool = True, add_generation_prompt: bool = Fa
tests/test_v0532.py:127
↓ 24 callers
Function
load_eval_tasks
Load eval tasks from a JSONL file with schema validation. Each line must be a JSON object with at least a 'prompt' field. Optional: 'expected
src/soup_cli/eval/custom.py:75
↓ 24 callers
Function
parse_recipe
Validate and topologically sort a recipe dict. Required shape:: { "nodes": [{"name": "...", "kind": "...", "config": {...}},
src/soup_cli/utils/recipe_dag.py:112
↓ 23 callers
Function
_convert_raft
RAFT (Retrieval-Augmented Fine-Tuning) format — Stanford 2024. Schema: ``{"query": str, "golden_doc": str, "distractor_docs": [str, ...], "an
src/soup_cli/data/formats.py:633
↓ 23 callers
Function
compute_warmup_steps
Return warmup steps clamped to [MIN_WARMUP, MAX_WARMUP]. Special case: ``ratio == 0`` means "no warmup" and returns 0 (the schema allows ``wa
src/soup_cli/utils/warmup.py:19
↓ 23 callers
Function
get_deepspeed_config
Get a DeepSpeed config dict by name.
src/soup_cli/utils/deepspeed.py:171
↓ 23 callers
Function
layer_shard_path
(out_dir: str, idx: int)
src/soup_cli/utils/layer_shard.py:186
↓ 23 callers
Function
load_config
Load a soup.yaml file and return validated SoupConfig.
src/soup_cli/config/loader.py:14
↓ 23 callers
Function
load_suite_items
Return the bundled rows for a behavioural suite ``name``.
src/soup_cli/eval/gate_suites.py:181
↓ 23 callers
Function
resolve_transform
Resolve a transform name to a callable. Resolution order (first match wins): 1. Per-call ``extra`` map (operator-supplied for one ``run_buil
src/soup_cli/utils/build_dag.py:635
↓ 23 callers
Method
state_dict
( self, *args: Any, destination: Any = None, prefix: str = "",
src/soup_cli/utils/layer_stream_runtime.py:702
↓ 22 callers
Function
_lora_keys
(stem="base_model.model.layers.0.self_attn.q_proj")
tests/test_issue305_mixed_rank_arithmetic.py:22
↓ 22 callers
Method
_store
(self, tmp_path)
tests/test_registry.py:172
↓ 22 callers
Function
apply_kv_cache_type
Resolve a ``kv_cache_type`` into a serve runtime plan (v0.71.14 #140). Args: kv_cache_type: one of ``q8_0`` / ``bf16`` / ``f16`` / ``fp8`
src/soup_cli/utils/kv_cache.py:196
↓ 22 callers
Function
make_multipack_trainer_class
Return a subclass of ``base_cls`` overriding ``_get_train_sampler``. The override returns a :class:`MultipackBatchSampler` built from instanc
src/soup_cli/utils/multipack_trainer.py:115
↓ 22 callers
Function
record_thumb
Append a thumbs-up/down record. cwd-contained, symlink-rejected.
src/soup_cli/utils/local_rl.py:268
↓ 22 callers
Function
validate_repo_id
Validate a HuggingFace repo ID (raises ``ValueError`` on bad input). Accepts ``owner/name`` or ``name``. Each component must start with an al
src/soup_cli/utils/hf.py:135
↓ 21 callers
Function
_fake_weights_dir
(tmp_path, n_layers=3, split=False)
tests/test_v07200.py:399
↓ 21 callers
Function
_write_fake_adapter
Write a minimal adapter dir (config + a tiny safetensors-ish blob).
tests/test_v0712.py:216
↓ 21 callers
Function
build_model_card
Render a full HF model card (markdown) from a registry entry + joins. ``entry`` is a hydrated registry row; ``artifacts`` / ``eval_results`` /
src/soup_cli/commands/card.py:101
↓ 21 callers
Function
build_verdict
Combine profile + task into a recommendation, optionally history-biased. Without ``history`` this is byte-identical to the v0.54.0 rubric (re
src/soup_cli/utils/advise.py:676
↓ 21 callers
Function
download_repo
Snapshot-download ``repo_id`` from ``hub`` into ``local_dir``. Returns the absolute local path to the downloaded snapshot. Lazy-imports the a
src/soup_cli/utils/hubs.py:458
↓ 21 callers
Function
get_rope_scaling_config
Build the ``rope_scaling`` dict consumed by HF model configs. The YaRN tunables are emitted only when ``scaling_type='yarn'``; the Llama 3.1
src/soup_cli/utils/long_context.py:281
↓ 21 callers
Function
run_recipe
Execute a validated :class:`RecipeDAG` end-to-end (v0.53.7 live). Per-node handlers dispatch on ``RecipeNode.kind`` against the closed ``NODE
src/soup_cli/utils/recipe_run.py:523
↓ 21 callers
Function
validate_hub_endpoint
SSRF-hardened endpoint validator. Returns the stripped endpoint. Mirrors ``utils/hf.resolve_endpoint`` exactly so all three hubs share the sa
src/soup_cli/utils/hubs.py:125
↓ 21 callers
Function
verify_adapter
Verify that the adapter's files match the recorded manifest. Args: adapter_dir: cwd-contained adapter directory. strict: when Tru
src/soup_cli/utils/adapter_sign.py:471
↓ 21 callers
Function
write_state
Atomically persist ``state`` to ``path`` (default: ``./.soup/loop.yaml``). Uses ``tempfile.mkstemp`` + ``os.replace`` so a SIGKILL mid-write
src/soup_cli/utils/loop_state.py:207
↓ 20 callers
Function
_make_config
(tmp_path: Path, name: str = "soup.yaml", content: str = "base: test\n")
tests/test_v0570_part_d.py:42
next →
1–100 of 20,206, ranked by callers