Skip to main content

Model-agnostic edge deployment analysis framework for memory-constrained devices

Project description

dhurandhar — धुरंधर

dhura (धुर, burden) + dhara (धर, one who bears)

"Bearer of burdens" — a framework for deploying large multimodal models on memory-constrained edge devices where they have no right to survive.

PyPI version Python 3.10+ License


What it does

dhurandhar is a model-agnostic edge deployment analysis framework. Given a model architecture and a target device, it answers the questions that matter before you ship:

Module Question answered
PLE Analysis What is the peak live memory footprint at context length N?
Device Feasibility Can this model run resident, mmap, or not at all on this device?
TurboQuant Sweep What is the quality / memory tradeoff at 2/3/4/6/8-bit KV compression?
RotorQuant Comparison TurboQuant vs RotorQuant — quality vs arithmetic cost?
Mmap Profiler What is the real mmap throughput and peak RSS on this host?

All five analyses are exposed as a CLI, a Python API, and a 5-tab Gradio dashboard.


Supported models (built-in)

Slug Architecture Params
gemma4-e2b Gemma4 (sliding-window + global attention) 2B
qwen2.5-0.5b Qwen2.5 GQA 0.5B
qwen2.5-1.5b Qwen2.5 GQA 1.5B
granite-3.3-2b IBM Granite MHA 2B
llama-3.2-1b Llama3 GQA 1B

Any model can be added via a simple YAML profile — no code required.


Install

# Core (analysis + CLI)
uv add dhurandhar

# With interactive dashboard
uv add "dhurandhar[dashboard]"

# With HuggingFace Hub auto-profile derivation
uv add "dhurandhar[hf]"

# Everything
uv add "dhurandhar[all]"

Quickstart

# PLE memory breakdown for Gemma4 E2B at 4096 context
dhurandhar-ple-analyze --model gemma4-e2b --context 4096

# Device feasibility across all registered devices
dhurandhar-device-check --model gemma4-e2b

# TurboQuant quality sweep
dhurandhar-turbo-sweep --model gemma4-e2b --residual-bits 2,3,4,6,8

# Codec comparison
dhurandhar-compare-codecs --model gemma4-e2b --head-dim 256 --seq-len 2048

# Launch 5-tab dashboard
dhurandhar-dashboard

Python API

from dhurandhar.models import get_profile
from dhurandhar.devices import get_device

model  = get_profile("gemma4-e2b")
device = get_device("pixel-8")

print(f"KV cache at 4096 ctx: {model.kv_cache_bytes(4096) / 1e6:.1f} MB")
print(f"Device available RAM: {device.available_ram_gb:.1f} GB")

Custom model via YAML

# my_model.yaml
name: my-custom-2b
param_count_b: 2.0
weight_bytes: 4000000000
num_layers: 32
num_attention_layers: 32
num_kv_heads: 8
head_dim: 128
architecture_family: llama
dhurandhar-ple-analyze --model my_model.yaml --context 2048

Status

v0.1.0 — model/device registries stable, analysis modules and dashboard landing in v0.1.x point releases.


License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dhurandhar-0.1.0.tar.gz (136.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dhurandhar-0.1.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file dhurandhar-0.1.0.tar.gz.

File metadata

  • Download URL: dhurandhar-0.1.0.tar.gz
  • Upload date:
  • Size: 136.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dhurandhar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 505a23467868fbba3b1ab55ce216649ebd635f8017ba73b52e64ef8784ca4af7
MD5 5a5138e8564503f11955fc0fc5385ff7
BLAKE2b-256 ab9c99f8d02bf3e05f12f97c0b72a7077b74d969d8350305a5be67806f0265b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhurandhar-0.1.0.tar.gz:

Publisher: publish.yml on smarthi/dhurandhar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dhurandhar-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dhurandhar-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dhurandhar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37c0176ffa356456cd44b1f0c7febb9a5a9878c9e9524652d5a848b9b7508b9a
MD5 5630544524bd8dfe0419810de34aafa6
BLAKE2b-256 62fae100b7b679922a95c875c18bde88e1612bd2f353e0fcc78dd2f8704416dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for dhurandhar-0.1.0-py3-none-any.whl:

Publisher: publish.yml on smarthi/dhurandhar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page