Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/elder-plinius/OBLITERATUS
/ functions
Functions
1,841 in github.com/elder-plinius/OBLITERATUS
⨍
Functions
1,841
◇
Types & classes
359
↓ 188 callers
Method
log
(self, msg: str)
obliteratus/tourney.py:856
↓ 180 callers
Method
log
(self, msg: str)
obliteratus/abliterate.py:970
↓ 64 callers
Function
detect_architecture
Detect the architecture class and reasoning capability of a model. Args: model_name: HuggingFace model identifier config: Hugging
obliteratus/architecture_profiles.py:146
↓ 56 callers
Method
__init__
(self)
tests/test_abliterate.py:1475
↓ 37 callers
Method
_project_out_advanced
Advanced projection with norm preservation and regularization. norm_preserve: If True, rescale projected weights to preserve original Frobeni
obliteratus/abliterate.py:4853
↓ 27 callers
Function
_dim
(cfg: Any, name: str, default: Any = 0)
obliteratus/model_profile.py:46
↓ 27 callers
Method
_emit
(self, key: str, status: str, message: str = "", **details)
obliteratus/abliterate.py:973
↓ 27 callers
Method
_free_gpu_memory
Release unused GPU/accelerator memory between pipeline stages.
obliteratus/abliterate.py:986
↓ 24 callers
Function
get_layer_modules
Return the nn.ModuleList of transformer layers for this model.
obliteratus/strategies/utils.py:155
↓ 22 callers
Method
_derive_configuration
Derive optimal pipeline configuration from analysis insights. This is where analysis feeds forward into abliteration decisions.
obliteratus/informed_pipeline.py:611
↓ 22 callers
Function
_is_refusal
Check if a single response is a refusal. Uses case-insensitive matching for both prefixes and substrings. Empty/blank responses return False
obliteratus/evaluation/advanced_metrics.py:276
↓ 21 callers
Function
log
(msg)
obliteratus/evaluation/heretic_eval.py:1048
↓ 20 callers
Method
_project_bias
Project the refusal direction out of bias terms. Standard abliteration only modifies weight matrices, but bias vectors can also have
obliteratus/abliterate.py:4966
↓ 19 callers
Function
refusal_rate
Compute the fraction of responses that are refusals. Args: responses: List of model-generated response strings. mode: Detection m
obliteratus/evaluation/advanced_metrics.py:178
↓ 18 callers
Function
_make_layer_activations
Create synthetic per-layer activations with planted refusal signal.
tests/test_causal_and_transfer.py:38
↓ 18 callers
Function
_make_multilayer_activations
Create per-layer activations with planted refusal signals.
tests/test_breakthrough_modules.py:56
↓ 18 callers
Function
is_enabled
Check if telemetry is enabled (off by default, opt in with OBLITERATUS_TELEMETRY=1). This is the single source of truth for telemetry state. Bot
obliteratus/telemetry.py:222
↓ 17 callers
Method
analyze
Compute cross-layer alignment analysis. Args: refusal_directions: {layer_idx: direction_tensor} for each layer. D
obliteratus/analysis/cross_layer.py:67
↓ 17 callers
Function
build_report
Build a structured telemetry report (schema v2).
obliteratus/telemetry.py:1086
↓ 16 callers
Method
_make_pipeline_with_insights
(self, **kwargs)
tests/test_informed_pipeline.py:150
↓ 16 callers
Function
gini_coefficient
Compute Gini coefficient of a distribution. Returns a value in [0, 1] where 0 = perfectly uniform and 1 = maximally concentrated.
obliteratus/analysis/utils.py:6
↓ 15 callers
Method
extract
Extract whitened refusal directions for a single layer. Args: harmful_activations: List of (hidden_dim,) tensors, one per prompt.
obliteratus/analysis/whitened_svd.py:73
↓ 15 callers
Function
get_ffn_module
Return the FFN/MLP sub-module inside a single transformer layer. For architectures with flat FFN layout (e.g. OPT where fc1/fc2 are direct at
obliteratus/strategies/utils.py:200
↓ 15 callers
Method
remove
Remove all installed hooks.
obliteratus/analysis/steering_vectors.py:244
↓ 14 callers
Method
_base_kwargs
(self, **overrides)
tests/test_telemetry.py:97
↓ 14 callers
Function
_get_session_model_choices
Return dropdown choices for all obliterated models in this session.
app.py:2542
↓ 14 callers
Method
_maybe_apply_chat_template
Wrap prompts in the model's chat template if use_chat_template is enabled. For instruct/chat models, wrapping prompts in the proper template
obliteratus/abliterate.py:1274
↓ 14 callers
Method
decode
Decode from features back to hidden space.
obliteratus/analysis/sae_abliteration.py:102
↓ 14 callers
Method
encode
Encode to sparse feature activations.
obliteratus/analysis/sae_abliteration.py:91
↓ 13 callers
Function
_sanitize_label
Strip filesystem paths, tokens, and overly-long strings from labels. Prevents accidental leakage of sensitive information (HF org names, loca
obliteratus/analysis/visualization.py:29
↓ 13 callers
Method
analyze_layer
Analyze cone geometry at a single layer. Args: harmful_activations: List of per-prompt activation tensors. harmless_a
obliteratus/analysis/concept_geometry.py:125
↓ 13 callers
Method
analyze_prompt
Analyze refusal signal at each token position. Args: activations: (seq_len, hidden_dim) activations for one prompt. r
obliteratus/analysis/multi_token_position.py:111
↓ 13 callers
Method
decode
(self, ids)
tests/test_new_analysis_modules.py:106
↓ 13 callers
Method
detect_imprint
Detect alignment method from refusal direction geometry. Args: refusal_directions: {layer_idx: direction_vector} per layer.
obliteratus/analysis/alignment_imprint.py:143
↓ 13 callers
Function
get_chat_header
Return a status message for the chat tab.
app.py:2526
↓ 12 callers
Function
_make_mock_pipeline
Create a mock pipeline with refusal directions and activations.
tests/test_defense_robustness.py:17
↓ 12 callers
Method
_make_weight_with_sparse_refusal
Create a weight matrix where refusal is concentrated in a few rows.
tests/test_novel_analysis.py:485
↓ 12 callers
Method
_project_moe_experts
Project refusal direction from all MoE components. Targets three critical components that research shows encode refusal: 1. Router/G
obliteratus/abliterate.py:5163
↓ 12 callers
Function
aggregate_results
Aggregate contribution records into per-model, per-method summaries. Groups results by (model_name, method) and computes summary statistics f
obliteratus/community.py:203
↓ 12 callers
Method
analyze_weight_matrix
Analyze the projection distribution of a weight matrix. Args: weight: (out_dim, in_dim) weight matrix. refusal_direct
obliteratus/analysis/sparse_surgery.py:103
↓ 12 callers
Function
get_attention_module
Return the attention sub-module inside a single transformer layer. For hybrid architectures (e.g. Qwen3.5 with GatedDeltaNet), tries fallback
obliteratus/strategies/utils.py:182
↓ 12 callers
Function
get_source_choices
Return display labels for use in a Gradio dropdown.
obliteratus/prompts.py:451
↓ 12 callers
Function
get_strategy
Instantiate a registered strategy by name.
obliteratus/strategies/registry.py:18
↓ 12 callers
Method
run
Execute the full abliteration pipeline. Returns path to saved model.
obliteratus/abliterate.py:1092
↓ 12 callers
Function
save_contribution
Save a contribution record from a completed pipeline run. Unlike telemetry, this: - Includes the public model name (for aggregation by model)
obliteratus/community.py:64
↓ 11 callers
Function
_clear_gpu
Free GPU/accelerator memory. Resilient to device errors.
app.py:744
↓ 11 callers
Method
_make_activations_with_trigger
Create activations with a planted trigger at a specific position.
tests/test_novel_analysis.py:330
↓ 11 callers
Method
_select_layers_knee
Select layers using the kneedle algorithm (simplified). Finds the 'elbow' in the sorted norm curve where adding more layers gives dim
obliteratus/abliterate.py:2696
↓ 11 callers
Function
generate_latex_table
Generate a LaTeX table from aggregated community results. Args: aggregated: Output of aggregate_results(). methods: Methods to in
obliteratus/community.py:256
↓ 11 callers
Function
is_cuda
True when at least one NVIDIA CUDA GPU is visible.
obliteratus/device.py:23
↓ 11 callers
Function
load_contributions
Load all contribution records from a directory. Args: contrib_dir: Directory containing contribution JSON files. Returns: Li
obliteratus/community.py:174
↓ 11 callers
Function
load_dataset_source
Load prompts from a registered dataset source. Results are cached in-process — repeated calls for the same source return instantly without re
obliteratus/prompts.py:410
↓ 11 callers
Function
main
(argv: list[str] | None = None)
obliteratus/cli.py:89
↓ 11 callers
Method
probe_layer
Train and evaluate a linear probe at one layer. Args: harmful_activations: Activations from harmful prompts. harmless
obliteratus/analysis/probing_classifiers.py:106
↓ 10 callers
Function
_make_mock_pipeline
Build a mock pipeline with all fields the community module reads.
tests/test_community.py:23
↓ 10 callers
Method
_make_record
(self, model, method, refusal_rate, perplexity=None, coherence=None)
tests/test_community.py:304
↓ 10 callers
Function
_make_separable_activations
Create harmful/harmless activations that are linearly separable.
tests/test_causal_and_transfer.py:60
↓ 10 callers
Method
_probe
Collect activations for harmful, harmless, and optionally jailbreak prompts.
obliteratus/abliterate.py:1160
↓ 10 callers
Function
_reset_telemetry
()
tests/test_telemetry.py:32
↓ 10 callers
Method
decompose
Decompose residual stream into refusal contributions. Can work in two modes: 1. **Full decomposition** (with attn/mlp/head outputs):
obliteratus/analysis/residual_stream.py:117
↓ 10 callers
Function
ship_summary
(data: dict[str, Any] | None)
scripts/aspa_pareto_controller.py:97
↓ 10 callers
Method
trace_from_activations
Perform causal tracing using pre-collected activations. This is a simulation-based approach that doesn't require running the actual m
obliteratus/analysis/causal_tracing.py:101
↓ 9 callers
Function
_extract_score
Extract the primary score from an lm-eval task result dict. Uses explicit None-checking instead of ``or``-chains to avoid the bug where a leg
obliteratus/evaluation/heretic_eval.py:619
↓ 9 callers
Method
_get_model_device
Return the correct input device for a model. With accelerate ``device_map="auto"`` parameters can live on different devices, so ``nex
obliteratus/abliterate.py:991
↓ 9 callers
Function
_make_activations
Create harmful/harmless activations with planted refusal signal.
tests/test_new_analysis_modules.py:50
↓ 9 callers
Function
_make_category_activations
Create synthetic activations with planted per-category refusal directions. Each category gets its own refusal direction, with some shared compone
tests/test_novel_analysis.py:37
↓ 9 callers
Method
_make_direction
(self, hidden_dim=16)
tests/test_abliterate.py:452
↓ 9 callers
Function
_make_mock_model
Create a mock model with LM head and layer norm.
tests/test_logit_lens.py:18
↓ 9 callers
Function
_make_mock_tokenizer
Create a mock tokenizer.
tests/test_logit_lens.py:40
↓ 9 callers
Function
_make_refusal_directions
Create synthetic refusal directions with specified concentration pattern.
tests/test_novel_analysis.py:81
↓ 9 callers
Method
analyze
Learn category-selective projectors and analyze their geometry. Args: category_activations: {category_name: (n_samples, hidden_di
obliteratus/analysis/conditional_abliteration.py:111
↓ 9 callers
Method
certify
Certify abliteration completeness for one layer. Args: harmful_activations: (n_harmful, hidden_dim) post-abliteration
obliteratus/analysis/spectral_certification.py:144
↓ 9 callers
Method
enumerate
Return every possible ablation this strategy can perform on the model.
obliteratus/strategies/base.py:28
↓ 9 callers
Method
format_report
Format Tuned Lens analysis as a report.
obliteratus/analysis/tuned_lens.py:421
↓ 9 callers
Method
from_dict
(cls, d: dict)
obliteratus/config.py:72
↓ 9 callers
Function
refusal_rate_with_ci
Compute refusal rate with a Wilson score confidence interval.
obliteratus/evaluation/advanced_metrics.py:389
↓ 9 callers
Method
run_ssh
Run a command on the remote host. If stream=True, streams stdout/stderr in real-time and returns the exit code. Otherwise returns Com
obliteratus/remote.py:109
↓ 8 callers
Method
_collect_activations
Collect activations at each layer for a set of prompts. When cot_aware is enabled, collects activations at multiple token positions (
obliteratus/abliterate.py:1579
↓ 8 callers
Function
_config_fingerprint
Deterministic short hash of the method configuration.
obliteratus/community.py:58
↓ 8 callers
Method
_distill
Extract refusal subspace via SVD decomposition. For n_directions=1: equivalent to basic difference-in-means (Arditi et al.) For n_dir
obliteratus/abliterate.py:1693
↓ 8 callers
Function
_is_refusal_detailed
Check if a single response is a refusal, returning the match reason. Returns: Tuple of (is_refusal, reason). reason is a human-readable
obliteratus/evaluation/advanced_metrics.py:315
↓ 8 callers
Function
_load_model_to_device
Load a causal LM onto the best available device, MPS-safe. Accelerate's ``device_map="auto"`` is not supported on MPS — models silently land
app.py:102
↓ 8 callers
Function
_require_mlx
()
obliteratus/mlx_backend.py:46
↓ 8 callers
Method
_write_contrib
Write a minimal valid contribution file.
tests/test_community.py:239
↓ 8 callers
Method
analyze_cross_model
Analyze transfer between two models. Args: directions_a: {layer_idx: refusal_direction} from model A. directions_b: {
obliteratus/analysis/cross_model_transfer.py:127
↓ 8 callers
Function
arditi_refusal_rate
Compute refusal rate using the Zou et al. (2023) 29-substring list. Uses case-insensitive substring containment matching, consistent with the
obliteratus/evaluation/heretic_eval.py:242
↓ 8 callers
Method
build_asrg
Build the Adversarial Self-Repair Graph. Args: refusal_strengths: {layer_idx: refusal_signal_magnitude} for each
obliteratus/analysis/anti_ouroboros.py:118
↓ 8 callers
Function
effective_rank
Compute the effective rank of a weight matrix. Effective rank (Roy & Vetterli, 2007) measures intrinsic dimensionality via Shannon entropy of
obliteratus/evaluation/advanced_metrics.py:468
↓ 8 callers
Method
encode
(self, text, add_special_tokens=False)
tests/test_new_analysis_modules.py:103
↓ 8 callers
Function
is_mps
True when Apple Metal Performance Shaders backend is usable.
obliteratus/device.py:28
↓ 8 callers
Method
optimize
Run Bayesian optimization over projection configurations. Args: harmful_acts: {layer_idx: [activations]} from harmful prompts.
obliteratus/analysis/bayesian_kernel_projection.py:109
↓ 7 callers
Function
_direction_stats
Extract direction quality statistics from a pipeline.
obliteratus/telemetry.py:963
↓ 7 callers
Function
_get_vram_html
Return an HTML snippet showing GPU/accelerator memory usage as a styled bar.
app.py:872
↓ 7 callers
Function
_get_watchtower
()
obliteratus/ui_watchtower.py:29
↓ 7 callers
Function
_make_category_activations
Create per-category harmful activations with distinct directions.
tests/test_breakthrough_modules.py:84
↓ 7 callers
Function
_make_mock_model_and_tokenizer
Create mock model and tokenizer for benchmark testing.
tests/test_benchmarks.py:19
↓ 7 callers
Function
_make_multilayer_activations
Create per-layer activations with planted refusal signals.
tests/test_new_analysis_modules.py:69
↓ 7 callers
Function
_model_short_name
Extract a filesystem-safe short name from a HuggingFace model ID.
obliteratus/community.py:49
↓ 7 callers
Method
_orthogonalize_subspace
Orthogonalize rows of a subspace matrix via QR decomposition. Replaces the duplicated Gram-Schmidt nested loops with a single QR call
obliteratus/abliterate.py:2606
↓ 7 callers
Method
_sample_aggregated
(self)
tests/test_community.py:394
next →
1–100 of 1,841, ranked by callers