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
↓ 7 callers
Function
reset_global_tool_buffer
Replace the process-wide buffer (test hook).
src/soup_cli/utils/tool_outputs.py:188
↓ 7 callers
Function
resolve
Resolve `(subcommand, args)` into an executable plan. Raises: ValueError on unknown subcommand or invalid arg FileNotFoundError when
src/soup_cli/utils/llama_proxy.py:55
↓ 7 callers
Function
resolve_finish_reason
Map a vLLM ``CompletionOutput`` to an OpenAI ``finish_reason`` (#333). Trusts the engine's own ``finish_reason`` when it is one Soup emits, and
src/soup_cli/utils/vllm.py:98
↓ 7 callers
Function
resolve_layer_module
Resolve a dotted ``layer_path`` (e.g. ``model.layers.5``) to a submodule. Each segment is either an attribute name (``getattr``) or an integer in
src/soup_cli/utils/live_eval.py:512
↓ 7 callers
Function
resolve_mlx_target_keys
THE answer to "which modules does this MLX run train?" (#392). Both the trainer and the ``adapter_config.json`` writer must use it. They used
src/soup_cli/trainer/mlx_sft.py:37
↓ 7 callers
Function
resolve_ui_env
Read the documented env knobs, applying validation. `env=None` reads from `os.environ`.
src/soup_cli/utils/ui_env.py:77
↓ 7 callers
Function
rouge_n_score
ROUGE-N F1 (corpus average over total pair count). Pairs where either side has fewer than `n` tokens contribute 0.0 to the average — short-se
src/soup_cli/utils/nlg_metrics.py:142
↓ 7 callers
Function
run_can
Extract a can, run ``soup train`` against the embedded config, optionally run the embedded deploy targets. Args: can_path: path to th
src/soup_cli/cans/run.py:147
↓ 7 callers
Function
run_capability_suite
LIVE lm-eval-harness invocation (#211). Resolves either an explicit ``tasks`` list (lm-eval task names) or the ``suite`` profile to its lm-ev
src/soup_cli/utils/capability_suite.py:210
↓ 7 callers
Function
run_cmaes_merge
Run a small CMA-ES-style search over simplex merge weights. Operator supplies ``eval_fn(weights) -> score`` (higher is better); we softmax N-
src/soup_cli/utils/cmaes_merge.py:312
↓ 7 callers
Function
run_compile
Run the live compilation (v0.71.13 #225). Dispatches by ``plan.optimizer``: DSPy (bootstrap_fewshot / mipro / copro), GEPA, or TextGrad. Each
src/soup_cli/utils/prompt_compile.py:449
↓ 7 callers
Function
run_once
Execute one full iteration synchronously. Pure with respect to time.
src/soup_cli/utils/loop_daemon.py:147
↓ 7 callers
Function
run_unlearn_eval
Build an :class:`UnlearnReport` from optional pre-computed evidence. Missing evidence per-metric falls through to ``_neutral_metric`` (OK sco
src/soup_cli/utils/unlearning_eval.py:390
↓ 7 callers
Function
sample_indices
Evenly-spaced sample of up to ``n`` indices across ``[0, total)``. Even spacing (rather than ``data[:n]``) catches issues confined to the tai
src/soup_cli/utils/data_doctor.py:158
↓ 7 callers
Function
save_lr_finder_report
Write a JSON report with the sweep + recommended LR.
src/soup_cli/utils/lr_finder.py:201
↓ 7 callers
Function
scan_adapter
Containment-checked safetensors load + scan. Raises ``ValueError`` if the dir is outside cwd or a symlink; raises ``FileNotFoundError`` if no
src/soup_cli/utils/adapter_scan.py:423
↓ 7 callers
Function
score_contamination
Score 1 - fraction of training rows overlapping any benchmark row. ``benchmark_corpus`` may be a sequence of strings OR a sequence of Mapping
src/soup_cli/utils/diagnose/contamination.py:23
↓ 7 callers
Function
score_educational_value
Return [0, 1] educational-value score. Combines (a) log-scale length and (b) type/token ratio as a proxy for vocabulary breadth. Lightweight
src/soup_cli/utils/data_score.py:439
↓ 7 callers
Function
score_toxicity
Return [0, 1] toxicity score from a keyword baseline. A real Llama-Guard variant lands in v0.47.1 via ``[data-pro]``.
src/soup_cli/utils/data_score.py:419
↓ 7 callers
Method
setup
Load model, tokenizer, apply LoRA, create trainer.
src/soup_cli/trainer/sft.py:204
↓ 7 callers
Function
shift_heads_for_s2
Apply the LongLoRA S² shift to half the attention heads. Pure math kernel used by :func:`apply_longlora_forward_override`. Given an attention
src/soup_cli/utils/longlora.py:259
↓ 7 callers
Function
split_prefix
Split text into (prefix, suffix). Default: split by whitespace word-count fraction. When ``tokenizer`` is supplied (v0.71.6 #167 — an HF mode
src/soup_cli/utils/diagnose/memorization.py:30
↓ 7 callers
Function
summarise
Reduce a metric series into headline numbers.
src/soup_cli/utils/replay.py:40
↓ 7 callers
Function
synthesise_forge_rows
Run the pipeline: chunk → judge → active-prune → ForgeRow rows. The ``judge`` callable is invoked once per chunk; failures are swallowed at D
src/soup_cli/utils/data_forge.py:346
↓ 7 callers
Function
temp_registry
Isolated registry + branches dir under cwd, returns a push helper.
tests/test_v0714.py:41
↓ 7 callers
Function
tracker_missing_dep_message
Return a friendly install advisory for ``name`` if the package is missing, else None. Always returns ``None`` for `wandb` / `tensorboard` / `
src/soup_cli/utils/trackers.py:306
↓ 7 callers
Function
try_reload_with_fallback
v0.35.0 #61 — attempt ``build_fn(picked.name)``, falling back to the next-highest-scored candidate on load failure. ``build_fn`` is a callabl
src/soup_cli/utils/auto_quant.py:206
↓ 7 callers
Function
update_elo
Update Elo ratings after a match where A scored `score_a` ∈ [0,1]. score_a == 1.0 → A won. score_a == 0.0 → B won. score_a == 0.5 →
src/soup_cli/eval/arena.py:56
↓ 7 callers
Function
update_ema
One-step exponential moving average update. `prev=None` initialises to `sample`. `alpha` is the weight on the new sample (0 < alpha <= 1). Sm
src/soup_cli/utils/tail_latency.py:24
↓ 7 callers
Function
update_ema_in_place
In-place EMA of the reference model from the policy (v0.71.11 #160). ``ref.param = (1-α)·ref.param + α·policy.param`` for every shared parame
src/soup_cli/monitoring/grpo_stability_callback.py:78
↓ 7 callers
Function
upload_repo
Upload ``folder_path`` to ``repo_id`` on ``hub``. Same lazy-import policy as :func:`download_repo`. Token resolution is left to the caller (e
src/soup_cli/utils/hubs.py:565
↓ 7 callers
Function
validate_emotion_tag
Validate an ``emotion`` tag for ``family`` (currently Orpheus only). Raises if the family does not support emotion conditioning or the tag is
src/soup_cli/utils/tts.py:135
↓ 7 callers
Function
validate_fp8_attention_compat
Schema-time gate for ``fp8_attention=True``. Rejects: - non-bool ``fp8_attention`` (defence-in-depth). - ``fp8_attention=True`` without `
src/soup_cli/utils/advanced_precision.py:102
↓ 7 callers
Function
validate_galore_config
Validate GaLore configuration and return list of error messages.
src/soup_cli/utils/galore.py:30
↓ 7 callers
Function
validate_grace_codebook_dim
Validate the codebook entry dimension (residual-stream width).
src/soup_cli/utils/grace_codebook.py:71
↓ 7 callers
Function
validate_grpo_delta
Validate the two-sided clipping delta. Must be a finite float in ``(0, 1]``. Bool rejected (matches v0.30.0 Candidate policy).
src/soup_cli/utils/grpo_variants.py:165
↓ 7 callers
Function
validate_longlora_compat
Raise ``ValueError`` if the LongLoRA prerequisites are not satisfied. LongLoRA requires: * ``task='sft'`` (preference / RL trainers have a
src/soup_cli/utils/longlora.py:189
↓ 7 callers
Function
validate_measure_candidate
Validate + canonicalise a quant candidate for the live measure loop. Accepts the closed :data:`MEASURABLE_QUANT_CANDIDATES` allowlist plus the
src/soup_cli/utils/deploy_measure.py:336
↓ 7 callers
Function
validate_offload_config
Validate ``activation_offloading`` config. Args: target: None / 'cpu' / 'disk'. backend: transformers / unsloth / mlx. de
src/soup_cli/utils/activation_offload.py:24
↓ 7 callers
Function
validate_ollama_url
Validate that the Ollama URL is localhost-only (SSRF protection). Raises ValueError if the URL is not a local address.
src/soup_cli/data/providers/ollama.py:41
↓ 7 callers
Function
validate_pairs_per_round
Validate the per-round pair count. Range: ``[10, 1_000_000]``. Below 10 pairs the DPO gradient signal is too noisy to be meaningful; above 1M
src/soup_cli/utils/iterative_dpo.py:55
↓ 7 callers
Function
validate_program_path
Validate a prompt-program path (cwd-contained, ``.py`` only, no symlink). Returns the realpath of the validated path.
src/soup_cli/utils/prompt_compile.py:116
↓ 7 callers
Function
validate_rollout_func
Validate a ``module.path:function_name`` rollout-func spec. ``None`` passes through (field unset). Mirrors the v0.42.0 ``validate_prompt_stra
src/soup_cli/utils/agent_rollout.py:158
↓ 7 callers
Function
validate_source_name
Normalise + validate an ingest-source name. Mirrors v0.41.0 / v0.50.0 / v0.51.0 / v0.62.0 validator policy: bool-first, non-string -> TypeErr
src/soup_cli/utils/ingest_sources.py:105
↓ 7 callers
Function
validate_student_id
Validate a student model id.
src/soup_cli/utils/prompt_distill.py:85
↓ 7 callers
Function
validate_threshold
Validate ``threshold`` is a finite positive float.
src/soup_cli/utils/drift_alarm.py:71
↓ 7 callers
Function
validate_unsloth_bnb_4bit_compat
Schema-time gate for ``unsloth_bnb_4bit=True``. Promotes "Unsloth Dynamic 4-bit" from "inferable from backend+quant" to a native flag. The fl
src/soup_cli/utils/advanced_precision.py:174
↓ 7 callers
Function
validate_vllm_url
Validate the vLLM server URL (SSRF protection). Reuses the same validation as the server provider: - Scheme must be http or https - HTTP
src/soup_cli/data/providers/vllm.py:15
↓ 7 callers
Function
verify_payload
Verify a detached ed25519 signature. Returns ``False`` on any verification failure (bad signature, wrong key, malformed hex). Raises ``TypeEr
src/soup_cli/utils/signing.py:133
↓ 7 callers
Function
write_annex_doc
Atomic write of an Annex XI or XII doc to ``output_path``. ``fmt`` is ``markdown`` (default) / ``md`` for the markdown body, or ``pdf`` (v0.7
src/soup_cli/utils/annex_xi.py:312
↓ 7 callers
Function
write_eval_design
Atomic write — cwd containment + symlink rejection at target.
src/soup_cli/utils/eval_design.py:309
↓ 7 callers
Function
write_forge_dataset
Write rows as JSONL, atomically. Returns the realpath.
src/soup_cli/utils/data_forge.py:471
↓ 7 callers
Function
write_recipe
Write the recipe YAML under cwd; returns the realpath written.
src/soup_cli/utils/deploy_autopilot.py:313
↓ 6 callers
Method
__init__
(self, logits)
tests/test_v07110.py:72
↓ 6 callers
Function
_attach
(instance)
tests/test_v07119.py:208
↓ 6 callers
Function
_auto_deploy_ollama
Auto-deploy a GGUF file to Ollama after export.
src/soup_cli/commands/export.py:1141
↓ 6 callers
Function
_auto_detect_template
Try to infer chat template from soup.yaml in cwd.
src/soup_cli/commands/deploy.py:719
↓ 6 callers
Function
_batch_on
Move a TRL batch onto the model's device. `TrainingArguments` picks CUDA whenever it is available, so a test that deliberately pins the MODEL
tests/test_v07204.py:172
↓ 6 callers
Function
_budget_lines
``on_cuda=False`` exercises the panel without needing a GPU: the fit decision is skipped, but the calibrated budget and its display line are b
tests/test_issue348_calibrated_logits_wiring.py:52
↓ 6 callers
Function
_build
A real wrapper over a real tiny checkpoint, with `setup()` called.
tests/test_issue353_seed_every_task.py:202
↓ 6 callers
Function
_build_distill_config_yaml
Render the ``task: distill`` config: student = draft base, teacher = target. Every user-supplied string is embedded via ``json.dumps`` — a JSON s
src/soup_cli/commands/draft.py:183
↓ 6 callers
Method
_build_precision_kwargs
Resolve fp16/bf16 kwargs for GRPOConfig (v0.53.3 #128). Priority: - Non-CUDA device (CPU / MPS / XPU) → no mixed precision (both
src/soup_cli/trainer/grpo.py:204
↓ 6 callers
Method
_cfg
(self, **kw)
tests/test_v0716.py:600
↓ 6 callers
Method
_cfg
(self, extra: str = "", *, mitigation: str = "pid_lagrangian")
tests/test_v07126.py:1119
↓ 6 callers
Method
_cfg
(self, extra: str = "", *, mitigation: str = "kl_control")
tests/test_v07126.py:1513
↓ 6 callers
Method
_cfg
(self, db, method="dpo")
tests/test_v07113.py:175
↓ 6 callers
Function
_check_positive_int
(value: object, name: str)
src/soup_cli/utils/live_eval.py:75
↓ 6 callers
Function
_clean
Strip ANSI colour codes + collapse whitespace from CLI output. Under CI ``FORCE_COLOR``, Typer/Rich injects ANSI codes that split flag names
tests/test_v07117.py:33
↓ 6 callers
Method
_client
(self, tmp_path, monkeypatch)
tests/test_serve.py:262
↓ 6 callers
Method
_design_with_scorers
(self, scorers: list)
tests/test_v0550.py:415
↓ 6 callers
Function
_enable_fp8_gates
(monkeypatch)
tests/test_v07121.py:188
↓ 6 callers
Method
_evidence
(self)
tests/test_v07302.py:979
↓ 6 callers
Function
_extract_answer
Extract the final answer from model output. Supports: - #### <answer> format (GSM8K style) - \\boxed{<answer>} format (math style)
src/soup_cli/trainer/rewards.py:216
↓ 6 callers
Function
_extract_text
Best-effort prompt text from a calib row (text / prompt / messages).
src/soup_cli/commands/shrink.py:77
↓ 6 callers
Function
_fail
(message: str)
src/soup_cli/commands/can.py:19
↓ 6 callers
Function
_fake_cuda
(monkeypatch, count, available=True)
tests/test_stream_multi_gpu_guard.py:29
↓ 6 callers
Function
_fake_trainer_recording
(added)
tests/test_v07126.py:605
↓ 6 callers
Function
_for_terminal
(text: str)
src/soup_cli/commands/data_doctor.py:48
↓ 6 callers
Function
_format_size
Format bytes into human-readable string.
src/soup_cli/commands/push.py:318
↓ 6 callers
Method
_generate
(self, model, gate, *, steps=3)
tests/test_v07122.py:528
↓ 6 callers
Function
_get_format_spec
Get the format specification string for the given format.
src/soup_cli/commands/generate.py:648
↓ 6 callers
Method
_hydrate
Attach tags + artifacts to an entry row.
src/soup_cli/registry/store.py:320
↓ 6 callers
Method
_key
(self, tmp_path)
tests/test_v0712.py:231
↓ 6 callers
Method
_key
(self, tmp_path, name="priv.pem")
tests/test_v0712.py:1066
↓ 6 callers
Method
_load
(self)
tests/test_v07126.py:448
↓ 6 callers
Function
_load_augment_provider
Construct an LLM provider instance with a ``generate(prompt)`` method.
src/soup_cli/commands/data.py:1761
↓ 6 callers
Function
_load_model
Load a model and tokenizer (reuses diff.py pattern).
src/soup_cli/commands/infer.py:646
↓ 6 callers
Method
_loaded
(self, n_adapters=2)
tests/test_v07117.py:697
↓ 6 callers
Function
_lora_wrap
(model)
tests/test_issue336_deepspeed_lora.py:296
↓ 6 callers
Function
_make_args
Create a mock TrainingArguments.
tests/test_callback.py:17
↓ 6 callers
Function
_make_config
Create a minimal SoupConfig for display testing.
tests/test_display.py:19
↓ 6 callers
Function
_make_state
Create a mock TrainerState.
tests/test_callback.py:8
↓ 6 callers
Function
_parse_adapter_specs
Parse ``name=path`` adapter specs; cwd-contain each path.
src/soup_cli/commands/probe.py:467
↓ 6 callers
Function
_parse_adapters
Parse adapter name=path pairs from CLI flag. Returns dict mapping adapter name → path string. Raises ValueError on invalid format.
src/soup_cli/commands/serve.py:49
↓ 6 callers
Function
_pid_callback
(tmp_path, buffer, *, rollback=False, rollback_patience=2, max_recovery_attempts=1, ckpt_cb=
tests/test_v07126.py:1371
↓ 6 callers
Function
_plain
(text: str)
tests/test_hf_integration.py:25
↓ 6 callers
Function
_prepare_grpo_dataset
Convert dataset rows to GRPO format. GRPO expects each row to have a 'prompt' field (list of messages or string). Input can be: - messa
src/soup_cli/trainer/grpo.py:653
↓ 6 callers
Function
_prepare_reward_dataset
Convert dataset rows to reward model format. RewardTrainer expects each row to have 'chosen' and 'rejected' text fields. Input can be:
src/soup_cli/trainer/reward_model.py:309
↓ 6 callers
Method
_profile
(self, **over)
tests/test_v0715.py:130
↓ 6 callers
Function
_read_jsonl
Read JSONL file and return list of dicts.
tests/test_data_split.py:16
← previous
next →
901–1,000 of 20,206, ranked by callers