An experimental QLoRA adapter exploring Tunisian Arabic with Gemma 3 27B IT.
Release stage: Alpha
Artifact: PEFT adapter (not a standalone model)
Base model:google/gemma-3-27b-it
Modification notice: This repository distributes a QLoRA adapter derived from and modifying Google's Gemma 3 27B IT model. It is an independent community project and is not an official Google product or endorsed by Google.
Gemma Tounsi Alpha is an experimental parameter-efficient fine-tuning (PEFT) adapter built on Google's Gemma 3 27B instruction-tuned model.
The project explores adapting Gemma's conversational behavior to better handle Tunisian Arabic (Derja), including the varied ways people write it: Arabic script and Arabizi (Tunisian Arabic written with Latin characters and numerals).
This is an early-stage release intended for testing, feedback, and further development. It should not be treated as a fully evaluated or production-ready Tunisian Arabic model. No claim of improvement over the untouched base model is made without comparative evaluation.
| Field | Details |
|---|---|
| Model name | Gemma Tounsi Alpha |
| Model type | QLoRA / LoRA adapter |
| Base model | google/gemma-3-27b-it |
| Base architecture | Gemma 3 27B IT |
| Main target | Tunisian Arabic (Derja) |
| Writing forms of interest | Arabic script and Arabizi |
| Adapter format | PEFT |
| PEFT version recorded in the original model card | 0.21.3 |
| Release stage | Alpha / experimental |
Gemma Tounsi Alpha is intended for:
For reliable use, load the adapter on top of its required base model and evaluate outputs for the target task and audience.
This release is not validated for high-stakes decisions or as a sole source of advice in medical, legal, financial, safety-critical, or other consequential settings. It should not be used to generate or facilitate harmful, unlawful, deceptive, or discriminatory content.
The repository distributes the adapter and supporting files, including:
GEMMA_TERMS_OF_USE.md — a copy of the applicable Gemma Terms of Use.
NOTICE — the notice required by the Gemma Terms of Use.
MODIFICATIONS.md — a summary identifying this repository's Gemma-derived modifications.
adapter_config.json — adapter configuration.
adapter_model.safetensors — trained adapter weights.
tokenizer.json and tokenizer_config.json — tokenizer assets supplied with this release.
special_tokens_map.json — special-token configuration.
chat_template.jinja — chat template supplied with this release.
The full Gemma 3 27B base-model weights are not included. Training-resume files such as optimizer state, scheduler state, random-number-generator state, and trainer state are not required for ordinary inference and are not part of the intended model release.
You need:
google/gemma-3-27b-it on Hugging Face, subject to Google's access conditions.Install the core libraries:
pip install -U transformers peft accelerate
The example below uses the Gemma 3 27B Transformers model class and the PEFT loader. Replace YOUR_HF_USERNAME with the Hugging Face account that hosts this repository.
import torch
from peft import PeftModel
from transformers import AutoProcessor, Gemma3ForConditionalGeneration
BASE_MODEL_ID = "google/gemma-3-27b-it"
ADAPTER_ID = "YOUR_HF_USERNAME/gemma-tounsi-alpha"
processor = AutoProcessor.from_pretrained(BASE_MODEL_ID)
base_model = Gemma3ForConditionalGeneration.from_pretrained(
BASE_MODEL_ID,
torch_dtype="auto",
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, ADAPTER_ID)
model.eval()
messages = [
{
"role": "user",
"content": [
{"type": "text", "text": "عسلامة، شنية أحوالك؟"}
],
}
]
inputs = processor.apply_chat_template(
messages,
tokenize=True,
return_dict=True,
return_tensors="pt",
add_generation_prompt=True,
).to(model.device)
with torch.inference_mode():
output_ids = model.generate(**inputs, max_new_tokens=128)
print(processor.decode(output_ids[0], skip_special_tokens=True))
Compatibility note: use a Transformers version that supports Gemma 3. The model class and target modules must match the architecture used when the adapter was trained. If your training configuration used a different Gemma 3 model class, follow that configuration when loading the adapter.
The adapter was produced using QLoRA, a quantized-base-model approach to parameter-efficient fine-tuning. The project training workflow used the Soup training stack, with PEFT used for adapter handling.
The following details are not fully documented in this release and are therefore not reported as facts here:
These details should be added when verified against the final training configuration and logs.
No formal evaluation results are published with this Alpha release. Before drawing conclusions about its performance, compare it with the unmodified google/gemma-3-27b-it model using the same prompts, decoding settings, and a held-out evaluation set.
Useful evaluation dimensions include:
Evaluation results should include the test-set source, sample count, scoring method, and limitations.
Gemma Tounsi Alpha is an adapter derived from Google's Gemma model. Its distribution and use are subject to the Google Gemma Terms of Use. This model card does not replace those terms or grant rights to the underlying Gemma model.
Before distributing this adapter, ensure the repository and the distribution process satisfy the Gemma Terms of Use, including the requirements to:
NOTICE text file containing the exact notice required by the current terms:Gemma is provided under and subject to the Gemma Terms of Use found at gemma.ai/resources/terms
A copy of the current terms is included as GEMMA_TERMS_OF_USE.md. The applicable use restrictions are described in Section 3.2 of those terms. Recipients must review and comply with them.
Do not describe this adapter as being independently licensed under MIT, Apache-2.0, or another permissive license unless that statement has been reviewed for consistency with the Gemma Terms of Use.
Gemma Tounsi Alpha builds on Google's Gemma 3 27B IT and the Hugging Face PEFT ecosystem.
Gemma Tounsi Alpha is a collaborative AI engineering project developed by two engineering students in Tunisia.
| Contributor | Institution | Contribution |
|---|---|---|
| Mohamed Bensaad | National Engineering School of Carthage, Tunisia | Project leadership, model development, and QLoRA fine-tuning |
| Haithem Nasr | National Engineering School of Sousse, Tunisia | Collaborative research and project development |
We believe in building open AI technologies that better represent Tunisia's linguistic identity and contribute to the development of the Tunisian AI ecosystem.
Built collaboratively in Tunisia. 🇹🇳
Feedback, reproducible examples, and evaluation results are welcome. Please clearly identify the prompt, expected behavior, observed output, and software versions when reporting an issue.