Skip to main content

Vajra

A fast zero-copy PyTorch tensor streamer powered by Dlang.

Usage

Once installed, you can use Vajra in any Python script or Jupyter Notebook:

import torch
from vajra import VajraStreamer, StreamConfig

# Configure the streamer (optional, uses defaults otherwise)
config = StreamConfig(
    auth_token="hf_YOUR_TOKEN", # Required for gated models like Llama 3
    chunk_size_mb=64,
    chunk_workers=16,
    gpu_workers=3,
    disable_cache=False
)

# Context manager ensures VRAM is freed when done
with VajraStreamer(config) as streamer:
    # Pass the URL or a Hugging Face repo ID
    # (e.g. "meta-llama/Meta-Llama-3-8B")
    tensors = streamer.load("meta-llama/Meta-Llama-3-8B")

    # 'tensors' is a dictionary mapping tensor names to zero-copy PyTorch tensors
    # that are backed directly by the downloaded GPU memory.
    for name, tensor in tensors.items():
        print(f"Tensor: {name}, Shape: {tensor.shape}, Dtype: {tensor.dtype}")

Metadata

Release files for vajra-streamer 0.0.46

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

Source distribution (sdist)

Source distribution for vajra-streamer 0.0.46
File Size Uploaded
vajra_streamer-0.0.46.tar.gz 3.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for vajra-streamer 0.0.46
File Interpreter ABI Platform
vajra_streamer-0.0.46-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details

Total release size: 11.8 MB

Release files / vajra_streamer-0.0.46.tar.gz

Download URL vajra_streamer-0.0.46.tar.gz
Size 3.8 MB
Tags Source
SHA-256 checksum
How to use checksums
2d3ca73be485c51fe9815aabba3e5675804786c3f79ff5bf2f39f5ce52e4f5cb
BLAKE2b-256 checksum
How to use checksums
af790da294cb6e4421e2db16f59c5ee76155744eb94dbadb1768aebfa292aff4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / vajra_streamer-0.0.46-py3-none-manylinux_2_34_x86_64.whl

Download URL vajra_streamer-0.0.46-py3-none-manylinux_2_34_x86_64.whl
Size 8.0 MB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
27388c4235efdd3dd10b4a0bcdff33c936a3e03cb5a41a450f9fad8a690233fd
BLAKE2b-256 checksum
How to use checksums
718365c3528625ea0365c19169b38c970e376e88770c80a8fd1703c3b59cb7db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

0.0.46 This release

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

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