> ## Documentation Index
> Fetch the complete documentation index at: https://circuitcheck.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# circuitcheck.labels

> Explain, score and calibrate feature labels; model clients; Neuronpedia.

## Data

| Type | Fields |
| - | - |
| `Record` | `tokens: list[str]`, `acts: list[float]`, `source`; `.peak`, `.window(size)` |
| `FeatureData` | `unit: "layer:feature"`, `records: list[Record]` |
| `FeatureLabel` | `unit`, `label`, `confidence` (0-1), `model`, `detection`, `simulation`, `n_explain`, `error`; `.score` |
| `DetectionScore` | `auroc`, `balanced_accuracy`, `brier`, `n_positive`, `n_negative`, `probs`, `truth` |
| `SimulationScore` | `correlation`, `n_tokens` |
| `Calibration` | `confidence_vs_score`, `mean_confidence`, `mean_score`, `detector_ece`, `bins` |

## Functions

```python signature theme={null}
label_feature(llm, data, *, score="detection", detector=None, n_explain=12, n_positive=8, n_negative=8,
              seed=0, label=None) -> FeatureLabel
label_features(llm, features, *, workers=8, **kw) -> list[FeatureLabel]
score_labels(llm, features, labels, *, workers=8, **kw) -> list[FeatureLabel]
calibration(labels, n_bins=5) -> Calibration
```

**score** `str` (default: detection)

`detection`, `simulation`, `both` or `none`.

**detector** `LLM`

A different model for scoring than for explaining.

**label** `str`

Score a given label instead of writing one (e.g. Neuronpedia's).

Errors (an unparseable reply, a miscounted detection list after one retry) are kept on `FeatureLabel.error`, not
raised, so a batch always finishes.

## Model clients

| Class | Notes |
| - | - |
| `AnthropicLLM(model="claude-haiku-5-5", effort="low")` | thinking off on Haiku 5.5; reads `ANTHROPIC_API_KEY` through the SDK |
| `OpenAILLM(model="gpt-5-mini")` | minimal reasoning effort on GPT-5 models |
| `CachedLLM(inner, path)` | JSON-lines cache; `usage.cached_calls` counts hits |
| `ScriptedLLM(fn)` | answers with `fn(system, prompt)`; for tests |
| `make_llm(provider, model=None, cache=None)` | a cached client |

Every client keeps a `Usage` with `calls`, `cached_calls`, `input_tokens`, `output_tokens` and `usd` (list prices).

## Neuronpedia (`circuitcheck.labels.neuronpedia`)

| Function | What it does |
| - | - |
| `fetch_feature(model_id, source, index, cache_dir=None)` | the feature's JSON from the public API |
| `feature_data(model_id, source, index)` | `(FeatureData, labels)` |
| `records_from_neuronpedia(feature)` | deduplicated records |
| `export_explanations(labels, model_id, source, path=None)` | rows in Neuronpedia's explanation format |
| `compare(ours, theirs)` | `Comparison` per unit with both scores and a `winner` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.