--- tags: - fp8 - vllm pipeline_tag: text-generation provider: Sarvam AI license: apache-2.0 license_name: apache-2.0 name: RedHatAI/sarvam-30b-FP8-dynamic license_link: https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md readme: https://huggingface.co/RedHatAI/sarvam-30b-FP8-dynamic/blob/main/README.md description: Sarvam-30B is an advanced Mixture-of-Experts (MoE) model with 2.4B non-embedding active parameters, designed primarily for practical deployment. It combines strong reasoning, reliable coding ability, and best-in-class conversational quality across Indian languages. Sarvam-30B is built to run reliably in resource-constrained environments and can handle multilingual voice calls while performing tool calls. base_model: - sarvamai/sarvam-30b validated_on: - RHOAI 3.4 - RHAIIS 3.4 language: - en - hi - bn - ta - te - mr - gu - kn - ml - pa - or - as - ur - sa - ne - sd - kok - mai - doi - mni - sat - ks - bo ---
## Model Overview
- **Model Architecture:** sarvamai/sarvam-30b
- **Input:** Text
- **Output:** Text
- **Model Optimizations:**
- **Weight quantization:** FP8
- **Activation quantization:** FP8
- **Out-of-scope:** Use in any manner that violates applicable laws or regulations (including trade compliance laws).
- **Version:** 1.0
- **Model Developers:** RedHatAI
- **ModelCar Storage URI:** oci://registry.redhat.io/rhai/modelcar-sarvam-30b-fp8-dynamic:3.0
This model is a quantized version of [sarvamai/sarvam-30b](https://huggingface.co/sarvamai/sarvam-30b).
It was evaluated on several tasks to assess its quality in comparison to the unquantized model.
### Model Optimizations
This model was obtained by quantizing the weights and activations of [sarvamai/sarvam-30b](https://huggingface.co/sarvamai/sarvam-30b) to FP8 data type, ready for inference with vLLM.
Only the weights and activations of the linear operators within transformers blocks are quantized using [LLM Compressor](https://github.com/vllm-project/llm-compressor).
## Deployment
### Use with vLLM
This model can be deployed efficiently using the [vLLM](https://docs.vllm.ai/en/latest/) backend.
1. Install vLLM from main:
```
uv pip install -U git+https://github.com/vllm-project/vllm.git \
--extra-index-url https://wheels.vllm.ai/nightly \
--no-deps \
--no-cache
```
2. Run using vLLM
```python
from vllm import LLM, SamplingParams
from transformers import AutoTokenizer
model_id = "RedHatAI/sarvam-30b-FP8-dynamic"
number_gpus = 1
sampling_params = SamplingParams(temperature=0.6, top_p=0.9, max_tokens=256)
tokenizer = AutoTokenizer.from_pretrained(model_id)
messages = [
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
{"role": "user", "content": "Who are you?"},
]
prompts = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
llm = LLM(model=model_id, tensor_parallel_size=number_gpus)
outputs = llm.generate(prompts, sampling_params)
generated_text = outputs[0].outputs[0].text
print(generated_text)
```
vLLM also supports OpenAI-compatible serving. See the [documentation](https://docs.vllm.ai/en/latest/) for more details.
## Creation
This model was created by applying [LLM Compressor](https://github.com/vllm-project/llm-compressor), as presented in the code snippet below.