Downloads · 30 days
15
6% of all-time downloads
neuralnets/sarvam-30b-4bit
sarvam-30b-4bit is a machine learning model from neuralnets. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository provides a 4-bit NF4 quantized version of the base model sarvamai/sarvam-30b using bitsandbytes. The quantization significantly reduces GPU memory usage while preserving strong inference performance.
Downloads · 30 days
15
6% of all-time downloads
All-time downloads
242
Public
Parameters
32.2B
19.8 GB on disk
Likes
4
Public
Click a slice to open those files.
.safetensors19.8 GB · 100%
How the weights are stored.
U830.9B · 93%
From the Hugging Face model README
This repository provides a 4-bit NF4 quantized version of the base model sarvamai/sarvam-30b using bitsandbytes.
The quantization significantly reduces GPU memory usage while preserving strong inference performance.
Base model
sarvamai/sarvam-30b
Architecture
SarvamMoEForCausalLM
Quantization method: BitsAndBytes 4-bit (NF4)
Configuration used:
Approximate GPU memory usage:
| Model | GPU VRAM |
|---|---|
| FP16 original | ~60 GB |
| 4-bit NF4 | ~16-18 GB |
This version is recommended for most users who want to run the model with reduced hardware requirements.
Install the required libraries.
pip install transformers accelerate bitsandbytes torch safetensors
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"neuralnets/sarvam-30b-4bit",
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
"neuralnets/sarvam-30b-4bit",
trust_remote_code=True
)
prompt = "Explain mixture of experts in simple terms."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=200
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Recommended GPUs:
CPU RAM recommendation:
trust_remote_code=True.Original model:
sarvamai/sarvam-30b
Please refer to the base repository for model training details and benchmarks.
This repository distributes a quantized derivative of the original model.
Users must follow the license of the upstream model:
sarvamai/sarvam-30b