Commit 43cfad0
authored
feat: safetensors support — BF16 streaming indexer (#60)
* feat: safetensors header parser + streaming indexer
Parses the safetensors JSON header (no serde dependency) and produces
GgufFile-compatible types so stream_index_gguf_bf16_with_header works
unchanged on safetensors files.
Safetensors stores full BF16 weights — no quantization noise.
For the reasoning diff pipeline, BF16→Base17 gives cleaner
fingerprints than Q8_0→f32→Base17.
Includes test_stream_index_qwen35_safetensors for 11-shard
Qwen3.5-27B indexing at full BF16 precision.
* mod: register safetensors module
* refactor: extract stream_index_gguf_bf16_with_header for format-agnostic indexing
Splits stream_index_gguf_bf16 into:
- stream_index_gguf_bf16(): parses GGUF header, delegates to _with_header
- stream_index_gguf_bf16_with_header(): the core loop, works with any
pre-parsed header (GGUF or safetensors)
No behavior change for existing callers.1 parent 073fb0b commit 43cfad0
3 files changed
Lines changed: 439 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
522 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
523 | 538 | | |
524 | | - | |
| 539 | + | |
525 | 540 | | |
526 | 541 | | |
527 | | - | |
| 542 | + | |
528 | 543 | | |
529 | 544 | | |
530 | 545 | | |
531 | 546 | | |
532 | 547 | | |
533 | 548 | | |
534 | | - | |
| 549 | + | |
535 | 550 | | |
536 | 551 | | |
537 | 552 | | |
| |||
559 | 574 | | |
560 | 575 | | |
561 | 576 | | |
562 | | - | |
| 577 | + | |
563 | 578 | | |
564 | 579 | | |
565 | 580 | | |
| |||
636 | 651 | | |
637 | 652 | | |
638 | 653 | | |
639 | | - | |
| 654 | + | |
640 | 655 | | |
641 | 656 | | |
642 | 657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
175 | 179 | | |
176 | 180 | | |
177 | 181 | | |
| |||
0 commit comments