Instructions to use M37labsorg/Saransh-1.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use M37labsorg/Saransh-1.7B with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "summarization" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("summarization", model="M37labsorg/Saransh-1.7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("M37labsorg/Saransh-1.7B") model = AutoModelForCausalLM.from_pretrained("M37labsorg/Saransh-1.7B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Saransh 1.7B
Saransh (सारांश, Sanskrit for "summary") is a compact instruction tuned summarization model that produces faithful, readable summaries at a length you control: one or two sentences, a single paragraph, a detailed multi paragraph treatment, or an explicit word budget you specify.
It is built for the everyday case. Paste one to three pages of text, say how long you want the summary, and get well formed English prose back. At 4 bit quantization it occupies roughly 1.1 GB and runs comfortably on a laptop.
Why this model
- Length control that actually holds. Asked for one or two sentences, the untuned base model writes 252 words. Saransh writes 24. Length adherence went from 0 percent to 100 percent on short requests and from 0 percent to 91 percent on paragraph requests.
- Explicit word budgets. "Summarize in about 120 words" is a trained behaviour, not a hopeful prompt. Roughly a third of the training corpus carries explicit numeric targets.
- Faithfulness by construction. Training examples whose reference summary asserted numbers or named entities absent from its own source document were removed, along with every example that attributed a claim to a publication not present in the source.
- Runs locally. Quantized GGUF builds work in Ollama, LM Studio and llama.cpp with no GPU required.
- Permissive licence. Apache 2.0, inherited from Qwen3, so commercial use is allowed.
Model specifications
| Property | Value |
|---|---|
| Parameters | 1,720,574,976 (1.72 B) |
| Architecture | Qwen3, decoder only transformer |
| Layers | 28 |
| Hidden size | 2048 |
| Feed forward size | 6144 |
| Attention heads | 16 query, 8 key/value (grouped query attention) |
| Head dimension | 128 |
| Activation | SwiGLU |
| Normalisation | RMSNorm, epsilon 1e-6 |
| Position encoding | Rotary (RoPE) |
| Tied embeddings | Yes |
| Vocabulary | 151,936 tokens, byte level BPE |
| Trained context window | 8,192 tokens (roughly 12 pages of English prose) |
| Architectural maximum context | 40,960 tokens |
| Training precision | bfloat16, full parameter fine tune |
| Objective | Causal language modelling with completion only loss |
| Chat format | ChatML, no reasoning or thinking block |
Length control
Every training example was assigned a length bucket derived from its reference summary, and paired with an instruction matching that bucket. That coupling is what makes the modes distinct behaviours rather than polite suggestions.
| Mode | Instruction | Typical output |
|---|---|---|
| Short | Summarize the following text in one or two sentences. |
1 to 2 sentences |
| Medium | Write a concise summary of the following text in a single paragraph. |
one paragraph |
| Long | Write a detailed summary of the following text, covering all the main points. |
multiple paragraphs |
| Explicit | Summarize the following text in about 120 words. |
close to the number given |
Each bucket was trained with five different phrasings, so paraphrases of these instructions work as well.
Usage
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "M37labsorg/Saransh-1.7B"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16", device_map="auto")
text = open("article.txt").read()
msgs = [{"role": "user", "content":
"Write a concise summary of the following text in a single paragraph."
"\n\n---\n" + text + "\n---"}]
prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
ids = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**ids, max_new_tokens=420, do_sample=False)
print(tok.decode(out[0][ids.input_ids.shape[1]:], skip_special_tokens=True))
The chat template injects the Saransh system prompt automatically when you do not supply one, so a bare user turn behaves correctly.
Ollama
ollama run hf.co/M37labsorg/Saransh-1.7B-GGUF:Q4_K_M
LM Studio
Search for M37labsorg/Saransh-1.7B-GGUF in the model browser, or place a .gguf file in
your local models directory. Set context length to 8192 and temperature to 0.3.
Recommended generation settings
| Parameter | Value | Reason |
|---|---|---|
do_sample |
False |
Summarization benefits from determinism |
temperature |
0.3 (if sampling) | Low creativity, high fidelity |
repetition_penalty |
1.05 | Discourages loops on long inputs |
max_new_tokens |
160 / 420 / 1024 | Short / medium / long |
| Context | 8192 | The trained maximum |
Quantized builds
Available at M37labsorg/Saransh-1.7B-GGUF.
| File | Bits | Size | Use case |
|---|---|---|---|
saransh-1.7b-Q4_K_M.gguf |
4 | 1.1 GB | Default for laptops, best size to quality ratio |
saransh-1.7b-Q5_K_M.gguf |
5 | 1.3 GB | Slightly higher fidelity |
saransh-1.7b-Q8_0.gguf |
8 | 1.8 GB | Near lossless |
saransh-1.7b-f16.gguf |
16 | 3.4 GB | Reference, no quantization loss |
Training corpus
A curated mixture spanning the domains a general summarizer actually encounters, covering news, conversation, legislation, government reporting, literature and scientific writing.
| Source | Domain | Contribution |
|---|---|---|
| CNN / DailyMail | News articles | Short and medium summaries |
| XSum | BBC news | Extreme compression, single sentence |
| Multi-News | Multi document news clusters | Medium and long |
| DialogSum | Everyday conversation | Short |
| SAMSum | Messenger style chat | Short |
| BillSum | United States legislation | Medium and long |
| GovReport | Government research reports | Long |
| BookSum | Literature, chapter level | Long |
| arXiv | Scientific papers | Long |
| PubMed | Biomedical papers | Long |
The corpus was reduced from 128,787 candidate examples to 97,038 through three successive curation passes.
Data curation
Generic quality filtering removed examples that fail basic summarization criteria: summaries that do not compress the source, implausible compression ratios, truncated references, non prose content, near duplicate documents and anything exceeding the context window. Source documents are never truncated. An over length example is dropped instead, because truncating a document while keeping its full summary teaches the model to invent the missing content.
Faithfulness filtering was added after measuring the reference summaries directly. In the raw corpus, 14.8 percent of numbers and 35.9 percent of proper nouns in XSum reference summaries do not appear in the documents those summaries describe. Multi-News scored 12.0 percent and 22.0 percent on the same measures. References like these teach confabulation, so examples were removed when the summary asserted a number or named entity absent from its own source, with number word normalisation so that "eighteen" in a document supports "18" in its summary.
Attribution filtering removed a specific and common failure. Multi-News reference summaries routinely credit claims to publications that never appear in the source document, phrases of the form "according to a report in the New York Times". This taught the model a template it would then fill with a plausible sounding but invented outlet. Every example carrying an unsupported attribution was dropped, which removed 10,087 Multi-News examples, roughly 46 percent of that dataset.
Length distribution after curation: 39,345 short, 29,241 medium and 28,452 long examples, with 35 percent of all examples carrying an explicit numeric word target.
Evaluation
Measured on 300 held out documents spanning all ten source datasets, greedy decoding, compared against the untuned base model under identical prompts.
| Metric | Qwen3-1.7B base | Saransh 1.7B |
|---|---|---|
| ROUGE-1 | 0.190 | 0.387 |
| ROUGE-2 | 0.049 | 0.170 |
| ROUGE-L | 0.106 | 0.271 |
Length adherence
The share of requests whose output lands inside the band that was asked for.
| Mode | Base words out | Base on target | Saransh words out | Saransh on target |
|---|---|---|---|---|
| Short | 252.1 | 0 percent | 23.9 | 100 percent |
| Medium | 332.4 | 0 percent | 86.9 | 91 percent |
| Long | 525.2 | 100 percent | 346.7 | 98 percent |
The base model ignores length instructions entirely. Asked for one or two sentences it produces 252 words. Closing that gap is the central purpose of the fine tune.
ROUGE-L by source
| Source | ROUGE-L |
|---|---|
| BillSum | 0.396 |
| DialogSum | 0.322 |
| SAMSum | 0.309 |
| XSum | 0.259 |
| PubMed | 0.238 |
| Multi-News | 0.226 |
| arXiv | 0.223 |
| CNN / DailyMail | 0.219 |
| GovReport | 0.218 |
| BookSum | 0.123 |
Limitations
Every number and proper noun in 300 generated summaries was checked against the document it summarized.
| Failure mode | Rate |
|---|---|
| Output contains a number absent from the source | 3.3 percent |
| Output contains a name absent from the source | 8.3 percent |
| Output invents a publication name | 0.7 percent |
The name figure is an upper bound, since it counts morphological variants and legitimate paraphrase as unsupported. The invented publication case is rare but real, inherited from news summarization references, and appears most often on science and news writing. Verify attributions before quoting them.
Further limitations:
- English only.
- Inputs beyond 8,192 tokens require chunking.
- Moderately extractive. About 30 percent of output 8-grams appear verbatim in the source.
- Verbose relative to references, overshooting reference length by 20 to 35 percent. Use the explicit word count form when you need a precise budget.
- Long mode on a short document converges toward medium mode output, which is correct behaviour, since a short document cannot support a detailed summary.
- Summarization can drop or blur detail. Review the output before relying on it for legal, medical or financial decisions.
Intended use
Saransh is intended for summarizing English prose documents: articles, reports, transcripts, papers and correspondence. It is suitable for local and offline deployment, batch document processing and integration into note taking or research tooling.
It is not intended for factual question answering, translation, open ended conversation, or any application where an unverified summary would drive a consequential decision.
Licence and attribution
Released under Apache 2.0, inherited from the base model. Saransh is a derivative work of Qwen/Qwen3-1.7B.
Citation
@misc{maithani2026saransh,
title = {Saransh: A Length Controlled Small Language Model for Abstractive Summarization},
author = {Maithani, Aniket for M37Labs},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/M37labsorg/Saransh-1.7B}}
}
- Downloads last month
- -