Instructions to use FrontiersMind/Nandi-Mini-150M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FrontiersMind/Nandi-Mini-150M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FrontiersMind/Nandi-Mini-150M", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("FrontiersMind/Nandi-Mini-150M", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use FrontiersMind/Nandi-Mini-150M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FrontiersMind/Nandi-Mini-150M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FrontiersMind/Nandi-Mini-150M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FrontiersMind/Nandi-Mini-150M
- SGLang
How to use FrontiersMind/Nandi-Mini-150M 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 "FrontiersMind/Nandi-Mini-150M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FrontiersMind/Nandi-Mini-150M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "FrontiersMind/Nandi-Mini-150M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FrontiersMind/Nandi-Mini-150M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FrontiersMind/Nandi-Mini-150M with Docker Model Runner:
docker model run hf.co/FrontiersMind/Nandi-Mini-150M
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,81 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- hi
|
| 6 |
+
- mr
|
| 7 |
+
- ta
|
| 8 |
+
- te
|
| 9 |
+
- kn
|
| 10 |
+
- ml
|
| 11 |
+
- bn
|
| 12 |
+
- pa
|
| 13 |
+
- gu
|
| 14 |
+
- or
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
library_name: transformers
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# Nandi-150M
|
| 20 |
+
|
| 21 |
+
## Introduction
|
| 22 |
+
|
| 23 |
+
Nandi-150M is a compact, efficient multilingual language model designed for strong performance in resource-constrained environments. It is trained from scratch on **475 billion tokens** and supports **English and 10 Indic languages**.
|
| 24 |
+
|
| 25 |
+
Nandi-150M focuses on maximizing performance per parameter through architectural efficiency rather than scale. It is well-suited for **on-prem deployments**, **low-latency applications**, and **edge use cases**.
|
| 26 |
+
|
| 27 |
+
Nandi-150M brings the following key features:
|
| 28 |
+
|
| 29 |
+
- Strong **multilingual capability** across English and Indic languages
|
| 30 |
+
- Efficient design enabling **high performance at small scale (150M parameters)**
|
| 31 |
+
- Improved training stability via **layer rescaling and z-loss regularization**
|
| 32 |
+
- Reduced memory footprint using **factorized embeddings**
|
| 33 |
+
- Better parameter efficiency through **layer sharing**
|
| 34 |
+
- **Grouped Query Attention (GQA)** for faster inference
|
| 35 |
+
- **RoPE-based positional encoding** for improved sequence modeling
|
| 36 |
+
|
| 37 |
+
**This repo contains the base Nandi-150M model**, which has the following features:
|
| 38 |
+
|
| 39 |
+
- Type: Causal Language Model
|
| 40 |
+
- Training Stage: Pretraining (from scratch)
|
| 41 |
+
- Architecture: Transformer decoder with RoPE, RMSNorm, SwiGLU, GQA, tied embeddings
|
| 42 |
+
- Number of Parameters: ~150M
|
| 43 |
+
- Number of Layers: 16
|
| 44 |
+
- Number of Attention Heads: 16 (Q) / 4 (KV)
|
| 45 |
+
- Context Length: 2,048 tokens
|
| 46 |
+
- Vocabulary Size: 131,072
|
| 47 |
+
- Embedding: Factorized (rank = 196)
|
| 48 |
+
- Precision: bfloat16
|
| 49 |
+
|
| 50 |
+
## 🌍 Supported Languages
|
| 51 |
+
|
| 52 |
+
The model is trained on English and a diverse set of Indic languages, including (but not limited to):
|
| 53 |
+
|
| 54 |
+
- Hindi
|
| 55 |
+
- Bengali
|
| 56 |
+
- Tamil
|
| 57 |
+
- Telugu
|
| 58 |
+
- Marathi
|
| 59 |
+
- Gujarati
|
| 60 |
+
- Kannada
|
| 61 |
+
- Malayalam
|
| 62 |
+
- Punjabi
|
| 63 |
+
- Odia
|
| 64 |
+
|
| 65 |
+
---
|
| 66 |
+
|
| 67 |
+
## 🚀 Usage
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 71 |
+
|
| 72 |
+
model_name = "Rta-AILabs/Nandi-150M"
|
| 73 |
+
|
| 74 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 75 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 76 |
+
|
| 77 |
+
prompt = "Explain transformer in simple words."
|
| 78 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 79 |
+
|
| 80 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
| 81 |
+
print(tokenizer.decode(outputs[0]))
|