MCPcopy Create free account

hub / github.com/MakazhanAlpamys/Soup / functions

Functions20,206 in github.com/MakazhanAlpamys/Soup

↓ 12 callersFunction_make_adapter
Write a minimal loadable LoRA adapter dir; return its path string.
tests/test_v07134.py:359
↓ 12 callersFunction_make_entry
Seed a registry entry (and optional artifact / lineage) in a temp DB.
tests/test_v07135.py:93
↓ 12 callersFunction_make_fake_scorer
A PRMScorer with an injected fake model + tokenizer (no network). Fake model: hidden_states[-1] = arange(T) broadcast over H, and reward_head
tests/test_v07130.py:240
↓ 12 callersFunction_make_plan
(tmp_path, monkeypatch, num_probes=4, budget="60s")
tests/test_v0480_part_b.py:329
↓ 12 callersFunction_make_report
()
tests/test_v0714.py:331
↓ 12 callersMethod_patch_configs
(self, monkeypatch, target_vocab, draft_vocab)
tests/test_v07133.py:1121
↓ 12 callersFunction_pid_policy
(**kw)
tests/test_v07126.py:1180
↓ 12 callersFunction_rank1_update
Apply a (covariance-preconditioned) rank-1 update in place. Makes ``down(key) == old + delta`` exactly, so the down-proj now produces the opt
src/soup_cli/utils/edit_kernels.py:240
↓ 12 callersFunction_row
(step, loss, grad_norm=1.0)
tests/test_why.py:10
↓ 12 callersFunction_seed_db
(path: str, n_pairs: int)
tests/test_v07113.py:28
↓ 12 callersFunction_tiny_model_and_tok
(d: int = 8, n_layers: int = 3, vocab: int = 64)
tests/test_v0718.py:49
↓ 12 callersFunction_wrapper
A real SFTTrainerWrapper over a real tiny checkpoint.
tests/test_issue341_seed_and_fullft.py:366
↓ 12 callersFunction_write
(tmp_path, name, text)
tests/test_v07141.py:227
↓ 12 callersFunction_write_task_eval
(path: Path)
tests/test_v07125.py:667
↓ 12 callersFunctionapply_reasoning_effort_prefix
Inject the gpt-oss reasoning-effort control tag into the system message. Returns a NEW list (input is not mutated; mirrors v0.33.0 #47 immutabili
src/soup_cli/utils/reasoning_effort.py:46
↓ 12 callersFunctionattach_artifact
Attach a file at ``path`` to a registry entry as ``kind``. Returns the inserted artifact rowid, or None on lookup failure. Raises ``ValueErro
src/soup_cli/registry/attach.py:15
↓ 12 callersFunctionbuild_accelerate_argv
Build argv that wraps ``script_args`` with ``accelerate launch``. When ``num_processes == 1`` the launcher wrapper is skipped and ``script_ar
src/soup_cli/utils/launcher.py:37
↓ 12 callersFunctionbuild_telemetry_payload
Build the hardware-info-only telemetry payload. The payload contains NO user data, dataset paths, model names, or config contents. Documented
src/soup_cli/utils/trackers.py:106
↓ 12 callersMethodclear
(self)
src/soup_cli/utils/tool_outputs.py:121
↓ 12 callersFunctioncomplete_target_modules
Suggest ``target_modules`` values for the chosen ``base`` model. When ``base`` names a model whose HF config is in the local cache, v0.71.1 #
src/soup_cli/utils/completions.py:231
↓ 12 callersFunctioncompose_report
Build a ``FailureReport`` with the overall verdict computed for you.
src/soup_cli/utils/diagnose/report.py:177
↓ 12 callersFunctioncompute_exposure
Rank each canary's loss against the control distribution. ``percentile`` = fraction of controls STRICTLY cheaper than the canary. Low percent
src/soup_cli/utils/canary.py:208
↓ 12 callersFunctioncompute_feature_diff
Compute per-feature mean activation diff and return top-K changes. Both arrays must have shape ``[N_tokens, N_features]``. ``top_k`` is clamp
src/soup_cli/utils/sae_diff.py:225
↓ 12 callersFunctiondetect_pii
Return a list of ``{kind, snippet}`` PII hits. Scans only the first ``_PII_SCAN_CAP`` chars of ``text`` to keep regex finditer cost bounded r
src/soup_cli/utils/data_score.py:273
↓ 12 callersFunctionescapeHtml
(text)
src/soup_cli/ui/static/app.js:783
↓ 12 callersFunctionestimate_run_cost_usd
Estimate per-run cost in USD; None when the GPU is not priced. Returns None for CPU / MPS / unknown devices so callers can render a "—" inste
src/soup_cli/utils/run_cost.py:53
↓ 12 callersFunctionexport_advanced_gguf
Export a HuggingFace model as a UD / IQ / Apple-ARM GGUF. Three-stage pipeline: 1. ``convert_hf_to_gguf.py`` → ``f16.gguf`` 2. If ``flavo
src/soup_cli/utils/gguf_quant.py:559
↓ 12 callersFunctionextract_citation_ids
Extract every citation id from ``text`` for the given ``style``. Returns a tuple of IDs in encounter order. Duplicates are preserved so the c
src/soup_cli/utils/citation_faithful.py:129
↓ 12 callersMethodfinish_run
Mark run as completed and fill summary fields. Also computes an informational per-run cost estimate based on the device_name captured
src/soup_cli/experiment/tracker.py:215
↓ 12 callersFunctionformat_tts_messages
Apply per-family emotion templating to a chat-message list. Returns a NEW deep-copied list of message dicts (caller's list and its nested val
src/soup_cli/utils/tts.py:244
↓ 12 callersFunctionlengths_from_dataset
Extract per-sample token lengths from a tokenized dataset. Falls back to a ``"length"`` column when ``input_ids`` is absent. A sample with ne
src/soup_cli/utils/multipack_trainer.py:43
↓ 12 callersFunctionload_response_rows
Load per-prompt response rows from a JSONL file under cwd. Each row should carry at least ``{item_id, correct}``. Malformed rows are silently
src/soup_cli/utils/irt.py:404
↓ 12 callersFunctionparse_openapi
Parse an OpenAPI 3.x ``dict``. Returns (endpoints, warnings).
src/soup_cli/utils/agent_forge.py:139
↓ 12 callersFunctionpercentile_bucket
Bucket ``value`` by its percentile rank within a rolling ``window``. v0.71.5 #149 — replaces step-mod round-robin with a difficulty-signal bu
src/soup_cli/utils/curriculum_dynamic.py:183
↓ 12 callersFunctionpick_mixed_precision
Pick mixed-precision mode for a model + GPU. - cc < 6.0 → ``"no"`` (Pascal lacks reliable fp16 tensor cores) - cc < 8.0 → ``"fp16"`` (no bf
src/soup_cli/utils/mixed_precision.py:35
↓ 12 callersFunctionplan_delinearize
Build a `DelinearizePlan`. Raises on bad inputs.
src/soup_cli/utils/delinearize_llama4.py:112
↓ 12 callersFunctionproxy_run_for_weights
Run one short proxy training and return the observed eval loss. Args: weights: Per-dataset interleave probabilities (simplex). da
src/soup_cli/utils/mix_proxy.py:225
↓ 12 callersFunctionpublic_key_pem
Return the PEM-encoded public key for an ed25519 private key.
src/soup_cli/utils/signing.py:110
↓ 12 callersMethodrecord
Append one entry. Never raises on serialisation issues.
src/soup_cli/monitoring/trace_logger.py:105
↓ 12 callersFunctionrender_curve
Render a plain-text time-series of bucket weights over training. Each row is one recompute step; each column is one bucket. Output uses ASCII
src/soup_cli/utils/curriculum_dynamic.py:341
↓ 12 callersFunctionrender_onboarding_yaml
Render a complete `soup.yaml` from a 5-answer dict. Required keys: base, dataset, task, quantization, epochs. Optional: output (default `./ou
src/soup_cli/utils/onboarding.py:45
↓ 12 callersFunctionrender_pre_push_hook
Render the pre-push hook script body — no I/O, deterministic.
src/soup_cli/utils/eval_gate_hook.py:323
↓ 12 callersFunctionrun_sleeper_probe
Apply a calibrated defection probe for ``base`` to ``activations``. ``activations`` must be a 2D array ``[N_tokens, hidden_dim]``. When ``we
src/soup_cli/utils/sleeper_probe.py:351
↓ 12 callersMethodsave_eval_result
Save an evaluation result.
src/soup_cli/experiment/tracker.py:376
↓ 12 callersFunctionscore_task
Score a single task output against the expected answer.
src/soup_cli/eval/custom.py:293
↓ 12 callersFunctionscore_trajectory_repetition
Per-trajectory repetition score. Returns the fraction of n-grams whose count exceeds 1 (the "repeating n-grams" rate). Range ``[0, 1]``. 0 =
src/soup_cli/utils/echo_trap.py:112
↓ 12 callersFunctionvalidate_citation_style
Normalise + validate a citation-style name. Mirrors v0.41.0 / v0.51.0 / v0.61.0 validator policy.
src/soup_cli/utils/citation_faithful.py:73
↓ 12 callersFunctionvalidate_hack_detector
Validate and normalise a reward-hacking detector name. Returns the canonical (lower-cased) name on success. Raises ``ValueError`` with an act
src/soup_cli/utils/reward_hacking.py:85
↓ 12 callersFunctionvalidate_model_name
Validate Ollama model name. Returns (is_valid, error_message).
src/soup_cli/utils/ollama.py:82
↓ 12 callersFunctionvalidate_otlp_endpoint
SSRF-hardened OTLP endpoint validation. Rules (mirrors utils/hf.py): - scheme must be http/https - plain http only permitted for loopback
src/soup_cli/utils/tracing.py:42
↓ 12 callersFunctionvalidate_prm_compat
Schema-time gate for ``task='prm'``. Rejects: - non-PRM task (the function is intended to be called only when ``task == 'prm'``; defenc
src/soup_cli/utils/prm.py:72
↓ 12 callersFunctionvalidate_steering_method
Normalise + validate a steering-method name. Mirrors v0.41.0 / v0.51.0 / v0.61.0 validator policy: bool-rejected, null-byte-rejected, oversiz
src/soup_cli/utils/steering.py:85
↓ 12 callersFunctionvalidate_unlearn_method
Normalise + validate an unlearn-method name. Returns the canonical (lowercase) form. Mirrors v0.41.0 ``validate_optimizer_name`` / v0.51.0 ``
src/soup_cli/utils/unlearning.py:79
↓ 12 callersFunctionverify_namespace
Decide whether ``repo_id`` can be loaded. Decision matrix: - Unknown repo: trust-on-first-use. Record and return ok=True. - Known repo,
src/soup_cli/utils/namespace_pin.py:343
↓ 12 callersMethodwith_status
Return a copy with ``status`` set + ``updated_at`` refreshed.
src/soup_cli/utils/loop_state.py:129
↓ 11 callersFunction_generate_server
Generate examples using a local OpenAI-compatible server (soup serve, Ollama, etc.). Unlike the 'openai' provider, no API key is required. Connec
src/soup_cli/commands/generate.py:828
↓ 11 callersMethod_import
(self)
tests/test_v0538.py:27
↓ 11 callersFunction_interactive_wizard
Walk user through config creation.
src/soup_cli/commands/init.py:70
↓ 11 callersMethod_make_wrapper_with_mock_trainer
Helper: return a KTOTrainerWrapper with trainer pre-injected.
tests/test_kto.py:519
↓ 11 callersFunction_resolve_posthog_target
Resolve ``(key, endpoint)`` from explicit args + ``SOUP_POSTHOG_*`` env. v0.53.10 #154 — adds env-var overrides for the bundled defaults so users
src/soup_cli/utils/trackers.py:180
↓ 11 callersFunction_setup_blame
(tmp_path, monkeypatch, n_rows: int = 100)
tests/test_v0570_part_c.py:82
↓ 11 callersMethod_setup_streaming_transformers
v0.72.0 BETA — layer streaming. The resident base load NEVER happens. Builds the skeleton on ``meta`` (``accelerate.init_empty_weights``),
src/soup_cli/trainer/stream_setup.py:145
↓ 11 callersFunction_strip_ansi
(text: str)
tests/test_v0660_cli.py:19
↓ 11 callersFunction_synthetic_probe
Build a closure that returns (row_grads, probe_grad).
tests/test_v0660_part_b.py:500
↓ 11 callersFunction_tiny_llama
(layers: int = 6, vocab_size: int = 128)
tests/test_v07129.py:133
↓ 11 callersMethod_tracker
(self, tmp_path)
tests/test_v0715.py:28
↓ 11 callersFunction_write_jsonl
(path: Path, rows: list[dict])
tests/test_v0717.py:36
↓ 11 callersMethodadd_artifact
Attach an artifact to an entry. Returns the artifact row id. ``enforce_cwd`` (on by default) rejects files outside the cwd captured a
src/soup_cli/registry/store.py:459
↓ 11 callersMethodadd_lineage
Record a ``child → parent`` lineage edge. Rejects self-references and indirect cycles (e.g. A→B→A) so BFS walks in :meth:`get_ancesto
src/soup_cli/registry/store.py:518
↓ 11 callersFunctionapply_fp8_attention
Convert attention-projection linears to FP8 training modules. Live since v0.71.21 (#141). Walks ``model.named_modules()``, collects every ``n
src/soup_cli/utils/advanced_precision.py:212
↓ 11 callersFunctionapply_vocab_expansion
Add configured tokens to ``tokenizer`` and resize ``model`` embeddings. The helper is intentionally shared by every text trainer so ``data.ad
src/soup_cli/utils/data_pipeline.py:420
↓ 11 callersFunctionbuild_gating_kernel
Build a live per-token gating kernel for MoLE dispatch (v0.71.12 #222). Returns a ``torch.nn.Module`` whose forward maps a ``[..., hidden_dim]``
src/soup_cli/utils/mole_routing.py:272
↓ 11 callersFunctionbuild_streamed_model
Meta skeleton -> extras -> LoRA -> streaming. No resident base load.
src/soup_cli/utils/layer_stream_runtime.py:1595
↓ 11 callersFunctioncheck_strict_safetensors
Refuse pickle / PyTorch-classic weights when ``strict=True``. Args: model_dir: cwd-contained model / adapter directory. strict: w
src/soup_cli/utils/strict_safetensors.py:213
↓ 11 callersFunctionchoose_tier
RAM is Tier 1; disk is overflow only; spinning rust is refused. plan 2.3: streaming from NVMe measured 2-11 TFLOPS against multiples of that
src/soup_cli/utils/layer_stream.py:387
↓ 11 callersFunctionclassify_interference
OK / MINOR / MAJOR by absolute score (5% / 20% bands). Boundary semantics: exact 0.05 → MINOR; exact 0.20 → MAJOR.
src/soup_cli/utils/interference.py:176
↓ 11 callersFunctioncompute_behavior_diff
Compute a pre/post diff report from explicit responses + oracle labels. All three lists must be the same length and contain str. The oracle entry
src/soup_cli/utils/behavior_battery.py:269
↓ 11 callersFunctioncompute_coherence_score
Compute coherence scores for a list of texts. Coherence is measured by: - Sentence-level structure (has proper sentences) - Word repetiti
src/soup_cli/utils/quality.py:92
↓ 11 callersFunctionconsolidate_shards
Stream each FSDP shard and write a single consolidated ``.safetensors``. Loads one shard at a time via ``torch.load(weights_only=True)`` (no
src/soup_cli/utils/fsdp_consolidate.py:109
↓ 11 callersFunctiondecide_regression
Decide whether ``metric`` regressed past the configured tolerance. Uses the paired-bootstrap 95 % CI of the delta. Higher-is-better metrics r
src/soup_cli/utils/eval_gate_hook.py:231
↓ 11 callersFunctiondetect_common_prefix
Return the longest prefix shared by >= min_frequency of rows. Empty / single-row / no-overlap fall through to "" except the trivial single-ro
src/soup_cli/utils/prune_prompt.py:89
↓ 11 callersFunctiondetect_ollama
Check if Ollama is installed, return version string or None.
src/soup_cli/utils/ollama.py:123
↓ 11 callersFunctionextras_shard_path
(out_dir: str)
src/soup_cli/utils/layer_shard.py:190
↓ 11 callersFunctionflag_downstream_risk
Per-license risk check for a target deployment. Decision matrix: - Unknown license -> ``warn`` (operator should review). - Non-commercial
src/soup_cli/utils/license_advisor.py:229
↓ 11 callersMethodget
(self, repo_id: str)
src/soup_cli/utils/namespace_pin.py:184
↓ 11 callersMethodget_metrics
Get all metric rows for a run, ordered by step.
src/soup_cli/experiment/tracker.py:307
↓ 11 callersFunctiongovernor_recommend_method
Recommend the next method given accumulated state. Switching rules: 1. ``alphaedit`` is the survival-mode method — never switched away.
src/soup_cli/utils/edit_governor.py:150
↓ 11 callersFunctionharvest_dpo_pairs
Pair up/down responses to the same prompt into DPO training rows. For each prompt that has at least one ``up`` AND at least one ``down`` thum
src/soup_cli/utils/local_rl.py:289
↓ 11 callersFunctioninspect_airgap_bundle
Read back the manifest from a bundle tarball. Containment-checked; symlink at the bundle path is rejected via the shared helper. Raises ``Fil
src/soup_cli/utils/airgap_bundle.py:362
↓ 11 callersFunctionis_known_vlm_base
Best-effort check whether ``name`` matches a known VLM family. Returns ``False`` (never raises) on any of: non-string, empty, null byte, leng
src/soup_cli/utils/prm.py:51
↓ 11 callersFunctionkmeans
Deterministic k-means++ over ``vectors``; returns integer labels.
src/soup_cli/utils/topics.py:77
↓ 11 callersFunctionload_audio_mono
Load an audio file as mono float32 at ``target_sr``. Lazy-imports soundfile (friendly ImportError naming the install). Off-rate audio is resa
src/soup_cli/utils/tts_codec.py:142
↓ 11 callersFunctionload_model_and_tokenizer
Load model + tokenizer via unsloth FastLanguageModel with LoRA already applied. Returns (model, tokenizer) — model already has LoRA adapters atta
src/soup_cli/utils/unsloth.py:26
↓ 11 callersFunctionload_model_and_tokenizer
Load an ``AutoModelForCausalLM`` + tokenizer, optionally with a LoRA adapter. Returns ``(model, tokenizer, device)``. ``model`` is ``.eval()``-ed
src/soup_cli/utils/live_eval.py:116
↓ 11 callersFunctionload_probe_weights
Load an operator-supplied calibrated probe ``(W, threshold)`` from disk. Replaces the synthetic seed-derived placeholder with a real weight file
src/soup_cli/utils/probe_kernel.py:437
↓ 11 callersFunctionload_registry
Load the dataset registry. Returns empty dict if file doesn't exist.
src/soup_cli/utils/registry.py:31
↓ 11 callersFunctionlookup_gpu_rate
Return (canonical_label, usd_per_hour) for a device name, or None. Matches case-insensitively against `_GPU_RATE_TABLE`. Returns None when th
src/soup_cli/utils/run_cost.py:37
↓ 11 callersFunctionmigrate_unsloth
Parse an Unsloth .ipynb notebook and return a Soup config dict. Extracts parameters from function calls using AST parsing only. Returns a dic
src/soup_cli/migrate/unsloth.py:41
↓ 11 callersFunctionpick_irt_subset
Select the high-information subset of items per profile.
src/soup_cli/utils/irt.py:375
↓ 11 callersMethodpush
Append an event. Returns the event's monotonic cursor id.
src/soup_cli/utils/train_event_buffer.py:38
← previousnext →301–400 of 20,206, ranked by callers