π Klint-32M: Generative Financial Foundation Model Family
Klint-32M is an open research causal autoregressive foundation architecture for generative financial time-series modeling. It decomposes raw market candlesticks into three stationary causal factor streams (Price-Path, Range-Shape, and Activity), quantizes them into discrete token codes with Residual Vector Quantization (RVQ), models their joint transition distribution with a causal Transformer, and decodes them with strict mathematical guarantees preserving candle geometry:
- Author: Akhilesh Varma (akhverm / GitHub)
- Full Source Code & Architecture: https://github.com/ak495867/Klint-32M
- Model Checkpoints Repository:
akhverm/Klint-32M
π¦ Checkpoint Family Inventory
This repository contains the complete release artifacts and training trajectory checkpoints for the Klint-32M model family:
| File Name | Size | Type | Description |
|---|---|---|---|
klint_32m_release.pt |
112.5 MB | All-in-One Bundle | Complete deployment bundle containing Klint-32M weights, Factor Tokenizer codebooks, KlintConfig, and training metadata. Ready for one-line loading. |
klint_32m_best.pt |
111.9 MB | Best Checkpoint | Optimal validation loss checkpoint (~2.76 Cross-Entropy Loss) across training. |
klint_32m_step_3000.pt |
111.9 MB | Checkpoint | Completed step 3,000 checkpoint. |
klint_32m_step_2500.pt |
111.9 MB | Checkpoint | Intermediate training milestone at step 2,500. |
klint_32m_step_2000.pt |
111.9 MB | Checkpoint | Intermediate training milestone at step 2,000. |
klint_32m_step_1505.pt |
111.9 MB | Checkpoint | Checkpoint at step 1,505. |
klint_32m_step_1500.pt |
111.9 MB | Checkpoint | Resume checkpoint at step 1,500. |
klint_32m_step_1000.pt |
111.9 MB | Checkpoint | Training milestone at step 1,000. |
klint_32m_step_500.pt |
111.9 MB | Checkpoint | Early training milestone at step 500. |
klint_32m_step_5.pt |
111.9 MB | Checkpoint | Initial training calibration step. |
tokenizer_best.pt |
630 KB | Discrete Tokenizer | Standalone multi-stream Residual Vector Quantizer (RVQ) factor codebooks (512 Price, 256 Range, 256 Activity codes). |
synthetic_market_trajectory.png |
76 KB | Visualization | Generative candlestick trajectory sample showing autoregressive price path sampling. |
β‘ Quickstart & Inference
Option 1: Using the Official GitHub Inference Engine (Recommended)
Clone the official Klint-32M GitHub repository and use the high-performance CLI:
git clone https://github.com/ak495867/Klint-32M.git
cd Klint-32M
pip install -e .
# 1. Live market inference on Solana via yfinance (auto-downloads checkpoint):
python inference.py --ticker SOL-USD --horizon 30 --save_plot forecast_sol.png
# 2. Live market inference on Nvidia:
python inference.py --ticker NVDA --horizon 50 --save_plot forecast_nvda.png
# 3. Using your local release bundle:
python inference.py --checkpoint klint_32m_release.pt --ticker BTC-USD
Option 2: Download Directly via huggingface_hub in Python
import torch
from huggingface_hub import hf_hub_download
# Download the complete all-in-one release bundle
bundle_path = hf_hub_download(
repo_id="akhverm/Klint-32M",
filename="klint_32m_release.pt"
)
# Load into PyTorch
device = "cuda" if torch.cuda.is_available() else "cpu"
bundle = torch.load(bundle_path, map_location=device, weights_only=False)
print("Klint-32M Release Bundle Loaded Successfully!")
print("Config:", bundle["config"])
print("Model Parameters:", sum(p.numel() for p in bundle["model_state_dict"].values()))
Option 3: End-to-End Trajectory Generation in Python
import torch
from huggingface_hub import hf_hub_download
from klint.models.klint_32m import Klint32M
from klint.tokenizer.factor_tokenizer import FactorTokenizer
from klint.tokenizer.geometric_decoder import GeometricDecoder
# 1. Download bundle from Hugging Face
bundle_file = hf_hub_download(repo_id="akhverm/Klint-32M", filename="klint_32m_release.pt")
bundle = torch.load(bundle_file, map_location="cpu", weights_only=False)
# 2. Instantiate Model and Tokenizer
model = Klint32M(bundle["config"])
model.load_state_dict(bundle["model_state_dict"])
model.eval()
tokenizer = FactorTokenizer()
tokenizer.load_state_dict(bundle["tokenizer_state_dict"])
tokenizer.eval()
decoder = GeometricDecoder()
# 3. Generate 30 future market bars conditioned on prompt tokens
prompt_tokens = torch.randint(0, 256, (1, 90)) # 30 bars context = 90 factor tokens
generated = model.generate_tokens(prompt_tokens, num_bars=30, temperature=0.8, top_k=40)
# 4. Decode into physically guaranteed OHLCV candlesticks
new_tokens = generated[:, 90:]
p_tok, r_tok, a_tok = tokenizer.deinterleave(new_tokens)
rec_p, rec_r, rec_a = tokenizer.decode_tokens(p_tok, r_tok, a_tok)
ohlcv_candles = decoder(rec_p, rec_r, rec_a, anchor_price=150.0)
print("Synthesized Candles Shape:", ohlcv_candles.shape) # [1, 30, 5] -> (Open, High, Low, Close, Volume)
ποΈ Model Architecture Specifications
| Parameter | Specification | Details |
|---|---|---|
| Model Type | Causal Autoregressive Foundation Transformer | Decoder-only sequence model with multi-stream interleaving |
| Trainable Parameters | 28,642,560 (~32M analytically with embeddings) | Optimized for high-throughput single-GPU inference |
| Layers ($N_{\text{layers}}$) | 10 | Uniform causal transformer blocks |
| Hidden Dimension ($d_{\text{model}}$) | 480 | Balanced capacity-to-memory ratio |
| Attention Heads ($N_{\text{heads}}$) | 10 (head dimension = 48) | Multi-head self-attention with RoPE |
| Feed-Forward Dimension ($d_{\text{ff}}$) | 1,920 ($4 \times d_{\text{model}}$) | SwiGLU activation projection |
| Positional Embedding | Rotary Position Embeddings (RoPE) | Causal relative-distance preservation |
| Normalization | RMSNorm ($\epsilon = 10^{-5}$) | Pre-normalization architecture |
| Factor Codebooks | Multi-Stream Residual Vector Quantizer (RVQ) | $K_p = 512$ (Price), $K_r = 256$ (Range), $K_a = 256$ (Activity) |
| Factor Generation Order | Causal Decomposition Chain | $\text{Price} \to \text{Range} \to \text{Activity}$ |
| Context Length | 768 factor tokens (256 bars) up to 3,072 tokens | Causal intraday to multi-day dynamics |
π Benchmark & Quantitative Stress-Testing
Klint-32M has been evaluated using an institutional quantitative stress-testing suite across 300+ liquid assets and 6 asset classes:
- Directional Accuracy: Out-of-sample directional hit rate consistently exceeding the 50.0% random-walk baseline on liquid instruments.
- Candle Invariant Validity: 100.00% physical validity guarantee ($High \ge \max(Open, Close)$ and $Low \le \min(Open, Close)$) via structural geometric decoding.
- Monte Carlo Resampling: 2,000-path stationary block bootstrap confirming performance significance ($p$-value $< 0.05$ against null hypothesis).
- Friction Resistance: Tested across 0 to 50 bps transaction fee sweeps with positive net Sharpe ratios under standard retail/institutional fee regimes.
- Purged Walk-Forward Stability: Chronologically partitioned cross-validation with embargo gaps achieving Walk-Forward Efficiency Ratios (WFER) $\ge 0.5$.
π Citation & Links
@misc{varma2026klint32m,
author = {Akhilesh Varma},
title = {Klint-32M: A Foundation Architecture for Generative Financial Time-Series Modeling},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/akhverm/Klint-32M}},
note = {GitHub: \url{https://github.com/ak495867/Klint-32M}}
}
- GitHub Repository: https://github.com/ak495867/Klint-32M
- Hugging Face Model Hub: https://huggingface.co/akhverm/Klint-32M
- License: MIT