Instructions to use udgamlabs/Laghu-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use udgamlabs/Laghu-MLX with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("udgamlabs/Laghu-MLX") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use udgamlabs/Laghu-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "udgamlabs/Laghu-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "udgamlabs/Laghu-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use udgamlabs/Laghu-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "udgamlabs/Laghu-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "udgamlabs/Laghu-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "udgamlabs/Laghu-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use udgamlabs/Laghu-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "udgamlabs/Laghu-MLX"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default udgamlabs/Laghu-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use udgamlabs/Laghu-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "udgamlabs/Laghu-MLX"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "udgamlabs/Laghu-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
UDGAM LABS · MLX · bf16, 303.6 MB
Laghu-MLX
Laghu, a 152M-parameter English chat model trained from scratch by Udgam Labs for $146 of pretraining compute, converted to MLX (bf16) for Apple silicon Macs. Full precision; use Laghu-MLX-8bit for half the size at almost the same quality.
Try it: in your browser, on your device · code on GitHub · udgamlabs.com/models/laghu
Quick start
pip install mlx-lm
mlx_lm.generate --model udgamlabs/Laghu-MLX --prompt "Who are you?" \
--chat-template-config '{"enable_thinking": false}'
For an OpenAI-compatible server: mlx_lm.server --model udgamlabs/Laghu-MLX --chat-template-args '{"enable_thinking":false}'.
The MLX server turns thinking on by default; the switch above turns it off. Sampling defaults: temperature 0.7, top-p
0.95, top-k 64. Keep context at 16,384 tokens or less.
Results
Measured by us on 2026-10-22 on a Mac mini (Apple M6, 24 GB), mlx-lm 0.32.0:
| File | Size | Perplexity | Mean KL vs F16 | Top-1 agreement | Generation speed |
|---|---|---|---|---|---|
| Laghu-MLX (bf16) | 303.6 MB | 52.25 | 0.0009 | 98.0% | about 319 tokens/s |
Held-out text: 32 windows of 2,048 tokens, compared with the F16 GGUF reference. MLX applies Laghu's 512-token sliding window, and the chat format (thinking off and on, multi-turn, tool calls) was checked in the MLX server. We do not publish a 4-bit MLX build: it loses clearly (mean KL 0.337, top-1 agreement 69.9%).
For the model's own results, see the Laghu model card.
Where it falls short
- Laghu is a small research model: weak at maths (GSM8K 7.9% with thinking) and instruction following (IFEval 26.1), knows little, and can loop with greedy decoding. Details on the model card.
- The MLX server turns thinking on by default; use the switch above for normal chat.
How it was trained
See the Laghu model card and the
technical report. Converted from the released safetensors with mlx_lm.convert
(mlx-lm 0.32.0).
Intended use and limitations
Local, offline use and research on Macs. Not for factual answers or decisions that matter; light safety training.
Licence
Apache-2.0. Copyright 2026 Udgam Labs LLP. The chat template is Google's Gemma 4 template (Apache-2.0).
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
- -
Quantized
