Text Generation
Transformers
Safetensors
GGUF
Arabic
English
arabic
edge
small-language-model
sft
dpo
qwen2
Eval Results (legacy)
conversational
Instructions to use RightNowAI/RightNow-Arabic-0.5B-Turbo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RightNowAI/RightNow-Arabic-0.5B-Turbo") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("RightNowAI/RightNow-Arabic-0.5B-Turbo", dtype="auto") - llama-cpp-python
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="RightNowAI/RightNow-Arabic-0.5B-Turbo", filename="gguf/RightNow-Arabic-0.5B-Turbo-f16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
Use Docker
docker model run hf.co/RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RightNowAI/RightNow-Arabic-0.5B-Turbo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RightNowAI/RightNow-Arabic-0.5B-Turbo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
- SGLang
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo 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 "RightNowAI/RightNow-Arabic-0.5B-Turbo" \ --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": "RightNowAI/RightNow-Arabic-0.5B-Turbo", "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 "RightNowAI/RightNow-Arabic-0.5B-Turbo" \ --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": "RightNowAI/RightNow-Arabic-0.5B-Turbo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo with Ollama:
ollama run hf.co/RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
- Unsloth Studio
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for RightNowAI/RightNow-Arabic-0.5B-Turbo to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for RightNowAI/RightNow-Arabic-0.5B-Turbo to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for RightNowAI/RightNow-Arabic-0.5B-Turbo to start chatting
- Pi
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
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 RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo with Docker Model Runner:
docker model run hf.co/RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
- Lemonade
How to use RightNowAI/RightNow-Arabic-0.5B-Turbo with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull RightNowAI/RightNow-Arabic-0.5B-Turbo:Q4_K_M
Run and chat with the model
lemonade run user.RightNow-Arabic-0.5B-Turbo-Q4_K_M
List all available models
lemonade list
| license: apache-2.0 | |
| language: | |
| - ar | |
| - en | |
| base_model: Qwen/Qwen2.5-0.5B | |
| pipeline_tag: text-generation | |
| tags: | |
| - arabic | |
| - edge | |
| - small-language-model | |
| - sft | |
| - dpo | |
| - gguf | |
| - qwen2 | |
| library_name: transformers | |
| model-index: | |
| - name: RightNow-Arabic-0.5B-Turbo | |
| results: | |
| - task: | |
| type: text-generation | |
| name: COPA-ar | |
| dataset: | |
| name: copa_ar | |
| type: copa_ar | |
| metrics: | |
| - type: acc_norm | |
| value: 58.4 | |
| name: Accuracy (norm) | |
| - task: | |
| type: text-generation | |
| name: Arabic HellaSwag | |
| dataset: | |
| name: arabic_mt_hellaswag | |
| type: arabic_mt_hellaswag | |
| metrics: | |
| - type: acc_norm | |
| value: 26.0 | |
| name: Accuracy (norm) | |
| - task: | |
| type: text-generation | |
| name: ArabicMMLU | |
| dataset: | |
| name: arabic_leaderboard_arabic_mmlu | |
| type: arabic_leaderboard_arabic_mmlu | |
| metrics: | |
| - type: acc | |
| value: 23.2 | |
| name: Accuracy | |
| <div align="center"> | |
| # RightNow-Arabic-0.5B-Turbo | |
| ### The smallest open Arabic-specialized decoder LLM | |
| **518M parameters | 398 MB on disk (q4_k_m) | 635 tok/s on H100** | |
| *Built by [RightNow AI](https://rightnowai.co)* | |
| <img src="benchmark_pareto.png" width="700"> | |
| </div> | |
| --- | |
| ## What is this? | |
| RightNow-Arabic-0.5B-Turbo is a **518M-parameter Arabic-specialized language model** built on top of Qwen2.5-0.5B via vocabulary injection, continued pretraining, supervised fine-tuning, and direct preference optimization. It is the **smallest open Arabic-specialized decoder LLM** with publicly available weights. | |
| The model targets **edge deployment**: phones, laptops, embedded devices, and browsers. Quantized to q4_k_m it fits in 398 MB and generates 635 tokens/s at batch size 1. | |
| ## Key Features | |
| - **27,032 new Arabic tokens** added via mean-subtoken initialization, cutting Arabic tokenizer fertility by 17.3% (2.18 to 1.80 tokens/word) | |
| - **504M Arabic pretraining tokens** (Arabic Wikipedia) on 8xH100 SXM5 with FSDP + FlashAttention varlen + Liger fused kernels | |
| - **129,116 Arabic instruction pairs** for SFT with response-only loss masking | |
| - **6,750 Arabic preference pairs** for DPO | |
| - **Weight soup merging** (DPO 50%, SFT 25%, Pretrain 25%) for optimal accuracy | |
| - **4 GGUF quantizations** for instant edge deployment | |
| ## Benchmarks | |
| Evaluated with [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness) v0.4.11, `apply_chat_template=True`, `limit=200`, `acc_norm` preferred. | |
| ### Head-to-head comparison | |
| | Model | Params | COPA-ar | HellaSwag-ar | ArabicMMLU | Mean | | |
| |-------|--------|---------|-------------|------------|------| | |
| | **RightNow-Arabic-0.5B-Turbo (ours)** | **518M** | **58.4%** | **26.0%** | 23.2% | **35.9%** | | |
| | Qwen2.5-0.5B-Instruct | 494M | 53.9% | 22.5% | **26.0%** | 34.1% | | |
| | Falcon-H1-0.5B-Instruct | 524M | 44.9% | 23.0% | 24.2% | 30.7% | | |
| | Falcon-H1-1.5B-Instruct | 1.5B | 58.4% | 27.5% | 32.7% | 39.5% | | |
| | AceGPT-7B-chat | 7B | 69.7% | 27.0% | 35.0% | 43.9% | | |
| | ALLaM-7B-Instruct | 7B | 68.5% | 29.0% | 52.2% | 49.9% | | |
| | SILMA-9B-Instruct | 9B | 69.7% | 38.0% | 52.9% | 53.5% | | |
| **Among 0.5B models**: best on COPA-ar (+4.5 vs Qwen), best on HellaSwag-ar (+3.5 vs Qwen), best mean (+1.8 vs Qwen, +5.2 vs Falcon). | |
| **Ties Falcon-H1-1.5B** on COPA-ar (both 58.4%) at one-third the parameters. | |
| **Recovers 67%** of SILMA-9B mean accuracy at 5.8% of the parameters. | |
| ## Available Formats | |
| | Format | Size | Speed (tok/s, bs=1, H100) | Use case | | |
| |--------|------|---------------------------|----------| | |
| | bf16 | 1.04 GB | 82 (HF generate) | Fine-tuning, research | | |
| | int8 | 664 MB | -- | Reduced memory inference | | |
| | GGUF f16 | 988 MB | 582 | Maximum quality | | |
| | **GGUF q8_0** | **525 MB** | **646** | Best speed | | |
| | GGUF q5_k_m | 419 MB | 634 | Balanced | | |
| | **GGUF q4_k_m** | **398 MB** | **635** | Smallest footprint | | |
| ## Quick Start | |
| ### With Transformers (bf16) | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "RightNowAI/RightNow-Arabic-0.5B-Turbo" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id, subfolder="bf16") | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_id, subfolder="bf16", | |
| torch_dtype="bfloat16", device_map="auto" | |
| ) | |
| messages = [ | |
| {"role": "system", "content": "أنت مساعد ذكي يجيب باللغة العربية الفصحى"}, | |
| {"role": "user", "content": "ما هي عاصمة المملكة العربية السعودية؟"} | |
| ] | |
| text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) | |
| inputs = tokenizer(text, return_tensors="pt").to(model.device) | |
| outputs = model.generate(**inputs, max_new_tokens=256) | |
| print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)) | |
| ``` | |
| ### With llama.cpp (GGUF) | |
| ```bash | |
| # Download the q8_0 quantization (best speed) | |
| huggingface-cli download RightNowAI/RightNow-Arabic-0.5B-Turbo \ | |
| gguf/RightNow-Arabic-0.5B-Turbo-q8_0.gguf --local-dir . | |
| # Run inference | |
| ./llama-cli -m RightNow-Arabic-0.5B-Turbo-q8_0.gguf \ | |
| -p "ما هي أكبر مدينة في مصر؟" \ | |
| -n 128 --temp 0.7 | |
| ``` | |
| ## Training Pipeline | |
| ``` | |
| Qwen2.5-0.5B (494M, 151,665 vocab) | |
| | | |
| v | |
| Tokenizer Surgery (+27,032 Arabic tokens -> 178,697 vocab) | |
| - SentencePiece unigram 32k on 12.5 GB Arabic corpus | |
| - Mean-subtoken embedding initialization | |
| - Fertility: 2.18 -> 1.80 tok/word (-17.3%) | |
| | | |
| v | |
| Continued Pretraining (504M arwiki tokens) | |
| - 2,500 steps, 8xH100 SXM5 | |
| - FSDP _HYBRID_SHARD_ZERO2 + FlashAttention varlen + Liger | |
| - Loss: 14.21 -> 1.69 | Wall time: 6h 57m | |
| | | |
| v | |
| Supervised Fine-Tuning (129,116 instructions) | |
| - 5 datasets: evol-instruct-arabic, alpaca-gpt4-arabic, | |
| sharegpt-arabic, CIDAR, aya_dataset | |
| - Response-only loss masking (72.1% of tokens carry loss) | |
| - 5 epochs, 418 steps | Wall time: 12m | |
| | | |
| v | |
| Direct Preference Optimization (6,750 pairs) | |
| - argilla-dpo-mix-7k-arabic | |
| - 2 epochs, 844 steps | Wall time: 34m | |
| | | |
| v | |
| Weight Soup Merging | |
| - Linear(DPO 0.5, SFT 0.25, Pretrain 0.25) | |
| - +0.44 points mean accuracy over DPO alone | |
| | | |
| v | |
| Export: bf16, int8, GGUF {f16, q8_0, q5_k_m, q4_k_m} | |
| ``` | |
| ## Training Data | |
| | Dataset | Examples/Tokens | Use | | |
| |---------|----------------|-----| | |
| | Arabic Wikipedia (wikimedia/wikipedia 20231101.ar) | 504M tokens | Continued pretraining | | |
| | FreedomIntelligence/evol-instruct-arabic | 59,022 | SFT | | |
| | FreedomIntelligence/alpaca-gpt4-arabic | 49,969 | SFT | | |
| | FreedomIntelligence/sharegpt-arabic | 5,231 | SFT | | |
| | arbml/CIDAR | 10,000 | SFT | | |
| | CohereForAI/aya_dataset (Arabic) | 4,947 | SFT | | |
| | 2A2I/argilla-dpo-mix-7k-arabic | 6,750 | DPO | | |
| ## Limitations | |
| - **Knowledge ceiling**: At 518M parameters, ArabicMMLU-style knowledge tasks lag 7B+ models by 12-30 points. This is a parameter-count limit, not a training limit. | |
| - **MSA only**: Trained on Wikipedia (Modern Standard Arabic). Dialects (Egyptian, Gulf, Levantine) get MSA responses. | |
| - **504M pretraining tokens**: Below Chinchilla-optimal ratio. More Arabic data would improve knowledge tasks. | |
| - **DPO was weak**: 6,750 machine-translated preference pairs provided minimal signal at 0.5B scale. The weight soup merge was more impactful. | |
| - **GGUF tile alignment**: q4_k_m and q5_k_m fall back to higher-bit quantization for 144/290 tensors due to the expanded vocabulary not aligning with k-quant tile sizes. | |
| ## Hardware | |
| All training ran on a single Nebius `gpu-h100-sxm` node: | |
| - 8x NVIDIA H100 80 GB SXM5 HBM3, NVLink4 | |
| - 128 vCPUs, 1.5 TiB RAM | |
| - CUDA 13.0, PyTorch 2.11, flash-attn 2.8.3, transformers 5.5.0 | |
| ## Citation | |
| ```bibtex | |
| @article{jaber2025rightnow, | |
| title={RightNow-Arabic-0.5B-Turbo: An Open Sub-1B Arabic Language Model via Vocabulary Injection and Edge-First Deployment}, | |
| author={Jaber, Jaber and Jaber, Osama}, | |
| year={2025}, | |
| url={https://huggingface.co/RightNowAI/RightNow-Arabic-0.5B-Turbo} | |
| } | |
| ``` | |
| ## License | |
| Apache 2.0 (same as the base Qwen2.5-0.5B model). | |
| --- | |
| *Built by [RightNow AI](https://rightnowai.co)* | |