πŸš€ RIFA Nano 0.5B

A compact, multilingual AI assistant β€” built for speed, efficiency, and everyday usefulness.

Model Base License Params

Developed by SM Shahbaj


πŸ“– Overview

RIFA Nano is the smallest and fastest model in the RIFA series β€” a family of language models built to run efficiently across a wide range of hardware, from low-end mobile devices to modern GPUs. Nano is fine-tuned on top of Qwen2.5-0.5B-Instruct using LoRA, combining a strong identity, multilingual fluency, and lightweight coding ability in a package small enough to run almost anywhere.

Model Parameters Best For
RIFA Nano ⭐ 0.5B Low-end / mobile devices, fast responses
RIFA Flash 1.5B Balanced performance and speed
RIFA Pro 3B Complex reasoning, heavier workloads

✨ Capabilities

  • 🌐 Multilingual β€” fluent in English, Bengali (বাংলা), and Banglish
  • πŸ’¬ General assistant β€” Q&A, everyday writing, summarization, explanations
  • πŸ’» Basic coding β€” short scripts, debugging help, code explanations
  • 🧭 Honest by design β€” responds "Sorry, I don't have the answer for that right now" instead of making things up
  • πŸͺͺ Stable identity β€” consistently identifies as RIFA Nano, resistant to prompts trying to make it claim another identity

πŸš€ Quick Start

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_id = "smshahbaj/Rifa-Nano-0.5B"

model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.float16,
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(model_id)

messages = [
    {"role": "user", "content": "Who are you?"}
]

text = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer([text], return_tensors="pt").to(model.device)

with torch.no_grad():
    output = model.generate(
        **inputs,
        max_new_tokens=200,
        temperature=0.5,
        top_p=0.9,
        repetition_penalty=1.15,
    )

response = tokenizer.decode(
    output[0][inputs["input_ids"].shape[-1]:],
    skip_special_tokens=True
)
print(response)

πŸ‹οΈ Training Details

Base model Qwen/Qwen2.5-0.5B-Instruct
Method LoRA (r=16, Ξ±=32, dropout=0.05)
Identity dataset 308 samples (English, Bangla, Banglish, adversarial/jailbreak-resistant, 5x repeated)
General data Bangla Alpaca + English Alpaca + CodeAlpaca
Epochs 4
Hardware Kaggle GPU (T4 x2)
Precision 4-bit (NF4) training, merged to FP16

⚠️ Limitations

  • As the smallest model in the RIFA series, Nano is not built for long, multi-step reasoning β€” use RIFA Flash or RIFA Pro for complex tasks.
  • Knowledge has a training cutoff and the model has no internet access.
  • No persistent memory between conversations by default.
  • Best suited for lightweight, everyday tasks rather than deep technical or research-grade work.

πŸ“œ License

Released under the Apache 2.0 license, consistent with the base model.


πŸ‘€ Developer

Built and fine-tuned by SM Shahbaj β€” full-stack developer, founder of Smart Web BD and Risha Apps, independent music producer, and author of the sci-fi novel Micro Mayhem (2023).


Part of the RIFA model series β€” Nano Β· Flash Β· Pro

Downloads last month
-
Safetensors
Model size
0.5B params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for smshahbaj/Rifa-Nano-0.5B

Adapter
(766)
this model