Instructions to use Darkrider/nirnaya-flash-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Darkrider/nirnaya-flash-1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Darkrider/nirnaya-flash-1.0") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Darkrider/nirnaya-flash-1.0") model = AutoModelForMultimodalLM.from_pretrained("Darkrider/nirnaya-flash-1.0", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Darkrider/nirnaya-flash-1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Darkrider/nirnaya-flash-1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Darkrider/nirnaya-flash-1.0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Darkrider/nirnaya-flash-1.0
- SGLang
How to use Darkrider/nirnaya-flash-1.0 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 "Darkrider/nirnaya-flash-1.0" \ --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": "Darkrider/nirnaya-flash-1.0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "Darkrider/nirnaya-flash-1.0" \ --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": "Darkrider/nirnaya-flash-1.0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Darkrider/nirnaya-flash-1.0 with Docker Model Runner:
docker model run hf.co/Darkrider/nirnaya-flash-1.0
Nirnaya Flash 1.0
Nirnaya (ΰ€¨ΰ€Ώΰ€°ΰ₯ΰ€£ΰ€―) means "decision" in Hindi. The Nirnaya family are decision models: give one a state and a set of questions, and it returns one answer per question with a probability on every option, in a single pass.
Nirnaya Flash 1.0 is the fastest and best-calibrated member of the family. It reads text, images and audio, in English and Indian languages.
| Base model | Gemma 4 E4B |
| Public Decision Index 0.3 | 51.90 |
| Public vision index | 59.44 |
| Median latency | 30 ms per request (p95 164 ms), measured with the vLLM inference engine |
| Options per question | Up to 255 |
The figures above come from complete runs of the Decision Index kit. Private board scores are added here once they are published.
How to run it
The model needs the inference code in github.com/NeverInAsh/nirnaya-inference and the Decision Index kit.
python -m decision_index run --engine mmclm.di_engine:NirnayaEngine \
--option model=<model dir> --option head=<model dir>/head.pt \
--option temperature_fit=<model dir>/t_entropy.json \
--option twice_max=3000 --option max_model_len=32768 --option gpu_mem=0.85 \
--edition 0.3 --rows <rows.jsonl> --out <run dir>
For the vision suite, use mmclm.di_engine:NirnayaVisionEngine with max_soft_tokens=560 and max_images=2.
For audio, use mmclm.di_engine:NirnayaAudioEngine. Install librosa fastapi uvicorn python-multipart, start the HTTP server with python -m mmclm.serve --model <model dir> --port 8000, and send requests to POST /v1/decisions.
| File | What it is |
|---|---|
model*.safetensors |
Fine-tuned model weights |
head.pt |
The decision head, which scores every option |
t_entropy.json |
Serving temperature used for calibration |
Training data
The model was fine-tuned on a huge amount of data: about 69% text, 17% images and 14% audio, with about 13% in languages other than English. We don't publish the list of sources. By category, they cover:
- Decisions and routing: intent detection, classification and support-style triage
- Tools and agents: whether and which tool to call
- Safety: harmful requests, over-refusal and manipulation
- Knowledge and reasoning: science, maths, commonsense and causal questions
- Language understanding: entailment, stance, sarcasm and coreference
- Retrieval: relevance and whether an answer is supported by its source
- Images: charts, receipts and documents, screens, spatial reasoning, counting and memes
- Audio: speech, voice commands, environmental sounds, music and emotion, how many people are talking, and call quality
- Indian languages: Hindi, Hinglish, Bengali, Tamil, Telugu, Marathi, Kannada, Malayalam, Urdu and others
Labels come from each source's ground truth, from rules for generated data and, for part of the data, from soft labels produced by a larger Gemma model.
How we kept test data out of training
We excluded every Decision Index benchmark source from the start. We then filtered every candidate training row against all rows of the public Decision Index 0.3 suite, the public vision suite and our own held-out tests. A row is dropped when it fails any of these checks:
| Check | What it catches |
|---|---|
| Exact text | The same normalised string of 25 or more characters |
| 13-word overlap | Any run of 13 consecutive words shared with a test row |
| Perceptual image hash | An image within 2 bits of a test image on a 64-bit perceptual hash, which catches resized and re-encoded copies |
Example. Say a test row contains:
The customer says the parcel left the warehouse on Monday but has still not arrived at the address.
And a candidate training row contains:
Yesterday the customer says the parcel left the warehouse on Monday but has still not arrived, so they called.
The sentences differ, so an exact check alone would miss this. But both contain the same 13 consecutive words, "the customer says the parcel left the warehouse on Monday but has still", so the row is dropped.
Limits of these checks:
- We can't see the board's private tests, so we couldn't filter against them directly. Excluding benchmark sources is our protection there.
- The 13-word check only counts words in Latin script, so text in Indian scripts is covered by the exact check only.
- Short phrases that recur across many rows as shared templates don't count as matches, and rule-generated data gets the exact check only, because shared field names would otherwise match by accident.
- The public suites contain no audio, so audio has no equivalent perceptual check against them.
- After training, we checked our held-out language, audio and image tests for exact questions or media shared with the training rows, and removed the small overlap found (a set of sound clips) before scoring. This check doesn't detect paraphrases.
Calibration
Probabilities are calibrated with an entropy-aware temperature fitted on our own test set, never on the Decision Index suite. It softens confidence and never changes which option is chosen. On the public suite, using the board's published definition, we estimate ECE at about 3.9 and NLL at about 0.87. The board publishes its own figures after review.
Limits
- Scores on listed options aren't the same as open transcription or free-form answering.
- Hard multi-step reasoning is weak, as expected from a one-pass model. Hand those cases to a larger model.
- Don't use it as the only check for medical, legal or financial decisions, or for anything safety-critical.
- Confidence can be too high on ambiguous inputs, so validate thresholds on your own task.
Using Nirnaya
The weights are open and need no sign-up. If you build with Nirnaya, a "Built with Nirnaya" mention is appreciated.
Licence
Nirnaya Flash 1.0 is a modified version of Gemma 4 E4B and is released under the Apache License 2.0, the same licence as the base model. See NOTICE for attribution, which anyone redistributing this model must keep.
- Downloads last month
- 33