Instructions to use udgamlabs/Laghu-Base-32K with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use udgamlabs/Laghu-Base-32K with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="udgamlabs/Laghu-Base-32K") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("udgamlabs/Laghu-Base-32K") model = AutoModelForCausalLM.from_pretrained("udgamlabs/Laghu-Base-32K", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use udgamlabs/Laghu-Base-32K with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "udgamlabs/Laghu-Base-32K" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "udgamlabs/Laghu-Base-32K", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/udgamlabs/Laghu-Base-32K
- SGLang
How to use udgamlabs/Laghu-Base-32K with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "udgamlabs/Laghu-Base-32K" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "udgamlabs/Laghu-Base-32K", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "udgamlabs/Laghu-Base-32K" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "udgamlabs/Laghu-Base-32K", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use udgamlabs/Laghu-Base-32K with Docker Model Runner:
docker model run hf.co/udgamlabs/Laghu-Base-32K
UDGAM LABS · Language model · 152M parameters, long-context base
Laghu-Base-32K
Laghu-Base-32K is Laghu-Base after a long-context stretch: 1,900 more steps (996M tokens) at a 32,768-token context. It finds a hidden code reliably up to 16K tokens and not beyond. These weights (step 1,900) are where supervised fine-tuning of the chat model Laghu started. It is a text completer, not a chat model. Part of a fully open research release.
Try it: the chat model · code on GitHub · udgamlabs.com/models/laghu
Quick start
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("udgamlabs/Laghu-Base-32K")
model = AutoModelForCausalLM.from_pretrained("udgamlabs/Laghu-Base-32K")
inputs = tok(open("long_document.txt").read() + "\n\nIn summary,", return_tensors="pt") # adds <bos>
out = model.generate(**inputs, max_new_tokens=80, do_sample=True, temperature=0.8, top_p=0.95)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Use inputs up to 16K tokens. The config allows 32,768 positions, but recall fails beyond about 16K.
Results
Measured by us on 2026-10-19 (scripts in udgam3/runs/ctx32k/ on GitHub).
Hidden-code recall (one 5-digit code in filler text, exact match, 100 trials per length):
| Context | 1K | 2K | 4K | 8K | 12K | 16K | 24K | 32K |
|---|---|---|---|---|---|---|---|---|
| Laghu-Base-32K | 100% | 100% | 100% | 100% | 99% | 96% | 0% | 0% |
| Laghu-Base (2K) | 100% | 100% | 0% | 0% | 0% | 0% | 0% | 0% |
On 400 long documents, bits per byte stay flat from 2K to 32K tokens (0.92-0.94); the 2K base rises to 1.39 by 16K.
Cost on short text (same documents and settings for both models):
| Check | Laghu-Base | Laghu-Base-32K | Change |
|---|---|---|---|
| 5-task average on the validation splits (ARC-E, ARC-C, HellaSwag, PIQA, WinoGrande) | 50.81 | 50.05 | −0.76 points |
| Bits per byte at 2K: web | 0.8501 | 0.8535 | +0.40% |
| Bits per byte at 2K: chat-formatted task text | 0.6341 | 0.6393 | +0.82% |
| Bits per byte at 2K: reasoning | 0.6845 | 0.6920 | +1.10% |
| Bits per byte at 2K: new text | 0.9209 | 0.9206 | −0.04% |
Where it falls short
- Recall works to 16K tokens and fails completely at 24K and 32K.
- The stretch costs a little short-text quality: −0.76 points on the commonsense average and +1.10% bits per byte on reasoning text, which missed the 1% limit we had set ourselves (we accepted it and say so).
- Only one long-context task (finding a code) was tested; summarising or answering questions over long documents was not measured on this base model.
- Not instruction-tuned.
How it was trained
From the EMA weights of Laghu-Base (step 76,294): 1,900 steps × 524,288 tokens at 32,768 context, on one RTX PRO 6000 (96 GB) for about 4 hours. Data (about 1.0B tokens): 42% long documents (books, papers, government text and code from the Common Pile, already used for our earlier model Gargi), about 8% long modern documents (web, code, Wikipedia), and 50% replay of pretraining cool-down text the main run never read; all 13-gram decontaminated. The data is published as a rebuild script, not re-hosted. The raw training states at steps 1,750 and 1,900 (with optimiser) are in Laghu-Checkpoints; earlier stretch checkpoints were deleted by a storage clean-up on 2026-10-21, our mistake.
Intended use and limitations
A long-context base for research and fine-tuning. No safety tuning; it continues any text, including harmful or false text.
Licence
Apache-2.0. Copyright 2026 Udgam Labs LLP. Training-data credits: DATA_LICENSES.
Citation
@misc{udgamlabs2026laghu,
title = {Laghu: a fully open 152M chat model trained from scratch},
author = {Prasad, Jitesh K},
year = {2026},
howpublished = {Udgam Labs},
url = {https://huggingface.co/udgamlabs/Laghu}
}
About Udgam Labs. Udgam Labs is an independent AI research lab. We work from first principles: before we build, we understand why things work, whether we are training a model, fine-tuning one or applying AI to a new problem. Udgam (उद्गम) is Sanskrit for origin. udgamlabs.com
- Downloads last month
- -
