Text Generation
Transformers
Safetensors
English
zamba2
mamba
hybrid
compressed
hxq
helix-substrate
vector-quantization
helixcode
conversational
Instructions to use EchoLabs33/zamba2-7b-instruct-hxq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EchoLabs33/zamba2-7b-instruct-hxq with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EchoLabs33/zamba2-7b-instruct-hxq") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EchoLabs33/zamba2-7b-instruct-hxq") model = AutoModelForCausalLM.from_pretrained("EchoLabs33/zamba2-7b-instruct-hxq", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EchoLabs33/zamba2-7b-instruct-hxq with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EchoLabs33/zamba2-7b-instruct-hxq" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EchoLabs33/zamba2-7b-instruct-hxq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EchoLabs33/zamba2-7b-instruct-hxq
- SGLang
How to use EchoLabs33/zamba2-7b-instruct-hxq with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "EchoLabs33/zamba2-7b-instruct-hxq" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EchoLabs33/zamba2-7b-instruct-hxq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "EchoLabs33/zamba2-7b-instruct-hxq" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EchoLabs33/zamba2-7b-instruct-hxq", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use EchoLabs33/zamba2-7b-instruct-hxq with Docker Model Runner:
docker model run hf.co/EchoLabs33/zamba2-7b-instruct-hxq
Add RTX 4090 speed confirmation (1,827 tok/s), Mamba fast path install docs
Browse files
README.md
CHANGED
|
@@ -71,6 +71,19 @@ All numbers from a single session, same GPU, same WikiText-2 test set (50 chunks
|
|
| 71 |
| bnb 4-bit NF4 | 5.07 | 1,579 tok/s | 5,129 MB | 5,904 MB | 4 |
|
| 72 |
| **HXQ 12-bit packed** | **5.02** | **1,764 tok/s** | **5,657 MB** | **6,511 MB** | **6** |
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
### Why HXQ wins
|
| 75 |
|
| 76 |
- **Faster than dense** (1,764 vs 1,446 tok/s) -- fused Triton gather kernel eliminates memory bottleneck
|
|
@@ -114,7 +127,14 @@ outputs = model.generate(**inputs, max_new_tokens=32)
|
|
| 114 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 115 |
```
|
| 116 |
|
| 117 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
## Codec Details
|
| 120 |
|
|
@@ -150,7 +170,8 @@ Zamba2-7B-Instruct is a hybrid architecture:
|
|
| 150 |
|
| 151 |
## Verification
|
| 152 |
|
| 153 |
-
- **
|
|
|
|
| 154 |
- **Conversion receipt:** [`conversion_receipt.json`](https://huggingface.co/EchoLabs33/zamba2-7b-instruct-hxq/blob/main/conversion_receipt.json) -- Gate 1 PASS
|
| 155 |
- **helix-substrate version:** 0.3.3 (12-bit packing, fused Triton gather)
|
| 156 |
|
|
|
|
| 71 |
| bnb 4-bit NF4 | 5.07 | 1,579 tok/s | 5,129 MB | 5,904 MB | 4 |
|
| 72 |
| **HXQ 12-bit packed** | **5.02** | **1,764 tok/s** | **5,657 MB** | **6,511 MB** | **6** |
|
| 73 |
|
| 74 |
+
### Cross-GPU Confirmation (RTX 4090)
|
| 75 |
+
|
| 76 |
+
| Method | Throughput | VRAM (load) | VRAM (peak) | GPU |
|
| 77 |
+
|--------|------------|-------------|-------------|-----|
|
| 78 |
+
| **HXQ 12-bit packed** | **1,827 tok/s** | **5,692 MB** | **6,886 MB** | RTX 4090 |
|
| 79 |
+
|
| 80 |
+
Independently reproduced on 2026-04-03. Receipt: [`triton_gather_speed_4090_fast.json`](https://huggingface.co/EchoLabs33/zamba2-7b-instruct-hxq/blob/main/triton_gather_speed_4090_fast.json).
|
| 81 |
+
|
| 82 |
+
**Profiled breakdown (512-token prefill):**
|
| 83 |
+
- HelixLinear (gather + matmul): 43% of forward time
|
| 84 |
+
- Mamba SSM + attention + norms: 57% of forward time
|
| 85 |
+
- Per-layer overhead: 0.66ms avg (gather 0.21ms + cuBLAS 0.32ms)
|
| 86 |
+
|
| 87 |
### Why HXQ wins
|
| 88 |
|
| 89 |
- **Faster than dense** (1,764 vs 1,446 tok/s) -- fused Triton gather kernel eliminates memory bottleneck
|
|
|
|
| 127 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 128 |
```
|
| 129 |
|
| 130 |
+
**Important:** Requires `mamba-ssm` and `causal-conv1d` for full speed. Without these, Mamba2 layers fall back to a naive implementation (~9x slower). Install from source:
|
| 131 |
+
|
| 132 |
+
```bash
|
| 133 |
+
pip install causal-conv1d
|
| 134 |
+
pip install "mamba-ssm @ git+https://github.com/state-spaces/mamba.git@v2.2.2" --no-build-isolation
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
Tested with `transformers>=4.46,<5.0` and `helix-substrate>=0.3.3`.
|
| 138 |
|
| 139 |
## Codec Details
|
| 140 |
|
|
|
|
| 170 |
|
| 171 |
## Verification
|
| 172 |
|
| 173 |
+
- **RTX 3090 benchmark:** [`zamba2_7b_comparison.json`](https://huggingface.co/EchoLabs33/zamba2-7b-instruct-hxq/blob/main/zamba2_7b_comparison.json) -- 1,764 tok/s, 2026-04-02
|
| 174 |
+
- **RTX 4090 confirmation:** [`triton_gather_speed_4090_fast.json`](https://huggingface.co/EchoLabs33/zamba2-7b-instruct-hxq/blob/main/triton_gather_speed_4090_fast.json) -- 1,827 tok/s, 2026-04-03
|
| 175 |
- **Conversion receipt:** [`conversion_receipt.json`](https://huggingface.co/EchoLabs33/zamba2-7b-instruct-hxq/blob/main/conversion_receipt.json) -- Gate 1 PASS
|
| 176 |
- **helix-substrate version:** 0.3.3 (12-bit packing, fused Triton gather)
|
| 177 |
|