Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TransluceAI/observatory
/ functions
Functions
1,028 in github.com/TransluceAI/observatory
⨍
Functions
1,028
◇
Types & classes
364
↳
Endpoints
7
↓ 99 callers
Function
cn
(...inputs: ClassValue[])
project/monitor/web/lib/utils.ts:4
↓ 92 callers
Method
items
Iterate over (key, item) tuples
project/latentqa/latentqa/model_wrapper.py:73
↓ 90 callers
Function
dispatch
(action: Action)
project/monitor/web/hooks/use-toast.ts:136
↓ 77 callers
Method
get
Get an item for the given layer and module
project/latentqa/latentqa/model_wrapper.py:53
↓ 56 callers
Method
to
( self, device: str | torch.device | None = None, dtype: torch.dtype | None = None )
lib/util/util/activations.py:16
↓ 47 callers
Method
add
Add a batched tensor for the given layer and module
project/latentqa/latentqa/model_wrapper.py:137
↓ 45 callers
Method
keys
Get all layer module keys
project/latentqa/latentqa/model_wrapper.py:69
↓ 37 callers
Method
update
(self, new_metadata: ExplanationGenerationMetadata)
lib/explanations/explanations/explanations.py:70
↓ 33 callers
Method
format
(self, record: logging.LogRecord)
lib/log_util/log_util/logger.py:57
↓ 25 callers
Method
_stringify_field
(self, value: Any)
project/user_modeling/user_modeling/db_wrapper.py:131
↓ 23 callers
Method
apply_chat_template
(self, messages: List[ChatMessage], *args: Any, **kwargs: Any)
lib/explanations/explanations/llama_model.py:80
↓ 23 callers
Method
get
Get cached completion for a conversation if it exists.
lib/llm_util/llm_util/llm_cache.py:87
↓ 20 callers
Method
decode
(self, token_ids: int | list[int] | torch.Tensor)
lib/util/util/subject.py:217
↓ 17 callers
Method
repeat_interleave
Repeat each element in the activation lists n times before moving to the next element. This is equivalent to the pattern: [p
project/latentqa/latentqa/model_wrapper.py:390
↓ 14 callers
Method
get_db
(self)
project/user_modeling/user_modeling/db_wrapper.py:111
↓ 13 callers
Method
batch_size
Get the batch size (validates consistency across all tensors)
project/latentqa/latentqa/model_wrapper.py:158
↓ 13 callers
Method
get
Example usage: ```python neurons = db.get( SQLANeuronDescription, filter=and_(SQLANeuron.layer == 5,
lib/neurondb/neurondb/postgres.py:99
↓ 12 callers
Function
addLinterMessage
(state, action: PayloadAction<LinterMessage>)
project/monitor/web/app/store/slices/aiLinterSlice.ts:97
↓ 11 callers
Function
pad_sequence
Pad a list of sequences to the same length and return input_ids and attention_mask tensors. If `max_length` is provided, AND if the `max_len
project/user_modeling/user_modeling/padding_util.py:4
↓ 11 callers
Method
set
Cache a completion for a conversation.
lib/llm_util/llm_util/llm_cache.py:122
↓ 11 callers
Function
setSelectedTokenRange
(state, action: PayloadAction<[number, number] | undefined>)
project/monitor/web/app/store/slices/neuronsSlice.ts:67
↓ 10 callers
Method
_build_where_clause
Construct a ``WHERE`` clause (plus its bound parameters) from the given ``conditions`` mapping. - scalar → equality check (``col = ?
project/user_modeling/user_modeling/db_wrapper.py:157
↓ 10 callers
Function
toast
({ ...props }: Toast)
project/monitor/web/hooks/use-toast.ts:145
↓ 9 callers
Method
filter
(self)
lib/neurondb/neurondb/view.py:113
↓ 9 callers
Function
get_dataloader
( data: list[LQAData] | list[MinimalDatapoint], hf_model_id: str, tokenizer: PreTrainedTokenizer,
project/latentqa/latentqa/train_util.py:312
↓ 9 callers
Method
get_modules
(self, keys: Sequence[LayerModuleKey])
project/latentqa/latentqa/model_wrapper.py:458
↓ 8 callers
Method
concat
Concatenate multiple ActivationsList into a single ActivationsList
project/latentqa/latentqa/model_wrapper.py:290
↓ 8 callers
Function
get_logger
Get a colored logger for the specified namespace. Args: namespace: The namespace for the logger Returns: A configured l
lib/log_util/log_util/logger.py:117
↓ 8 callers
Function
renderStatsCard
(title: string, value: number, total: number)
project/monitor/web/app/dashboard/status/page.tsx:43
↓ 8 callers
Method
tokenize
(self, text: str)
lib/util/util/subject.py:203
↓ 8 callers
Function
useDebounce
(value: T, delay: number)
project/monitor/web/hooks/use-debounce.ts:3
↓ 7 callers
Function
_make_neuron
(l: int, n: int, p: NeuronPolarity | None, t: int | None)
lib/neurondb/neurondb/view.py:578
↓ 7 callers
Function
get_llm_completion_strs_async
( messages_list: list[list[dict[str, Any]]], config: DataGeneratorConfig, use_cache: bool = False,
project/user_modeling/user_modeling/llm_util.py:30
↓ 7 callers
Method
get_time_str
(self)
project/user_modeling/user_modeling/db_wrapper.py:187
↓ 6 callers
Function
complete_async
Single-call convenience wrapper around ``get_llm_completions_async``. Returns a single ``LLMOutput`` instead of a list.
lib/llm_util/llm_util/prod_llms.py:397
↓ 6 callers
Method
convert_row_to_obj
(self, row: list[Any])
project/user_modeling/user_modeling/db_wrapper.py:199
↓ 6 callers
Method
forward
(self, batch: Dict[str, torch.Tensor])
lib/explanations/explanations/llama_model.py:133
↓ 6 callers
Method
forward_with_intervention
( self, activations: Union[Activations, ActivationsList], token_range_from: list[tuple
project/latentqa/latentqa/model_wrapper.py:583
↓ 6 callers
Function
get_llm_completions_async
( messages_list: list[list[ChatMessage]], model_category: str, max_new_tokens: int = 32, tempe
lib/util/util/prod_llms.py:122
↓ 6 callers
Method
get_neuron_scored_explanations
Loads NeuronExplanations for given neuron if it exists.
lib/explanations/explanations/explanations_wrapper.py:416
↓ 6 callers
Method
get_sync_db
(self)
project/user_modeling/user_modeling/db_wrapper.py:119
↓ 6 callers
Method
insert_batch
Insert a batch of model instances. All rows share the same ``batch_time``. ``batch_time`` defaults to current UTC ISO timestamp.
project/user_modeling/user_modeling/db_wrapper.py:282
↓ 6 callers
Method
iterrows
Asynchronously iterate over rows that satisfy ``conditions``, yielding Pydantic objects one-by-one.
project/user_modeling/user_modeling/db_wrapper.py:375
↓ 6 callers
Function
load_lqa_data
(data_path: str | os.PathLike, cls: Type[LQAData] = LQAData)
project/latentqa/latentqa/lqa_data.py:529
↓ 6 callers
Function
parse_chat_message
(message_data: dict[str, Any])
lib/llm_util/llm_util/types.py:196
↓ 6 callers
Function
setSteeringDialogSpec
(state, action: PayloadAction<SteeringSpec | null | undefined>)
project/monitor/web/app/store/slices/uiStateSlice.ts:57
↓ 6 callers
Method
sync_iterrows
(self, **conditions: Any)
project/user_modeling/user_modeling/db_wrapper.py:359
↓ 5 callers
Method
_get_connection
(self)
lib/llm_util/llm_util/llm_cache.py:40
↓ 5 callers
Function
_parse_message_content
( content: str | list[Content], )
lib/llm_util/llm_util/openai.py:64
↓ 5 callers
Method
apply
(text: str, color: ColorCode)
lib/log_util/log_util/logger.py:31
↓ 5 callers
Function
compute_exemplars_for_layer
( exemplars_wrapper: ExemplarsWrapper, layer: int, split: ExemplarSplit, save_every: int = 100
lib/activations/activations/exemplars_computation.py:141
↓ 5 callers
Function
finalize_llm_output_partial
(partial: LLMOutputPartial)
lib/llm_util/llm_util/types.py:366
↓ 5 callers
Method
from_disk
(cls, db_dir: str, read_only: bool = True)
project/user_modeling/user_modeling/synthsys/faithfulness_eval.py:227
↓ 5 callers
Function
generate_mc_qas_for_attr
Used for experiments for blog post.
project/latentqa/scripts/prepare_lqa_datasets.py:36
↓ 5 callers
Method
get_layer_data
Loads exemplar data for a layer.
lib/activations/activations/exemplars_wrapper.py:687
↓ 5 callers
Method
get_layer_dir
(self, layer: int, split: ExemplarSplit)
lib/activations/activations/exemplars_wrapper.py:408
↓ 5 callers
Method
get_neuron_exemplars
Returns NeuronExemplars for a neuron, given a split.
lib/activations/activations/exemplars_wrapper.py:760
↓ 5 callers
Function
get_num_patch_tokens_multiplier
Support for a single write layer to read from multiple read layers ("flattening").
project/latentqa/latentqa/train_util.py:294
↓ 5 callers
Method
get_read_layer_module_keys
(self)
project/latentqa/latentqa/train_util.py:266
↓ 5 callers
Function
get_subject_config
(hf_model_id: str)
lib/util/util/subject.py:686
↓ 5 callers
Function
setSelectedAttributionToken
(state, action: PayloadAction<number | undefined>)
project/monitor/web/app/store/slices/neuronsSlice.ts:76
↓ 5 callers
Method
share_memory_
(self)
lib/util/util/activations.py:52
↓ 5 callers
Method
sync_iterrows_raw
(self, **conditions: Any)
project/user_modeling/user_modeling/db_wrapper.py:367
↓ 4 callers
Function
_ct
(x: Any)
lib/util/util/subject.py:20
↓ 4 callers
Method
_validate_chat
Checks that: - Role/content formatting is correct - Chat starts with system or user - Chat alternates between system/
lib/util/util/chat_input.py:171
↓ 4 callers
Method
compute_cost
All costs are in dollars per million tokens.
lib/llm_util/llm_util/types.py:297
↓ 4 callers
Method
compute_lr
(self, step: int)
project/latentqa/latentqa/train_util.py:67
↓ 4 callers
Function
construct_mc_options_for_eval
Construct multiple choice options for evaluation data. Uses uppercase letters (A, B, C, ...) as labels with period delimiter (e.g., "A. Opti
project/latentqa/latentqa/mc_util.py:150
↓ 4 callers
Function
format_example
Assumes activations are normalized and discretized to the range [0, 10].
lib/explanations/explanations/few_shot_examples.py:28
↓ 4 callers
Method
generate
Generate text using the model with optional neuron and hidden state interventions.
lib/util/util/subject.py:327
↓ 4 callers
Function
get_decoder_model
( hf_model_id: str, tokenizer: PreTrainedTokenizer, use_peft: bool, use_fsdp: bool, device
project/latentqa/latentqa/train_util.py:469
↓ 4 callers
Method
get_layer_mapping
(self)
project/latentqa/latentqa/train_util.py:278
↓ 4 callers
Method
get_preferred_score
This method may return None in cases where the score is undefined, for example if the normalized activations were all zero, yielding
lib/explanations/explanations/explanations.py:134
↓ 4 callers
Function
get_subject_model
( hf_model_id: str, use_fsdp: bool, device: str, inference_only: bool = False, fsdp_config
project/latentqa/latentqa/train_util.py:439
↓ 4 callers
Function
get_tokenizer
(hf_model_id: str, new_tokens: list[str] | None = None)
project/latentqa/latentqa/train_util.py:302
↓ 4 callers
Function
get_total_loss_over_dataset
( parameters: Activations, dataloader, propagate_grad=True, )
project/latentqa/latentqa/eval/steering_eval.py:73
↓ 4 callers
Method
get_write_layer_module_keys
(self)
project/latentqa/latentqa/train_util.py:272
↓ 4 callers
Function
handleChatSubmit
(message: string | null = inputValue)
project/monitor/web/app/dashboard/chat/components/ChatArea.tsx:271
↓ 4 callers
Function
load_checkpoint_eval_results
Load reading eval results from a jsonl file. If there are any duplicate results for the same data_id, keep the latest result.
project/latentqa/latentqa/eval/reading_eval.py:404
↓ 4 callers
Function
resolve_attr
s is the output of calling str(UserAttribute)
project/user_modeling/user_modeling/user_attribute.py:2271
↓ 4 callers
Function
run_belief_evaluation
Run belief evaluation on a subject model and save results to a database. Instantiates the appropriate evaluator based on the eval type (gene
project/user_modeling/user_modeling/belief_eval.py:1119
↓ 4 callers
Method
save_config
(self)
project/latentqa/latentqa/config_util.py:28
↓ 4 callers
Function
setDescriptionKeywordFilter
(state, action: PayloadAction<string | undefined>)
project/monitor/web/app/store/slices/neuronsSlice.ts:85
↓ 4 callers
Function
setGlobalNeuronFilter
(state, action: PayloadAction<NeuronFilter | undefined>)
project/monitor/web/app/store/slices/neuronsSlice.ts:61
↓ 4 callers
Function
setSelectedClusterId
(state, action: PayloadAction<string | undefined>)
project/monitor/web/app/store/slices/aiLinterSlice.ts:85
↓ 4 callers
Function
setTableHighlightedNeuronIds
(state, action: PayloadAction<string[] | undefined>)
project/monitor/web/app/store/slices/neuronsSlice.ts:88
↓ 4 callers
Method
set_filter
Set and apply a new filter. You may presume that the neuron mask is always fresh, since it's updated when the filter is set.
lib/neurondb/neurondb/view.py:240
↓ 4 callers
Method
tokenize
(self, subject: "Subject")
lib/util/util/chat_input.py:47
↓ 3 callers
Method
__init__
(self, **kwargs: Any)
lib/neurondb/neurondb/schemas/tables.py:45
↓ 3 callers
Method
_create_key
Create a deterministic hash key from messages and model.
lib/llm_util/llm_util/llm_cache.py:47
↓ 3 callers
Function
_pad_and_truncate
(l: list[int], pad_int: int)
lib/util/util/dataset.py:47
↓ 3 callers
Method
add_messages
(self, messages: list[ChatMessage])
lib/util/util/chat_input.py:249
↓ 3 callers
Method
apply_lr_to_optimizer
(self, lr: float)
project/latentqa/latentqa/train_util.py:79
↓ 3 callers
Method
decode
(self, *args: Any, **kwargs: Any)
lib/explanations/explanations/llama_model.py:97
↓ 3 callers
Function
format_activation_records_for_one_act_sign
( act_recs: List[ActivationRecord], act_thresh: float, sign: ActivationSign )
lib/explanations/explanations/explanation_utils.py:110
↓ 3 callers
Method
get_activation_records
( self, rng: random.Random, normalize: bool = False, include_ranks: bool = Fal
lib/explanations/explanations/explanation_utils.py:199
↓ 3 callers
Function
get_activations_computing_func
Returns a function that computes activations for a given input: input_ids: torch.Tensor attn_mask: torch.Tensor
lib/activations/activations/activations_computation.py:7
↓ 3 callers
Method
get_all_unique_keys
(self, **conditions: Any)
project/user_modeling/user_modeling/synthsys/faithfulness_eval.py:440
↓ 3 callers
Method
get_datasets
Returns a list of PyTorch Datasets one for each HuggingFace dataset.
lib/activations/activations/exemplars_wrapper.py:576
↓ 3 callers
Function
get_generators
( dataloader: DataLoader[Any], )
lib/activations/activations/exemplars_computation.py:131
next →
1–100 of 1,028, ranked by callers