# Reference

## Everyday

What a fit needs, from the model to the predictive.

### Fit and predict

|  |  |
|----|----|
| [laplace](../reference/laplace.llms.md#laplacekit.laplace) | Fit a Laplace approximation in weight space, then tune its hyperparameters. |
| [predict](../reference/predict.llms.md#laplacekit.predict) | Predictive distribution over targets, observation noise included. |
| [predict_outputs](../reference/predict_outputs.llms.md#laplacekit.predict_outputs) | Linearized pushforward of a posterior, $\mathcal{N}(f(x; \mu), J \Sigma J^\top)$. |
| [sample_outputs](../reference/sample_outputs.llms.md#laplacekit.sample_outputs) | `n_samples` draws of the model’s outputs at `inputs`, stacked along a new leading axis. |
| [save](../reference/save.llms.md#laplacekit.save) | Write a posterior (or any `@pytree` object) to a file, without its model. |
| [load](../reference/load.llms.md#laplacekit.load) | Read a file written by `save`, attaching `model`. |
| [replace](../reference/replace.llms.md#laplacekit.replace) | A copy of `obj` with some fields changed, as `copy.replace` in Python 3.13. |

### Likelihoods

|  |  |
|----|----|
| [Categorical](../reference/Categorical.llms.md#laplacekit.Categorical) | Softmax likelihood over a class axis of $f$. |
| [Bernoulli](../reference/Bernoulli.llms.md#laplacekit.Bernoulli) | Sigmoid likelihood: each entry of $f$ is the logit of an independent 0/1 target. |
| [Gaussian](../reference/Gaussian.llms.md#laplacekit.Gaussian) | Independent Gaussian noise over the last `event_dims` dims of $f$. |

### Priors

|  |  |
|----|----|
| [priors.Isotropic](../reference/priors.Isotropic.llms.md#laplacekit.priors.Isotropic) | Isotropic Gaussian prior $\mathcal{N}(\mu, \lambda^{-1} I)$ over all parameters. |
| [priors.Diagonal](../reference/priors.Diagonal.llms.md#laplacekit.priors.Diagonal) | Diagonal Gaussian prior $\mathcal{N}(\mu, \operatorname{diag}(\lambda)^{-1})$. |
| [priors.Layerwise](../reference/priors.Layerwise.llms.md#laplacekit.priors.Layerwise) | Gaussian prior with one precision per block, $\prod_b \mathcal{N}(\mu_b, \lambda_b^{-1} I)$. |
| [priors.KronSum](../reference/priors.KronSum.llms.md#laplacekit.priors.KronSum) | A chain of KFAC posteriors as the prior of a KFAC fit, by summing Kronecker factors. |
| [priors.LowRankSum](../reference/priors.LowRankSum.llms.md#laplacekit.priors.LowRankSum) | A chain of `LowRankGGN` posteriors as the prior of a `LowRankGGN` fit, cut to a fixed rank. |

### Subsets

|  |  |
|----|----|
| [subsets.all](../reference/subsets.all.llms.md#laplacekit.subsets.all) | Every parameter of the module. |
| [subsets.trainable](../reference/subsets.trainable.llms.md#laplacekit.subsets.trainable) | Parameters with `requires_grad=True`, e.g. LoRA adapters. |
| [subsets.last_layer](../reference/subsets.last_layer.llms.md#laplacekit.subsets.last_layer) | Own parameters of the last parameterized module that ran in the probe. |
| [subsets.named](../reference/subsets.named.llms.md#laplacekit.subsets.named) | Parameters whose name matches any of the glob patterns. |
| [subsets.from_mask](../reference/subsets.from_mask.llms.md#laplacekit.subsets.from_mask) | The entries where each bool mask is `True`. |

### Subnetworks

The `laplacekit-subnet` plugin, reached as `lk.subnet`.

|  |  |
|----|----|
| [laplacekit_subnet](../reference/laplacekit_subnet.llms.md#laplacekit_subnet) | Subnetwork Laplace (Daxberger et al. 2021): the approximation over `n` chosen weight entries. |

### Heteroscedastic regression

The `laplacekit-heteroscedastic` plugin, reached as `lk.heteroscedastic`.

|  |  |
|----|----|
| [laplacekit_heteroscedastic](../reference/laplacekit_heteroscedastic.llms.md#laplacekit_heteroscedastic) | Heteroscedastic regression, with Gaussian likelihoods whose variance depends on the input. |

### Reward models

The `laplacekit-reward` plugin, reached as `lk.reward`.

|  |  |
|----|----|
| [laplacekit_reward](../reference/laplacekit_reward.llms.md#laplacekit_reward) | Laplace on reward models trained on preference pairs with Bradley–Terry. |

### Curvature

|  |  |
|----|----|
| [DiagGGN](../reference/DiagGGN.llms.md#laplacekit.DiagGGN) | Diagonal of the GGN, $C_n = \operatorname{diag}(J_n^\top H_n J_n)$. |
| [DenseGGN](../reference/DenseGGN.llms.md#laplacekit.DenseGGN) | Dense GGN, $C_n = J_n^\top H_n J_n$, with $J_n$ from `jacrev`. |
| [DenseHessian](../reference/DenseHessian.llms.md#laplacekit.DenseHessian) | Exact Hessian of the negative log-likelihood at the batch’s targets. |
| [LowRankGGN](../reference/LowRankGGN.llms.md#laplacekit.LowRankGGN) | Low-rank GGN over all fitted blocks jointly, from a Nyström sketch. |
| [KFAC](../reference/KFAC.llms.md#laplacekit.KFAC) | Kronecker-factored GGN per Linear / Conv2d layer, computed by Curvlinops. |
| [per_block](../reference/per_block.llms.md#laplacekit.per_block) | A method per block; the first rule matching a block wins. |
| [curvature.default](../reference/curvature.default.llms.md#laplacekit.curvature.default) | A method per block, from the probe. |

### Predictive

|  |  |
|----|----|
| [Linearized](../reference/Linearized.llms.md#laplacekit.Linearized) | Linearize the model at the mean, push the weight-space posterior to outputs, apply a link. |
| [predictive.Exact](../reference/predictive.Exact.llms.md#laplacekit.predictive.Exact) | Gaussian outputs plus observation noise: $\mathcal{N}(\bar f_i, V_{ii} + \sigma^2)$. |
| [WeightSamples](../reference/WeightSamples.llms.md#laplacekit.WeightSamples) | Sample weights from the posterior and average the predictive over the samples. |
| [MC](../reference/MC.llms.md#laplacekit.MC) | Average over Gaussian draws of the outputs. |
| [Probit](../reference/Probit.llms.md#laplacekit.Probit) | Moderated softmax, or moderated sigmoid, by the probit approximation. |
| [Bridge](../reference/Bridge.llms.md#laplacekit.Bridge) | The Laplace bridge: a Dirichlet over the class probabilities, matched to the logits. |

### Tuning

|  |  |
|----|----|
| [tune](../reference/tune.llms.md#laplacekit.tune) | Tune a fitted posterior’s hyperparameters, without refitting. |
| [MarginalLikelihood](../reference/MarginalLikelihood.llms.md#laplacekit.MarginalLikelihood) | Maximize the Laplace marginal likelihood of the fit data. The default tuner. |
| [Minimize](../reference/Minimize.llms.md#laplacekit.Minimize) | Minimize an objective over every hyperparameter, with L-BFGS on their logs. |
| [GridSearch](../reference/GridSearch.llms.md#laplacekit.GridSearch) | Set the prior precision to the value from a grid that minimizes an objective. |
| [tuning.HyperTuner](../reference/tuning.HyperTuner.llms.md#laplacekit.tuning.HyperTuner) | Tunes the hyperparameters of a posterior: its prior precision, a learned `sigma`. |
| [objectives.neg_log_marglik](../reference/objectives.neg_log_marglik.llms.md#laplacekit.objectives.neg_log_marglik) | Laplace negative log marginal likelihood of the fit data, `-post.log_marglik()`. |
| [objectives.predictive_nll](../reference/objectives.predictive_nll.llms.md#laplacekit.objectives.predictive_nll) | Mean negative log predictive density of the batches’ targets, per example. |
| [objectives.brier](../reference/objectives.brier.llms.md#laplacekit.objectives.brier) | Brier score: the squared error between predictive probabilities and targets, per example. |
| [objectives.ece](../reference/objectives.ece.llms.md#laplacekit.objectives.ece) | Expected calibration error with equal-width bins, positions pooled. |

### Function space

Function-space (GP) Laplace, as `laplacekit.function_space`.

|  |  |
|----|----|
| [function_space.laplace](../reference/function_space.laplace.llms.md#laplacekit.function_space.laplace) | Function-space Laplace: probe, pick a subset of parameters, run the method’s passes. |
| [function_space.SubsetOfData](../reference/function_space.SubsetOfData.llms.md#laplacekit.function_space.SubsetOfData) | A subset-of-data GP: condition on $m$ training inputs drawn uniformly without replacement. |
| [function_space.SubsetGP](../reference/function_space.SubsetGP.llms.md#laplacekit.function_space.SubsetGP) | A GP over the outputs, conditioned on the outputs at a subset of $m$ training inputs. |
| [function_space.FunctionSpaceMethod](../reference/function_space.FunctionSpaceMethod.llms.md#laplacekit.function_space.FunctionSpaceMethod) | A function-space method: passes over the data that end in the posterior itself. |
| [function_space.rows_of](../reference/function_space.rows_of.llms.md#laplacekit.function_space.rows_of) | The examples `index` of `inputs`. |
| [function_space.is_shared](../reference/function_space.is_shared.llms.md#laplacekit.function_space.is_shared) | Whether an inputs leaf is shared by every example: a non-tensor or a 0-dim tensor. |
| [function_space.jacobian](../reference/function_space.jacobian.llms.md#laplacekit.function_space.jacobian) | The Jacobian of the flattened outputs with respect to `params`. |
| [function_space.cov_rows](../reference/function_space.cov_rows.llms.md#laplacekit.function_space.cov_rows) | $\Sigma_0 r$ for each row $r$ of `rows`, through `prior.cov_mv` under `vmap`. |

### GP methods

The `laplacekit-gp` plugin, reached as `lk.gp`.

|  |  |
|----|----|
| [laplacekit_gp](../reference/laplacekit_gp.llms.md#laplacekit_gp) | GP methods for function-space Laplace: ELLA, VaLLA and FSP-Laplace. |
| [laplacekit_gp.Kernel](../reference/laplacekit_gp.Kernel.llms.md#laplacekit_gp.Kernel) | A covariance function $k$, evaluated between two batches of inputs. |

### Marglik training

The `laplacekit-marglik` plugin, reached as `lk.marglik`.

|  |  |
|----|----|
| [laplacekit_marglik](../reference/laplacekit_marglik.llms.md#laplacekit_marglik) | Marginal-likelihood training (Immer et al. 2021). |

### Library integrations

Plugin packages, reached as `lk.transformers` and `lk.diffusers`.

|  |  |
|----|----|
| [laplacekit_transformers](../reference/laplacekit_transformers.llms.md#laplacekit_transformers) | Laplace-LoRA on Hugging Face `transformers` models: causal LMs and sequence classifiers. |
| [laplacekit_diffusers](../reference/laplacekit_diffusers.llms.md#laplacekit_diffusers) | Laplace on denoisers from Hugging Face `diffusers`. |

### Plugins and health

|  |  |
|----|----|
| [plugins](../reference/plugins.llms.md#laplacekit.plugins) | List the plugins registered under `laplacekit.plugins`, by distribution name. |
| [health](../reference/health.llms.md#laplacekit.health) | Check the install: the core, then each plugin registered under `laplacekit.plugins`. |

## Building blocks

The contracts and machinery that plugins and by-hand fits use.

### Fitting by hand

|  |  |
|----|----|
| [core.fit_curvature](../reference/core.fit_curvature.llms.md#laplacekit.core.fit_curvature) | Bind a model, likelihood, params and curvature method for fitting. |
| [core.run](../reference/core.run.llms.md#laplacekit.core.run) | Run every pass of `fit` over `data`, under `no_grad`. |
| [core.chain](../reference/core.chain.llms.md#laplacekit.core.chain) | A type-safe pass. |
| [core.CurvatureFit](../reference/core.CurvatureFit.llms.md#laplacekit.core.CurvatureFit) | A model, likelihood, params and single-pass method bound for fitting. |
| [core.Staged](../reference/core.Staged.llms.md#laplacekit.core.Staged) | A weight-space method needing several passes. |
| [core.StagedCurvatureFit](../reference/core.StagedCurvatureFit.llms.md#laplacekit.core.StagedCurvatureFit) | A model, likelihood, params and multi-pass method bound for fitting. |
| [core.Pass](../reference/core.Pass.llms.md#laplacekit.core.Pass) | Run `curvature` over the data, then call `then` with its result. |
| [core.Running](../reference/core.Running.llms.md#laplacekit.core.Running) | One pass of a fit in progress. |
| [core.Done](../reference/core.Done.llms.md#laplacekit.core.Done) | The last step of a `Staged` plan. |
| [core.Finished](../reference/core.Finished.llms.md#laplacekit.core.Finished) | A completed fit. |
| [core.FitContext](../reference/core.FitContext.llms.md#laplacekit.core.FitContext) | What every pass knows about the fit, fixed for its duration. |
| [core.FitStat](../reference/core.FitStat.llms.md#laplacekit.core.FitStat) | The curvature statistic plus what objectives need from the same pass. |

### Data and models

`Params` is the type alias `Mapping[str, Tensor]`: parameters by name.

|  |  |
|----|----|
| [data.from_loader](../reference/data.from_loader.llms.md#laplacekit.data.from_loader) | Wrap an iterable of raw items, one batch each. |
| [data.as_data](../reference/data.as_data.llms.md#laplacekit.data.as_data) | The `Data` source for any data form `lk.laplace` accepts. |
| [data.Data](../reference/data.Data.llms.md#laplacekit.data.Data) | A data source: `data(generator)` returns the batches of one pass. |
| [Batch](../reference/Batch.llms.md#laplacekit.Batch) | What `prepare` produces and `update` consumes. |
| [core.spawn_generator](../reference/core.spawn_generator.llms.md#laplacekit.core.spawn_generator) | Draw one seed and return a fresh generator seeded with it. |
| [core.generator_for_batch](../reference/core.generator_for_batch.llms.md#laplacekit.core.generator_for_batch) | Give the batch that starts at example `count` of a pass its own generator. |
| [core.ModelFn](../reference/core.ModelFn.llms.md#laplacekit.core.ModelFn) | `forward(params, inputs) -> outputs`, plus the module when there is one. |
| [core.Selection](../reference/core.Selection.llms.md#laplacekit.core.Selection) | Some entries of some parameters, each turned into its own 1-D parameter. |
| [core.select](../reference/core.select.llms.md#laplacekit.core.select) | The model and parameters to fit. |
| [core.Subset](../reference/core.Subset.llms.md#laplacekit.core.Subset) | Chooses which parameters get a posterior. |
| [distributed.all_reduce](../reference/distributed.all_reduce.llms.md#laplacekit.distributed.all_reduce) | Combine a statistic across the ranks of `group`. |

### Posteriors

`Posterior` is the type alias `WeightPosterior | FunctionPosterior`.

|  |  |
|----|----|
| [core.Prior](../reference/core.Prior.llms.md#laplacekit.core.Prior) | Anything that can be the prior of a Laplace update. |
| [core.PriorWithCovariance](../reference/core.PriorWithCovariance.llms.md#laplacekit.core.PriorWithCovariance) | A prior that the predictives can push forward, because it multiplies by its covariance. |
| [core.WeightPosterior](../reference/core.WeightPosterior.llms.md#laplacekit.core.WeightPosterior) | A fitted weight-space Gaussian $\mathcal{N}(\mu, \Sigma)$ over the parameters in `mean`. |
| [core.HasCovMany](../reference/core.HasCovMany.llms.md#laplacekit.core.HasCovMany) | A weight-space posterior whose covariance products take many vectors in one call. |
| [core.HasVersions](../reference/core.HasVersions.llms.md#laplacekit.core.HasVersions) | A posterior that can tell when it no longer describes the model. |
| [LaplacePosterior](../reference/LaplacePosterior.llms.md#laplacekit.LaplacePosterior) | The result of a Laplace update: the prior precision plus the scaled curvature. |
| [core.FunctionPosterior](../reference/core.FunctionPosterior.llms.md#laplacekit.core.FunctionPosterior) | A posterior over the model’s outputs, evaluated at inputs. |
| [core.OutputGaussian](../reference/core.OutputGaussian.llms.md#laplacekit.core.OutputGaussian) | Gaussian over model outputs (not targets: no observation noise). |
| [core.Layout](../reference/core.Layout.llms.md#laplacekit.core.Layout) | Parameter names grouped into blocks, and each parameter’s shape. |
| [core.TunablePrior](../reference/core.TunablePrior.llms.md#laplacekit.core.TunablePrior) | A prior whose precision the hyper tuners tune (`lk.MarginalLikelihood`, say). |
| [core.HasExpand](../reference/core.HasExpand.llms.md#laplacekit.core.HasExpand) | A prior with one shared precision that can expand to one per block or per weight. |

### Covariances

|  |  |
|----|----|
| [core.OutputCov](../reference/core.OutputCov.llms.md#laplacekit.core.OutputCov) | Covariance of model outputs for a batch of inputs, never formed as an $NE \times NE$ matrix. |
| [core.SampleCov](../reference/core.SampleCov.llms.md#laplacekit.core.SampleCov) | Zero-mean draws $J z_s$, $z_s \sim \mathcal{N}(0, \Sigma)$. For large output events. |
| [core.FactorCov](../reference/core.FactorCov.llms.md#laplacekit.core.FactorCov) | Low-rank covariance $F F^\top$ per input. |
| [core.PerInputCov](../reference/core.PerInputCov.llms.md#laplacekit.core.PerInputCov) | Dense `[N, E, E]` blocks, one per input. Fine for classifiers with small C. |

### Curvature contracts

`HessianApprox[Op]` is the type alias `Curvature[Any, Op] | Staged[Op]`: what `hessian_approx=` takes.

|  |  |
|----|----|
| [core.Curvature](../reference/core.Curvature.llms.md#laplacekit.core.Curvature) | One pass over the data, a fold of batches into a statistic `S`. |
| [core.Stat](../reference/core.Stat.llms.md#laplacekit.core.Stat) | A statistic that merges under `+`, a monoid with the curvature’s `init` as identity. |
| [core.HasTemplate](../reference/core.HasTemplate.llms.md#laplacekit.core.HasTemplate) | A `Curvature` or `Staged` method that knows its result’s structure before any data. |
| [core.Operator](../reference/core.Operator.llms.md#laplacekit.core.Operator) | A precision operator on vectors `V`: products, solves, its diagonal and log-determinant. |
| [core.Diag](../reference/core.Diag.llms.md#laplacekit.core.Diag) | A diagonal precision $P = \operatorname{diag}(d)$, stored as its diagonal. |
| [core.Dense](../reference/core.Dense.llms.md#laplacekit.core.Dense) | A full precision matrix $P$, for small blocks such as a last layer. |
| [core.with_eigen](../reference/core.with_eigen.llms.md#laplacekit.core.with_eigen) | `op` with each `Dense` in it carrying its eigendecomposition (`Dense.with_eigen`). |
| [core.KronEigenbasis](../reference/core.KronEigenbasis.llms.md#laplacekit.core.KronEigenbasis) | A Kronecker-factored matrix held in its eigenbasis, for one layer’s block. |
| [core.BlockDiag](../reference/core.BlockDiag.llms.md#laplacekit.core.BlockDiag) | One operator per block, keyed by block name (see `layout`). |
| [core.Joint](../reference/core.Joint.llms.md#laplacekit.core.Joint) | One operator across all blocks, on vectors keyed by block name. |
| [core.LowRankPlusDiag](../reference/core.LowRankPlusDiag.llms.md#laplacekit.core.LowRankPlusDiag) | A diagonal plus a low-rank term, $P = D + U \operatorname{diag}(s) U^\top$. |
| [core.HasBlocks](../reference/core.HasBlocks.llms.md#laplacekit.core.HasBlocks) | An operator on mappings keyed by block name, such as `BlockDiag` or `Joint`. |

### Likelihood contracts

|  |  |
|----|----|
| [core.Likelihood](../reference/core.Likelihood.llms.md#laplacekit.core.Likelihood) | A likelihood $p(y \mid f)$ over targets given model outputs. |
| [core.HasDistribution](../reference/core.HasDistribution.llms.md#laplacekit.core.HasDistribution) | The distribution over targets. `default_log_prob` and `default_sample` derive from it. |
| [core.HasSample](../reference/core.HasSample.llms.md#laplacekit.core.HasSample) | Sampling of targets, used by the sampled and MC Fishers. |
| [core.HasOutputHessian](../reference/core.HasOutputHessian.llms.md#laplacekit.core.HasOutputHessian) | Closed-form output Hessian. Without it, `output_hessian` uses the MC Fisher. |
| [core.OutputHessian](../reference/core.OutputHessian.llms.md#laplacekit.core.OutputHessian) | Hessian $H = -\nabla_f^2 \log p(y \mid f)$ with respect to $f$, per example. |
| [core.HasDefaultLink](../reference/core.HasDefaultLink.llms.md#laplacekit.core.HasDefaultLink) | The link a likelihood uses when `Linearized` has `link=None`. |
| [core.HasSampleAverage](../reference/core.HasSampleAverage.llms.md#laplacekit.core.HasSampleAverage) | The predictive from output draws. |
| [core.HasMask](../reference/core.HasMask.llms.md#laplacekit.core.HasMask) | Which output positions count, e.g. non-padding tokens. |
| [core.HasOutputCheck](../reference/core.HasOutputCheck.llms.md#laplacekit.core.HasOutputCheck) | Checks the model’s outputs before any data is fitted. |
| [core.HasTargetCheck](../reference/core.HasTargetCheck.llms.md#laplacekit.core.HasTargetCheck) | Checks a batch’s targets before the fit uses them, e.g. values outside the support. |
| [core.LateLikelihood](../reference/core.LateLikelihood.llms.md#laplacekit.core.LateLikelihood) | A likelihood whose hyperparameters are applied after the fit. |
| [likelihoods.from_log_prob](../reference/likelihoods.from_log_prob.llms.md#laplacekit.likelihoods.from_log_prob) | Wrap a per-example log-likelihood `fn(f, y)` (contrastive, ranking, a custom energy). |

### Predictive contracts

|  |  |
|----|----|
| [core.Predictive](../reference/core.Predictive.llms.md#laplacekit.core.Predictive) | Turns a posterior `B` and inputs into a distribution over targets. |
| [core.LinkApprox](../reference/core.LinkApprox.llms.md#laplacekit.core.LinkApprox) | Turns Gaussian outputs into a distribution over targets. |
| [core.mean_outputs](../reference/core.mean_outputs.llms.md#laplacekit.core.mean_outputs) | The model’s outputs at the posterior’s mean. |

### Requirements and errors

|  |  |
|----|----|
| [core.Requirements](../reference/core.Requirements.llms.md#laplacekit.core.Requirements) | What a method needs from the model beyond one backward pass, and from the likelihood. |
| [core.Capabilities](../reference/core.Capabilities.llms.md#laplacekit.core.Capabilities) | What the probe found. Each capability is independent of the others. |
| [core.probe](../reference/core.probe.llms.md#laplacekit.core.probe) | Capability probe: run the model once and record what works. |
| [CapabilityError](../reference/CapabilityError.llms.md#laplacekit.CapabilityError) | A requested method needs something the model or likelihood doesn’t support. |
| [StructureError](../reference/StructureError.llms.md#laplacekit.StructureError) | Shapes or structures don’t fit together, such as a prior and a curvature. |
| [core.exact_fits](../reference/core.exact_fits.llms.md#laplacekit.core.exact_fits) | Whether `n_samples=None` gives the exact output covariance by `strategy`. |
| [core.resolve_strategy](../reference/core.resolve_strategy.llms.md#laplacekit.core.resolve_strategy) | The pushforward mode `strategy=None` picks, for $E$ output entries and $P$ parameters. |
| [core.check_outputs_args](../reference/core.check_outputs_args.llms.md#laplacekit.core.check_outputs_args) | Refuse what `predict_outputs` refuses before any forward. |
| [core.is_transformed](../reference/core.is_transformed.llms.md#laplacekit.core.is_transformed) | Whether `t` is wrapped by a `torch.func` transform (a `vmap`, `grad` or `jvp` level). |

### Pytrees

|  |  |
|----|----|
| [core.pytree](../reference/core.pytree.llms.md#laplacekit.core.pytree) | Make `cls` a frozen dataclass registered as a torch pytree node. |
| [core.static](../reference/core.static.llms.md#laplacekit.core.static) | Mark a field as static: part of the structure, not a pytree leaf. |
| [core.as_pytree](../reference/core.as_pytree.llms.md#laplacekit.core.as_pytree) | Turn each mapping that torch’s pytree would treat as a leaf into a plain `dict`. |
| [core.hyperparameters](../reference/core.hyperparameters.llms.md#laplacekit.core.hyperparameters) | Every hyperparameter of a posterior a tuner may change. |
| [core.HasPrior](../reference/core.HasPrior.llms.md#laplacekit.core.HasPrior) | A posterior that keeps its prior, so a tuner can reach the prior precision. |
| [core.HasLikelihood](../reference/core.HasLikelihood.llms.md#laplacekit.core.HasLikelihood) | A posterior that keeps its likelihood, so a tuner can reach its hyperparameters. |
| [core.TunableLikelihood](../reference/core.TunableLikelihood.llms.md#laplacekit.core.TunableLikelihood) | A likelihood with hyperparameters a tuner may change, such as a learned `sigma`. |
| [core.detach_leaves](../reference/core.detach_leaves.llms.md#laplacekit.core.detach_leaves) | Detach every tensor leaf of a pytree. |
| [core.replace_leaves](../reference/core.replace_leaves.llms.md#laplacekit.core.replace_leaves) | Swap leaves of a pytree by identity. |

### Plugin records

|  |  |
|----|----|
| [Plugin](../reference/Plugin.llms.md#laplacekit.Plugin) | A plugin’s record, the target of its `laplacekit.plugins` entry point. |
| [PluginInfo](../reference/PluginInfo.llms.md#laplacekit.PluginInfo) | One registered plugin: its package metadata, its `supports` range, what it provides. |
| [Plugins](../reference/Plugins.llms.md#laplacekit.Plugins) | The registered plugins. `print` lists them. |
| [HealthCheck](../reference/HealthCheck.llms.md#laplacekit.HealthCheck) | One result of `lk.health()`. |
| [HealthReport](../reference/HealthReport.llms.md#laplacekit.HealthReport) | What `lk.health()` found, per package. `print` lists the checks. |

### Testing plugins

Conformance checks for plugin authors.

|  |  |
|----|----|
| [testing.check_curvature](../reference/testing.check_curvature.llms.md#laplacekit.testing.check_curvature) | Check a curvature (`Curvature` or `Staged`) against the core contracts. |
| [testing.check_prior](../reference/testing.check_prior.llms.md#laplacekit.testing.check_prior) | Check a prior against the core contracts. |
| [testing.check_likelihood](../reference/testing.check_likelihood.llms.md#laplacekit.testing.check_likelihood) | Check a likelihood’s laws at outputs `f` and targets `y` (one batch). |
| [testing.check_link](../reference/testing.check_link.llms.md#laplacekit.testing.check_link) | Check a link approximation against the core contracts. |
| [testing.check_subset](../reference/testing.check_subset.llms.md#laplacekit.testing.check_subset) | Check a subset against the core contracts. |
| [testing.check_objective](../reference/testing.check_objective.llms.md#laplacekit.testing.check_objective) | Check a tuning objective against the core contracts. |
| [testing.check_predictive](../reference/testing.check_predictive.llms.md#laplacekit.testing.check_predictive) | Check a predictive against the core contracts. |
