def get_derived_scalars_for_prompt(
    model_context: StandardModelContext,
    dst_and_config_list: list[
        tuple[DerivedScalarType, DstConfig | None]
    ],  # None -> default config for dst
    prompt: str,
    loss_fn_for_backward_pass: Callable[[torch.Tensor], torch.Tensor] | None = None,
    trace_config: TraceConfig | None = None,
    autoencoder_context: MultiAutoencoderContext | AutoencoderContext | None = None,
    ablation_specs: list[AblationSpec] = [],
) -> tuple[DerivedScalarStore, InferenceAndTokenData, RawActivationStore]:
    """
    Lightweight function to populate a DerivedScalarStore given information specifying the prompt, loss function, and derived scalars to compute.
    """
    multi_autoencoder_context = MultiAutoencoderContext.from_context_or_multi_context(
        autoencoder_context
    )

    input_token_ints = model_context.encode(prompt)
    input_token_strings = [model_context.decode_token(token_int) for token_int in input_token_ints]

    dst_and_config_list_with_default_config = apply_default_dst_configs_to_dst_and_config_list(
        model_context, multi_autoencoder_context, dst_and_config_list
    )

    multi_group_scalar_derivers_by_processing_step = {
        "dummy": MultiGroupScalarDerivers.from_dst_and_config_list(
            dst_and_config_list_with_default_config
        )
    }  # "dummy" is a placeholder processing step name

    ds_computation_params = DerivedScalarComputationParams(
        input_token_ints=input_token_ints,
        multi_group_scalar_derivers_by_processing_step=multi_group_scalar_derivers_by_processing_step,
        loss_fn_for_backward_pass=loss_fn_for_backward_pass,
        device_for_raw_activations=model_context.device,
        trace_config=trace_config,
        ablation_specs=ablation_specs,
    )
    batched_multi_group_ds_store_by_processing_step: list[dict[str, MultiGroupDerivedScalarStore]]
    (
        batched_multi_group_ds_store_by_processing_step,
        batched_inference_data,
        batched_raw_activation_store,
    ) = compute_derived_scalar_groups_for_input_token_ints(
        model_context=model_context,
        multi_autoencoder_context=multi_autoencoder_context,
        batched_ds_computation_params=[ds_computation_params],
    )
    ds_store = batched_multi_group_ds_store_by_processing_step[0]["dummy"].to_single_ds_store()
    inference_data = batched_inference_data[0]
    inference_and_token_data = InferenceAndTokenData(
        **inference_data.dict(),
        tokens_as_ints=input_token_ints,
        tokens_as_strings=input_token_strings,
    )
    raw_activation_store = batched_raw_activation_store[0]

    return ds_store, inference_and_token_data, raw_activation_store

    Lightweight function to populate a DerivedScalarStore given information specifying the prompt, loss function, and derived scalars to compute.
    
neuron_explainer/activation_server/derived_scalar_computation.py