Projects/Bolt/Documentation

[ BOLT / MLBRICKS KIT 1.0.0B1 ]

Bolt API Reference

Bolt, BoltAttention, Attention, BoltModel and recurrent cache interfaces.

DISTRIBUTIONmlbricks-kitDOCS VERSION1.0.0b1

BOLT

PYTHON
Bolt(
    d_model,
    num_heads,
    *,
    latent_dim=32,
    bias=False,
    dropout=0.0,
    causal=True,
    backend="auto",
    autotune_kernels=True,
    use_sdpa=True,
    position=None,
)

BoltAttentionis an alias ofBolt.

MAIN METHODS

bolt(x)Full-sequence forward.
prefill(x, start_pos=0)Return output and generation cache.
decode_step(x, cache)Advance the recurrent cache.
project_cache_state(...)Build cache state from hidden inputs.
prefill_with_cache(...)Prefill helper with explicit cache output.
set_backend(...)Setauto,nativeorpytorch.

STANDARD ATTENTION

PYTHON
Attention(
    d_model,
    num_heads,
    *,
    bias=False,
    dropout=0.0,
    causal=True,
    backend="auto",
    position=None,
)

BOLT MODEL

PYTHON
BoltModel(
    vocab_size=50257,
    context=2048,
    layers=6,
    dim=384,
    heads=6,
    latent_dim=32,
    position="rope",
    backend="auto",
)

The complete model configuration also supports FFN, residual, normalization, dropout, embedding tying and MLBricks FFNBrick/ResController options.