Skip to main content

xpeek

Inspect, check, slice and diff ML weights and datasets locally or over HTTP Range without Python. Written in Rust.

ci crates.io license: MIT

xpeek inspecting a 256 MB PyTorch checkpoint with grouped layers, flagging a nested os.system payload in a poisoned pickle without running it, and profiling a Parquet table with sparklines and NaN counts

Install

uvx xpeek hf://Qwen/Qwen2.5-72B-Instruct --group
pip install xpeek
brew install samehaisaa/tap/xpeek
cargo binstall xpeek
cargo install xpeek

Prebuilt binaries for Linux, macOS and Windows are attached to GitHub Releases.

Remote peeking

Pass hf:// or https:// URLs to read headers over HTTP Range without downloading the weights.

$ xpeek hf://Qwen/Qwen2.5-72B-Instruct --group
hf://Qwen/Qwen2.5-72B-Instruct  safetensors (37 shards) | 135.43 GB | 963 tensors | 72.71B params | 4294.7 ms
Dtypes:   bf16 (963, 135.43 GB)
Remote:   681.70 KB / 135.43 GB (39 reqs)
Meta:     format=pt  shards=37

  Tensor Group                               Count Shape              Dtype          Size
  lm_head.weight                                 1 [152064, 8192]     bf16        2.32 GB
  model.embed_tokens.weight                      1 [152064, 8192]     bf16        2.32 GB
  model.layers.[0..79].mlp.down_proj.weight    x80 [8192, 29568]      bf16       36.09 GB
  ...

GGUF headers also report weights and FP16 KV cache VRAM at 4K, 8K and 32K context:

$ xpeek hf://bartowski/Llama-3.2-3B-Instruct-GGUF/Llama-3.2-3B-Instruct-Q4_K_M.gguf --group
hf://bartowski/Llama-3.2-3B-Instruct-GGUF/Llama-3.2-3B-Instruct-Q4_K_M.gguf  gguf v3 | 1.88 GB | 255 tensors | 3.21B params
Dtypes:   f32 (58, 684.25 KB), q4_k (168, 1.27 GB), q6_k (29, 618.31 MB)
Remote:   8.00 MB / 1.88 GB (2 reqs)
VRAM:     1.87 GB weights (+448.00 MB @4K, +896.00 MB @8K, +3.50 GB @32K fp16 kv)
xpeek check hf://BAAI/bge-small-en-v1.5/pytorch_model.bin
xpeek hf://datasets/stanfordnlp/imdb/plain_text/train-00000-of-00001.parquet
xpeek slice hf://openai-community/gpt2/model.safetensors wte.weight --head 6
xpeek diff hf://Qwen/Qwen2.5-0.5B-Instruct hf://Qwen/Qwen2.5-1.5B-Instruct

Local paths don't use the network and --offline blocks remote URLs. Set HF_TOKEN for private or gated repos.

Speed and memory

Cold inspection time and peak RSS memory across PyTorch, ONNX, Parquet, NumPy and SafeTensors comparing xpeek against Python loaders

One command per file from cold process start on Linux WSL2 (Intel i5-10300H). Python runs include interpreter import and torch.load and onnx.load also load tensors into RAM, so an already running Python session has a different cost. Full fixtures and commands are in benchmarks/README.md.

Supported formats

Format Extensions What xpeek reads Remote Range
PyTorch .pt, .pth, .ckpt, .bin, .pkl Non-executing pickle v0 to v5 VM, opcode audit including nested _load_from_bytes, stats, slice and diff Yes (ZIP/ZIP64 and legacy .bin)
SafeTensors .safetensors, .safetensors.index.json Zero-copy mmap header, shard map, FP8 (E4M3FN, E5M2), BF16, F16, F32, F64 and integer stats Yes (single, sharded, slice, diff)
GGUF .gguf v1 to v3 header metadata, quantization types, tensor byte totals and FP16 KV cache VRAM math Yes
Parquet .parquet, .pq Thrift footer metadata, Zstd, Snappy, Gzip and LZ4 projected stats, fixed-size float embedding zero-norm checks Yes (footer and diff)
NumPy .npy, .npz v1 to v3 array headers and streaming .npz member peek without full decompression .npy (inspect, slice, diff)
ONNX .onnx Streaming Protobuf wire reader skipping weight payloads, op histogram, graph signatures, external sidecars Local
Arrow IPC .arrow, .ipc, .feather, .arrows Arrow IPC File and Stream formats including Hugging Face datasets shards Local
Text tables .csv, .tsv, .jsonl, .ndjson Streaming type inference, bounded row preview, nulls, NaN/Inf checks and sparklines Local

Git LFS pointers are detected automatically and resolved from .git/lfs/objects/ when present locally.

Usage

Inspect checkpoints and scan untrusted pickles

xpeek checkpoint.pt --group
xpeek model.onnx
xpeek ./checkpoints/
xpeek check ./checkpoints/ -r
git show HEAD:weights.npy | xpeek -

xpeek check exits 0 when clean, 1 on corrupted storage or dangerous pickle opcodes and 2 on warnings such as NaNs, Infs, zero-norm embeddings or non-allowlisted globals.

Profile datasets and preview slices

xpeek stats train.parquet
xpeek slice train.parquet id,loss,label --head 5
xpeek slice examples/before.safetensors head.weight --head 4

Diff checkpoints across formats and inside Git

xpeek diff examples/before.safetensors examples/after.safetensors --atol 0.01
xpeek diff checkpoint.pt checkpoint.safetensors --atol 1e-4
xpeek git-init

After xpeek git-init, git diff prints tensor and schema deltas instead of Binary files differ on tracked checkpoints and Git LFS blobs:

--- a/checkpoint.safetensors
+++ b/checkpoint.safetensors
@@ -1,6 +1,6 @@
 format: safetensors
-size_bytes: 700
+size_bytes: 701
 tensors: 2
-params: 136
+params: 264
 tensor head.bias shape=[8] dtype=f32 bytes=32
-tensor head.weight shape=[8, 16] dtype=f32 bytes=512
+tensor head.weight shape=[8, 32] dtype=bf16 bytes=512

Coding agents and MCP

--agent prints compact key-value summaries sized for tool output, and --json prints structured JSON for scripts.

xpeek checkpoint.pt --group --agent
xpeek help --json
xpeek init --claude
xpeek mcp

xpeek init supports --claude, --codex, --cursor, --gemini, --antigravity and --all (with --dry-run and --uninstall). For Claude Code it installs a PreToolUse hook that exits 2 only on supported binary ML extensions and redirects Read to xpeek, without touching text files or auto-allowing commands. xpeek mcp runs a local read-only stdio MCP server exposing inspect, stats, slice, diff and check.

License

MIT

Metadata

Release files for xpeek 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xpeek 0.2.0
File Size Uploaded Provenance Actions
xpeek-0.2.0.tar.gz 381.0 kB With provenance Details for xpeek-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for xpeek 0.2.0
File Actions
xpeek-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for xpeek-0.2.0-py3-none-win_amd64.whl
xpeek-0.2.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for xpeek-0.2.0-py3-none-manylinux_2_28_x86_64.whl
xpeek-0.2.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for xpeek-0.2.0-py3-none-manylinux_2_28_aarch64.whl
xpeek-0.2.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for xpeek-0.2.0-py3-none-macosx_11_0_arm64.whl
xpeek-0.2.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for xpeek-0.2.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 17.7 MB

Release files / xpeek-0.2.0.tar.gz

Download URL xpeek-0.2.0.tar.gz
Size 381.0 kB
Tags Source
SHA-256 checksum
How to use checksums
30c20596c4a6c76adbd4c7ea31e7b7a2448bbdbbdec6b850889f2b99d833f96e
BLAKE2b-256 checksum
How to use checksums
22d052e9266e338a202492230ae64245fb60a595a95bd4f9325993d8c50670af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / xpeek-0.2.0-py3-none-win_amd64.whl

Download URL xpeek-0.2.0-py3-none-win_amd64.whl
Size 3.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
015f5f376f469dd1baa9aac1219b9d4d58a3319f8b9c52be3d8776c081e3e558
BLAKE2b-256 checksum
How to use checksums
e273516845c2690beba5ba379c5251c6dfd6191e198f72b17849322537d9dd5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / xpeek-0.2.0-py3-none-manylinux_2_28_x86_64.whl

Download URL xpeek-0.2.0-py3-none-manylinux_2_28_x86_64.whl
Size 3.5 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
abe3a1cb1cf38fdbd83e7f76f9265d79381218916cec5e44eb8c19df57bab401
BLAKE2b-256 checksum
How to use checksums
b3c8b0487c3f672000fde5d0afa56b9d4e60f9b9027e9256fc27da0ddcf464ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / xpeek-0.2.0-py3-none-manylinux_2_28_aarch64.whl

Download URL xpeek-0.2.0-py3-none-manylinux_2_28_aarch64.whl
Size 3.3 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
8fd56c9db785b829c328654e3252ffb7f51016e1bd2ca8775d8f630639f441b6
BLAKE2b-256 checksum
How to use checksums
96375f95150d0a00e488909ff95fd58c281cb44803b669512e8e6d12cc7dea7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / xpeek-0.2.0-py3-none-macosx_11_0_arm64.whl

Download URL xpeek-0.2.0-py3-none-macosx_11_0_arm64.whl
Size 3.3 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
99f56ca20d4019b366813e871de2bdbd3bc464545d3410352a4b2e624524efe1
BLAKE2b-256 checksum
How to use checksums
29dc0e64f1a2cb98afdef8dd2fcd792f4d9de20615aebbd4c103594fb558bbb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / xpeek-0.2.0-py3-none-macosx_10_12_x86_64.whl

Download URL xpeek-0.2.0-py3-none-macosx_10_12_x86_64.whl
Size 3.5 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a89bfafcbbccfb41acec40668ee11a96b3697b50dfabc931a44c8d044608d7a0
BLAKE2b-256 checksum
How to use checksums
dd6e4623b86650a41366533de6785ba08613e3ab899fae1eb8cb6b37e388320b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for xpeek 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for xpeek-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page