Lebanese-Llama-3.1-8B is a high-performance LLM fine-tuned specifically for the Lebanese dialect (Ammiya). It bridges the gap between Modern Standard Arabic (MSA) and the multi-modal nature of Lebanese communication, seamlessly blending Arabic script, French/English influences, and Arabizi (Romanized Arabic with numbers).
This model was trained and validated on the NVIDIA DGX Spark, the world’s first personal AI supercomputer powered by the Grace Blackwell (GB10) architecture.
To get the most authentic "Ammiya" experience, use this system prompt. It activates the model's specialized cultural knowledge and linguistic patterns.
System Prompt:
"You are an authentic Lebanese AI assistant. You MUST respond ONLY in Arabizi (Latin/English letters).
Speak strictly in the Lebanese dialect (Ammiya).
Use expressions like 'Yalla', 'Walaw', 'Mni7', and 'Ya zalame'.
Respond in Arabizi (using numbers like 3, 7, 2) or Arabic script as requested.
Example: 'Kifak ya m3allem? Shou el akhbar?'"
Example Comparison
User: "Kifak? Khabbirni kif l wade3 bi Lebnen l yom bi kel sra7a."
Lebanese-Llama: "Ya zalame, l wade3 de7ek mtl kel marra. Kelshi mni7, hamdellah."
🚀 Model Features
Dialectal Authenticity: Fine-tuned to recognize and generate Lebanese syntax, specifically the "B" prefix for verbs and regional idioms (e.g., mni7, shou fi ma fi).
Arabizi Mastery: Expertly handles Romanized Lebanese using numbers (e.g., 3 for 'ayn, 7 for ha, 2 for hamza).
Blackwell Optimized: Merged into 16-bit (Bfloat16) to leverage the 5th Gen Tensor Cores and 128GB Unified Memory of the DGX Spark.
Cultural Nuance: Enhanced understanding of Lebanese culinary, geographic, and social context compared to base Llama-3.1.
Because this model was developed on the sm_121a architecture, it is best loaded using the "Stable Path" to avoid Triton compiler conflicts.
Standard Inference (Hugging Face Transformers)
python
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
34model_id ="esix117/lebanese-llama-3.1-8b"5tokenizer = AutoTokenizer.from_pretrained(model_id)67model = AutoModelForCausalLM.from_pretrained(8 model_id,9 torch_dtype=torch.bfloat16,10 device_map="auto"11)1213# Recommended System Prompt for a Native Persona14system_prompt ="You are a helpful Lebanese assistant speaking strictly in Lebanese Ammiya (dialect)."1516messages =[17{"role":"system","content": system_prompt},18{"role":"user","content":"Marhaba! Kifak el yom? Khabbirni shway shou fi ma fi."}19]2021inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda")22outputs = model.generate(inputs, max_new_tokens=150, temperature=0.7)23# Slice the output to remove the prompt and only show the assistant's reply24print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
💡 Prompting Tips
To get the most out of Lebanese-Llama-3.1-8B, you can "steer" the model's output script and tone by adjusting your system prompt.
🔠 Script Control
You can toggle between Arabizi and Arabic Script by changing the persona constraints:
Output Format Keywords to use in System Prompt
Arabizi Only "MUST respond ONLY in Arabizi (Latin script). Do not use Arabic script."
Arabic Script "MUST respond ONLY in Lebanese Arabic script. Do not use Latin letters."
Mixed (Natural) "Respond naturally in Lebanese Ammiya, using the script the user uses."
🎭 Tone & Slang
Because the model was trained on the DGX Spark with a focus on dialectal authenticity, it responds well to specific slang triggers:
Casual: Add "Use slang like 'Ya zalame' or 'ya m3allem'."
Helpful: Add "You are a friendly Lebanese cousin helping a relative."
Direct: Add "Be short and snappy, like a WhatsApp message."
🛠 Troubleshooting for Developers
Handling "Echoing"
When using the transformers library, the model may return your prompt along with its answer. Always slice your output tensor to get the clean Lebanese response:
Python
Triton Compatibility: If running on Blackwell hardware (sm_121a), you may encounter a ptxas fatal : Value 'sm_121a' is not defined error when using custom kernels. To fix this, use the standard PyTorch RMS Norm fallback: