Instructions to use Lyte/Gemma-3-1B-Moroccan-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lyte/Gemma-3-1B-Moroccan-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lyte/Gemma-3-1B-Moroccan-Instruct")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Lyte/Gemma-3-1B-Moroccan-Instruct", dtype="auto") - llama-cpp-python
How to use Lyte/Gemma-3-1B-Moroccan-Instruct with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Lyte/Gemma-3-1B-Moroccan-Instruct", filename="gemma-3-1b-moroccan-instruct-q4_k_m.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Lyte/Gemma-3-1B-Moroccan-Instruct with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Lyte/Gemma-3-1B-Moroccan-Instruct: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 Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Lyte/Gemma-3-1B-Moroccan-Instruct: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 Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M
Use Docker
docker model run hf.co/Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Lyte/Gemma-3-1B-Moroccan-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lyte/Gemma-3-1B-Moroccan-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lyte/Gemma-3-1B-Moroccan-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M
- SGLang
How to use Lyte/Gemma-3-1B-Moroccan-Instruct 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 "Lyte/Gemma-3-1B-Moroccan-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lyte/Gemma-3-1B-Moroccan-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Lyte/Gemma-3-1B-Moroccan-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lyte/Gemma-3-1B-Moroccan-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use Lyte/Gemma-3-1B-Moroccan-Instruct with Ollama:
ollama run hf.co/Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M
- Unsloth Studio new
How to use Lyte/Gemma-3-1B-Moroccan-Instruct 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 Lyte/Gemma-3-1B-Moroccan-Instruct 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 Lyte/Gemma-3-1B-Moroccan-Instruct to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Lyte/Gemma-3-1B-Moroccan-Instruct to start chatting
- Docker Model Runner
How to use Lyte/Gemma-3-1B-Moroccan-Instruct with Docker Model Runner:
docker model run hf.co/Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M
- Lemonade
How to use Lyte/Gemma-3-1B-Moroccan-Instruct with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Lyte/Gemma-3-1B-Moroccan-Instruct:Q4_K_M
Run and chat with the model
lemonade run user.Gemma-3-1B-Moroccan-Instruct-Q4_K_M
List all available models
lemonade list
Gemma-3-1B Moroccan Instruct (test finetune)
- Developed by: Lyte
- License: Apache-2.0
- Base model:
unsloth/gemma-3-1b-it-unsloth-bnb-4bit - Dataset:
Lyte/Moroccan-QA-Extended(with additional English Questions -> Moroccan Darija Answers) - Language: Moroccan Arabic (Darija)
How to use in LM Studio
You can easily run this model in LM Studio using the preset configuration. Click the badge below to open the model directly in LM Studio:
GGUF Quants:
Inference Example
Here is an example of the model's output in LM Studio, answering a question about Newton's law of universal gravitation in Moroccan Darija.
Q: what is the capital of France?
Q: شرح ليا كيفاش الجادبية كتخدم؟
Inference Settings:
Training Details
- Max Length: 1024 tokens
- Epochs: 3
- Total Steps: 843
- Batch size: 2 (per device)
- Gradient Accumulation: 4 (Total effective batch size: 16)
- Learning rate: 2e-4
- Optimizer: 8-bit AdamW
- Scheduler: Linear
- Weight decay: 0.01
- Seed: 3407
- Num of Examples: 4,495
- Trainable Parameters: 52.18M (4.96%)
- Training Time: ~1 hour on a single GPU.
This was the first test finetune run, not a final production model. Training was done using Unsloth for speedup and Hugging Face TRL for supervised finetuning.
Results
- Training Loss: From 2.171600 to 0.9392 (at final step 843)
- Evaluation Loss: From 2.198849 to 1.5074 (at final step 800)
Training converged without issues. The loss metrics show expected early-stage improvement, but this checkpoint is experimental and requires further tuning and validation before use.
Limitations
- Experimental model — not yet optimized or fully Moroccan-Darija-aligned.
- Performance outside Moroccan Arabic QA tasks may be limited.
- Further finetuning and evaluation are needed before production use.
Uploaded finetuned model
- Developed by: Lyte
- License: apache-2.0
- Finetuned from model : unsloth/gemma-3-1b-it-unsloth-bnb-4bit
This gemma3_text model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 104
Model tree for Lyte/Gemma-3-1B-Moroccan-Instruct
Base model
google/gemma-3-1b-pt


