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

# Quickstart

> From install to a running model in five minutes.

## Install

```bash theme={null}
pip install thrindex
```

## Write a model

```python theme={null}
import thrindex as thx
import thrindex.snn as snn

model = snn.Sequential(
    snn.Dense(700, 512),
    snn.LIF(tau_mem=20.0, threshold=0.3),
    snn.Dense(512, 20),
    snn.LIF(tau_mem=20.0, threshold=0.3),
)
```

This is a two-layer spiking network: 700 input features → 512 hidden LIF neurons → 20 output LIF neurons. It matches the architecture used in the keyword-spotting tutorial.

## Compile

```python theme={null}
thx.compile(model, "model.thx")
```

`model.thx` is a sealed artifact containing the architecture, weights, and resolved runtime constants (leak factor `alpha`, CRC32 integrity hash). It is self-contained — no Python environment needed to run it.

## Run

```bash theme={null}
thrindex run model.thx
```

```
═══════════════════════════════════════════════════════
 thrindex 0.3.0  |  target: sim  |  seed: 0
═══════════════════════════════════════════════════════
 model:  Dense(700→512) → LIF(τ=20ms) → Dense(512→20) → LIF(τ=20ms)
 input:  100 timesteps × 700 features
───────────────────────────────────────────────────────
 prediction:  class 7  —  rate score 0.312
───────────────────────────────────────────────────────
 output spike rate:   3.1%
 synaptic ops:        16640
 modeled energy:      8.32 nJ  (coefficient: 0.5 pJ/syn-op)
 sim wall time:       0.015s
═══════════════════════════════════════════════════════
```

The transcript prints to stdout. It is structured, machine-readable, and snapshot-tested — the format is a contract.

## Next steps

<CardGroup cols={2}>
  <Card title="First model" href="/getting-started/first-model">
    Build, train, and run a model end to end with real data.
  </Card>

  <Card title="Keyword spotting tutorial" href="/tutorials/keyword-spotting">
    Full training run on the Spiking Heidelberg Digits dataset.
  </Card>
</CardGroup>
