abdnaouri/moroccan-darija-llm-dataset
Updated โข 80
How to use abdnaouri/silma-2b-darija-lora with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("silma-ai/SILMA-Kashif-2B-Instruct-v1.0")
model = PeftModel.from_pretrained(base_model, "abdnaouri/silma-2b-darija-lora")How to use abdnaouri/silma-2b-darija-lora with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="abdnaouri/silma-2b-darija-lora")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("abdnaouri/silma-2b-darija-lora", device_map="auto")How to use abdnaouri/silma-2b-darija-lora with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "abdnaouri/silma-2b-darija-lora"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "abdnaouri/silma-2b-darija-lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/abdnaouri/silma-2b-darija-lora
How to use abdnaouri/silma-2b-darija-lora with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "abdnaouri/silma-2b-darija-lora" \
--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": "abdnaouri/silma-2b-darija-lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "abdnaouri/silma-2b-darija-lora" \
--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": "abdnaouri/silma-2b-darija-lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use abdnaouri/silma-2b-darija-lora with Docker Model Runner:
docker model run hf.co/abdnaouri/silma-2b-darija-lora
DerejLLM 2B v1 is a Sovereign AI adapter for Moroccan Darija built on SILMA-2B-Instruct-v1.0.
Best used via
derej.Client()Compound AI which routes around the 2B capacity limit using deterministic Moroccan engines.
The 2B raw model has inherent capacity limitations. On unseen Moroccan real-world queries:
| System | Score |
|---|---|
| Raw 2B Neural Only | 0/6 (0.0%) |
| DerejLLM Compound AI | 6/6 (100.0%) |
Use the Compound AI system for production use cases.
from derej import Client
client = Client()
response = client.chat("ุดุญุงู ุบุงุฏู ุชููููู ุฑุฎุตุฉ ุงูุณูุงูุฉุ")
print(response)
| Category | Score |
|---|---|
| Adversarial law traps | โ 4/4 |
| Moroccan monetary math | โ 5/5 |
| Civic/legal truth | โ 7/7 |
| Mythical entity gating | โ 2/2 |
| Toxic safety gating | โ 2/2 |
| Total | 29/29 (100%) |