How posthog/jeeves works
Jeeves is a reasoning-enabled Jev-style classifier: training data is prepared and encoded, model and drafter components are trained, then exported weights are served through a Jev-compatible API. The README also documents CUDA/MPS and FP8 inference, mixed question types, and a Python SDK. The map follows documented capabilities and relationships visible in excerpts or the source index; several training and serving internals were not sampled, so their connections are omitted where unverified.
Main entry points: model.py Qwen model · engine.py Inference engine · predictor.py Training predictor · dataloader.py Tokenization and batches
Components 26
Data preparation
- Dataset preparation
prep/prep.py - Contrastive cases
prep/contrastive.py - Record format
prep/format.py - Tokenization and batches
loader/dataloader.py
Training
- Model training
trainer.py - Training predictor
predictor.py - Checkpoint handling
checkpoint.py - Distributed execution
distributed.py - Drafter training
drafter/train.py - Drafter data
drafter/data.py
Model and export
- Drafter model view
drafter/view.py - Qwen model
model/model.py - Model configuration
model/config.py - LoRA adapters
model/lora.py - Pointer head
model/head.py - Metal kernels
model/metal.py - Checkpoint export
export.py - FP8 checkpoint support
inference/fp8_checkpoint.py
Inference and serving
- HTTP serving
inference/serve.py - Jev-compatible API
inference/api.py - Inference engine
inference/engine.py - FP8 inference
inference/fp8.py - Metal FP8
inference/fp8_metal.py
Client and evaluation
- Python SDK
sdk/jeeves_sdk/__init__.py - JevBench evaluation
jevbench.py
Other components
- API client
Connections 40
- Dataset preparation → Contrastive cases: uses generators
prep/prep.py - Dataset preparation → Record format: builds records
prep/prep.py - Contrastive cases → Record format: formats examples
prep/contrastive.py - Tokenization and batches → Record format: reads records
loader/dataloader.py - Model training → Tokenization and batches: loads batches
trainer.py - Model training → Training predictor: uses predictor
trainer.py - Model training → Checkpoint handling: saves checkpoints
trainer.py - Model training → Distributed execution: uses distributed setup
trainer.py - Training predictor → Tokenization and batches: encodes inputs
predictor.py - Training predictor → Qwen model: runs model
predictor.py - Training predictor → Pointer head: uses head
predictor.py - Training predictor → Checkpoint handling: loads weights
predictor.py - Drafter training → Drafter data: uses data
drafter/train.py - Drafter training → Drafter model view: trains view
drafter/train.py - Drafter training → Qwen model: uses model
drafter/train.py - Drafter training → Tokenization and batches: loads batches
drafter/train.py - Qwen model → Model configuration: uses configuration
model/model.py - Qwen model → LoRA adapters: uses adapters
model/model.py - Qwen model → Metal kernels: dispatches kernels
model/model.py - Checkpoint export → Checkpoint handling: loads checkpoint
export.py - Checkpoint export → Tokenization and batches: builds encoder
export.py - Checkpoint export → Qwen model: fuses model
export.py - Checkpoint export → Pointer head: bundles head
export.py - FP8 checkpoint support → Checkpoint export: reuses export
inference/fp8_checkpoint.py - FP8 checkpoint support → Drafter model view: loads drafter view
inference/fp8_checkpoint.py - FP8 checkpoint support → Qwen model: loads model weights
inference/fp8_checkpoint.py - API client → HTTP serving: sends request
README.md - HTTP serving → Jev-compatible API: registers API
inference/serve.py - HTTP serving → Inference engine: creates engine
inference/serve.py - Jev-compatible API → Record format: formats inputs
inference/api.py - Jev-compatible API → Inference engine: dispatches inference
- Inference engine → Qwen model: runs model
inference/engine.py - Inference engine → Drafter model view: uses drafter
inference/engine.py - Inference engine → FP8 inference: dispatches FP8
inference/engine.py - Inference engine → Metal FP8: dispatches Metal FP8
inference/engine.py - Inference engine → Metal kernels: uses Metal kernels
inference/engine.py - Python SDK → API client: provides client
- JevBench evaluation → Training predictor: evaluates model
jevbench.py - JevBench evaluation → Tokenization and batches: loads data
jevbench.py - JevBench evaluation → Record format: uses records
jevbench.py