Downloads · 30 days
19
12% of all-time downloads
LiteMind/YutaLM-M2-bnb-4bit
YutaLM-M2-bnb-4bit is a text generation model from LiteMind. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as agpl-3.0.
YutaLM-M2-bnb-4bit is a lightweight, highly optimized 350M parameter hybrid architecture model fine-tuned specifically for Arabic Chat and Roleplay.
Downloads · 30 days
19
12% of all-time downloads
All-time downloads
156
Public
Parameters
860M
1.3 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors1.3 GB · 100%
How the weights are stored.
U8564M · 66%
From the Hugging Face model README
YutaLM-M2-bnb-4bit is a lightweight, highly optimized 350M parameter hybrid architecture model fine-tuned specifically for Arabic Chat and Roleplay.
Developed under the LiteMind initiative, this model addresses the classic limitations of small-scale language models handling complex Arabic morphology and dialogue. By leveraging advanced target module tuning alongside direct training on Arabic linguistic embeddings (embed_tokens and lm_head), YutaLM-M2 delivers fluid, contextually expressive, and culturally nuanced Arabic interactions while maintaining an incredibly small hardware footprint.
| Feature | Description |
|---|---|
| Tailored for Arabic Roleplay & Chat | Fine-tuned on conversational datasets to provide engaging, expressive, and grammatically sound Arabic outputs. |
| Hybrid Architecture Optimization | Safely trained using advanced gradient handling to perfectly accommodate the model's specialized convolution (conv) and recurrence layer mechanics. |
| Enhanced Arabic Tokenization | Unlike naive fine-tunes, this model had its vocabulary embeddings and language model head explicitly trained to prevent letter-mixing and broken script generation. |
| Ultra-Low Resource Footprint | Pre-quantized and merged natively in 4-bit using bitsandbytes (forced_merged_4bit), allowing seamless deployment and rapid inference on consumer-grade GPUs or free cloud tiers (like Google Colab T4). |
The model utilizes the standard ChatML (LFM) sequence format. To achieve the best conversational or roleplaying stance, structure your inputs as follows:
<|im_start|>user
{Your Prompt Here}
<|im_end|>
<|im_start|>assistant
⚠️ Note: To prevent repetitive or broken generation artifacts common in smaller models, it is highly recommended to enforce a slight repetition penalty (
1.05) and set a moderate temperature during inference.
You can easily run this model using the Hugging Face transformers library. Ensure you have bitsandbytes and accelerate installed.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
model_name = "LiteMind/YutaLM-M2-bnb-4bit"
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto"
)
# Prepare the conversation
messages = [
{"role": "user", "content": "مرحباً يا يوتا، كيف يمكنني برمجة نموذج ذكاء اصطناعي صغير؟"}
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
return_dict=True
).to("cuda")
# Initialize streamer for real-time output
streamer = TextStreamer(tokenizer, skip_prompt=True)
# Generate response
print("Assistant: ")
_ = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.73,
top_k=50,
top_p=0.9,
repetition_penalty=1.05,
streamer=streamer
)
The model was meticulously fine-tuned using the Unsloth framework on a single-GPU instance.
To ensure the model didn't lose its linguistic capabilities during adaptation, a masked training approach was utilized to calculate loss exclusively on the assistant's rich Arabic responses. Additionally, vocabulary layers were dynamically updated to absorb Arabic stylistic semantics, preventing the typical degradation seen in smaller post-quantized models.
This model is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). You are free to use, modify, and host this model, provided that any derivative works, modified versions, or web services leveraging this model are also open-sourced under the same AGPL-3.0 terms.
Special thanks to the Unsloth team for providing the memory-efficient frameworks that make fine-tuning hybrid, low-parameter models accessible and highly performant.