Downloads · 30 days
43
5% of all-time downloads
Jimmi42/sarvam-m-4bit-mlx
sarvam-m-4bit-mlx is a text generation model from Jimmi42. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as apache-2.0.
This is a 4-bit quantized version of sarvamai/sarvam-m optimized for Apple Silicon using MLX.
Downloads · 30 days
43
5% of all-time downloads
All-time downloads
883
Public
Parameters
23.6B
13.3 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors13.3 GB · 100%
How the weights are stored.
U3223.6B · 100%
From the Hugging Face model README
This is a 4-bit quantized version of sarvamai/sarvam-m optimized for Apple Silicon using MLX.
# Install MLX and dependencies
pip install mlx-lm transformers
# For chat functionality (optional)
pip install gradio
Having issues with short responses or "EOS token" problems in LM Studio?
👉 See the complete LM Studio Setup Guide
Quick Fix: Use proper chat formatting:
[INST] Your question here [/INST]
The model requires specific prompt formatting to work correctly in LM Studio.
from mlx_lm import load, generate
# Load the model
model, tokenizer = load("your-username/sarvam-m-4bit-mlx")
# Simple generation
response = generate(
model,
tokenizer,
prompt="What is the capital of India?",
max_tokens=50
)
print(response)
from mlx_lm import load, generate
model, tokenizer = load("your-username/sarvam-m-4bit-mlx")
# No thinking mode (direct answers)
messages = [{'role': 'user', 'content': 'What is 2+2?'}]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
enable_thinking=False
)
response = generate(model, tokenizer, prompt=prompt, max_tokens=20)
print(response) # Output: The sum of 2 and 2 is **4**.
# With thinking mode (shows reasoning)
messages = [{'role': 'user', 'content': 'Solve: 15 * 23'}]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
enable_thinking=True
)
response = generate(model, tokenizer, prompt=prompt, max_tokens=100)
print(response) # Output: <think>Let me calculate...</think> The answer is 345.
# Hindi conversation
messages = [{'role': 'user', 'content': 'भारत की राजधानी क्या है?'}]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
enable_thinking=False
)
response = generate(model, tokenizer, prompt=prompt, max_tokens=50)
print(response)
# Output: भारत की राजधानी **नई दिल्ली** है। यह देश की राजनीतिक, प्रशासनिक...
# Code generation
messages = [{'role': 'user', 'content': 'Write a Python function to calculate fibonacci numbers'}]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
enable_thinking=False
)
response = generate(model, tokenizer, prompt=prompt, max_tokens=150)
print(response)
# Simple generation
python -m mlx_lm generate \
--model your-username/sarvam-m-4bit-mlx \
--prompt "Hello, how are you?" \
--max-tokens 50
# Interactive chat
python -m mlx_lm chat --model your-username/sarvam-m-4bit-mlx
| Metric | Value |
|---|---|
| Model Size | ~12GB |
| Peak Memory Usage | ~13.3GB |
| Generation Speed | 18-36 tokens/sec |
| Quantization Bits | 4.5 bits per weight |
| Supported Languages | 11 (English + 10 Indic) |
This model follows the same license as the original Sarvam-M model. Please refer to the original model card for license details.
@misc{sarvam-m-mlx,
title={Sarvam-M 4-bit MLX: Quantized Indian Language Model for Apple Silicon},
author={Community Contribution},
year={2025},
url={https://huggingface.co/your-username/sarvam-m-4bit-mlx}
}
For issues specific to this MLX version:
For general model issues, refer to the original Sarvam-M repository.
This model was quantized using MLX-LM tools and optimized for Apple Silicon. It maintains the quality and capabilities of the original Sarvam-M while providing significant efficiency improvements.