Instructions to use tifin-india/sarvam-m-24b-q4-k-s-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use tifin-india/sarvam-m-24b-q4-k-s-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="tifin-india/sarvam-m-24b-q4-k-s-gguf", filename="Sarvam-M-24B-Q4_K_S.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tifin-india/sarvam-m-24b-q4-k-s-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S # Run inference directly in the terminal: llama-cli -hf tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S # Run inference directly in the terminal: llama-cli -hf tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S # Run inference directly in the terminal: ./llama-cli -hf tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S # Run inference directly in the terminal: ./build/bin/llama-cli -hf tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S
Use Docker
docker model run hf.co/tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S
- LM Studio
- Jan
- vLLM
How to use tifin-india/sarvam-m-24b-q4-k-s-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tifin-india/sarvam-m-24b-q4-k-s-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tifin-india/sarvam-m-24b-q4-k-s-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S
- Ollama
How to use tifin-india/sarvam-m-24b-q4-k-s-gguf with Ollama:
ollama run hf.co/tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S
- Unsloth Studio
How to use tifin-india/sarvam-m-24b-q4-k-s-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tifin-india/sarvam-m-24b-q4-k-s-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tifin-india/sarvam-m-24b-q4-k-s-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tifin-india/sarvam-m-24b-q4-k-s-gguf to start chatting
- Docker Model Runner
How to use tifin-india/sarvam-m-24b-q4-k-s-gguf with Docker Model Runner:
docker model run hf.co/tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S
- Lemonade
How to use tifin-india/sarvam-m-24b-q4-k-s-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tifin-india/sarvam-m-24b-q4-k-s-gguf:Q4_K_S
Run and chat with the model
lemonade run user.sarvam-m-24b-q4-k-s-gguf-Q4_K_S
List all available models
lemonade list
sarvam-m-24b - Q4_K_S GGUF
This repository contains the Q4_K_S quantized version of sarvam-m-24b in GGUF format.
Model Details
- Quantization: Q4_K_S
- File Size: ~12.6GB
- Description: Small Q4 model with greater quality loss
- Format: GGUF (compatible with llama.cpp)
Usage
With llama.cpp
# Download the model
huggingface-cli download tifin-india/sarvam-m-24b-q4_k_s-gguf
# Run inference
./main -m sarvam-m-24b-Q4_K_S.gguf -p "Your prompt here"
With Python (llama-cpp-python)
from llama_cpp import Llama
# Load the model
llm = Llama(
model_path="./sarvam-m-24b-Q4_K_S.gguf",
n_ctx=2048, # Context length
n_gpu_layers=35, # Adjust based on your GPU
verbose=False
)
# Generate text
response = llm("Your prompt here", max_tokens=100)
print(response['choices'][0]['text'])
With Transformers + AutoGGUF
from transformers import AutoTokenizer
from auto_gptq import AutoGPTQForCausalLM
model_name = "tifin-india/sarvam-m-24b-q4_k_s-gguf"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoGPTQForCausalLM.from_quantized(model_name)
Performance Characteristics
| Aspect | Rating |
|---|---|
| Speed | โญโญโญ |
| Quality | โญโญโญ |
| Memory | โญโญโญ |
Original Model
This is a quantized version of the original model. For the full-precision version and more details, please refer to the original model repository.
Quantization Details
This model was quantized using llama.cpp's quantization tools. The Q4_K_S format provides a good balance of model size, inference speed, and output quality for most use cases.
License
This model follows the same license as the original model (Apache 2.0).
Citation
If you use this model, please cite the original model authors and acknowledge the quantization.
- Downloads last month
- 13
4-bit
Model tree for tifin-india/sarvam-m-24b-q4-k-s-gguf
Base model
mistralai/Mistral-Small-3.1-24B-Base-2503