Downloads ยท 30 days
7
4% of all-time downloads
ArapCheruiyot/metrrik-gemma-3-1b
metrrik-gemma-3-1b is a text generation model from ArapCheruiyot. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as apache-2.0.
Downloads ยท 30 days
7
4% of all-time downloads
All-time downloads
158
Public
Parameters
1000M
2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2 GB ยท 98%
From the Hugging Face model README
๐ฐ๐ช AI-Native Co-Pilot for Kenyan Quantity Surveyors ๐ฐ๐ช
Fine-tuned Gemma 3 1B for professional construction cost estimation and quantity surveying
๐ค Model on Hugging Face โข ๐ Documentation โข ๐๏ธ Metrrik App
</div>Metrrik is a specialized AI model fine-tuned for the Kenyan construction industry, designed to assist Quantity Surveyors, contractors, and construction professionals with:
Kenya-Specific Expertise:
This model is designed as a professional assistant tool, not a legal authority.
User Input โ Metrrik AI โ Professional Document โ Expert Review โ Final Use
โ โ โ โ โ
Project AI Generation Cost Estimates Verification Contracts
Description & Formatting & BOQs & Adjustments & Payments
| Metric | Value | Description |
|---|---|---|
| Base Model | Google Gemma 3 1B IT | Instruction-tuned foundation model |
| Fine-tuning Method | LoRA (Low-Rank Adaptation) | Parameter-efficient fine-tuning |
| Training Iterations | 100 | Complete training cycles |
| Final Loss | 0.002 | Validation perplexity |
| Memory Usage | ~2GB | Peak inference memory |
| Response Time | 2-3 seconds | Average generation time |
The model was evaluated on 5 key construction tasks with 63.7% average keyword coverage:
| Task | Coverage | Time | Description |
|---|---|---|---|
| Residential Cost Estimate | 60.0% | 1.1s | 3-bedroom house cost breakdown |
| Commercial BOQ | 100.0% | 3.3s | Civil works bill of quantities |
| Variation Order | 33.3% | 3.2s | Contract change documentation |
| Elemental Breakdown | 50.0% | 3.8s | Cost analysis by building elements |
| Healthcare Estimate | 75.0% | 2.0s | Rural health facility costs |
Performance Highlights:
MLX is Apple's machine learning framework optimized for Apple Silicon. This is the recommended way to run Metrrik.
pip install mlx mlx-lm huggingface-hub
import mlx_lm
# Load the fine-tuned model
model, tokenizer = mlx_lm.load("ArapCheruiyot/metrrik-gemma-3-1b")
# Generate a cost estimate
prompt = """
Generate a preliminary cost estimate for a 3-bedroom residential house.
Location: Nairobi, Kenya
Floor Area: 120 mยฒ
Specifications: Basic finishes, concrete roof, standard electrical and plumbing
"""
response = mlx_lm.generate(model, tokenizer, prompt, max_tokens=512)
print(response)
import mlx_lm
from mlx_lm.sample_utils import make_sampler
# Load model
model, tokenizer = mlx_lm.load("ArapCheruiyot/metrrik-gemma-3-1b")
# Configure sampling for more deterministic output
sampler = make_sampler(temp=0.7, top_p=0.9, top_k=40)
# Generate with custom parameters
response = mlx_lm.generate(
model,
tokenizer,
prompt,
max_tokens=512,
sampler=sampler
)
For systems without Apple Silicon or for broader compatibility:
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained("ArapCheruiyot/metrrik-gemma-3-1b")
tokenizer = AutoTokenizer.from_pretrained("ArapCheruiyot/metrrik-gemma-3-1b")
# Prepare input
prompt = "Create a Bill of Quantities for civil works of a commercial building"
inputs = tokenizer(prompt, return_tensors="pt")
# Generate response
outputs = model.generate(
**inputs,
max_length=512,
temperature=0.7,
top_p=0.9,
do_sample=True
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
For web applications, use the provided Flask API server:
# Start the API server
cd metrrik-model-directory
python3 metrrik_api.py
# The API will be available at http://localhost:5000
import requests
# Health check
response = requests.get("http://localhost:5000/health")
print(response.json())
# Generate estimate
data = {
"prompt": "Generate a cost estimate for a 2-bedroom apartment",
"max_tokens": 512,
"temperature": 0.7
}
response = requests.post("http://localhost:5000/generate", json=data)
result = response.json()
print(result["response"])
| Parameter | Value | Description |
|---|---|---|
| Method | LoRA | Low-Rank Adaptation |
| Rank | 16 | LoRA rank parameter |
| Alpha | 16 | LoRA scaling factor |
| Target Modules | q_proj, v_proj, k_proj, o_proj, up_proj, down_proj, gate_proj | Attention and MLP layers |
| Learning Rate | 1e-4 | AdamW learning rate |
| Batch Size | 1 | Memory-optimized for Apple Silicon |
| Max Sequence Length | 2048 | Maximum input/output length |
| Optimizer | AdamW | Adaptive optimizer |
| Weight Decay | 0.01 | L2 regularization |
The model was trained on a specialized dataset combining:
Kenyan Construction Standards
Professional Documentation
Expert Knowledge
| Category | Examples | Description |
|---|---|---|
| Cost Estimates | 3 | Residential, commercial, healthcare projects |
| Bills of Quantities | 2 | Civil works, complete building BOQs |
| Variation Orders | 2 | Contract changes, cost adjustments |
| Cost Breakdowns | 1 | Elemental analysis, percentage distributions |
| Scope Clarification | 1 | Ambiguity resolution, risk assessment |
Gemma 3 1B Base Model
โ
+ LoRA Adapters (16 rank)
โ
Fine-tuned Metrrik Model
โ
+ MLX Optimization
โ
Apple Silicon Acceleration
lora_config = {
"rank": 16,
"alpha": 16,
"dropout": 0.1,
"target_modules": [
"q_proj", "v_proj", "k_proj", "o_proj", # Attention
"up_proj", "down_proj", "gate_proj" # MLP
]
}
metrrik-gemma-3-1b/
โโโ model.safetensors # Merged model weights
โโโ tokenizer.json # Tokenizer configuration
โโโ config.json # Model configuration
โโโ generation_config.json # Generation parameters
โโโ adapter_config.json # LoRA adapter metadata
โโโ README.md # This model card
โโโ model.safetensors.index.json # Weight index
If you use this model in your work, please cite:
@misc{metrrik-gemma-3-1b,
title={Metrrik Gemma 3 1B: AI Co-Pilot for Kenyan Quantity Surveyors},
author={Kiplangat, Robin},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/ArapCheruiyot/metrrik-gemma-3-1b},
note={Fine-tuned Gemma 3 1B model for Kenyan construction cost estimation and quantity surveying}
}
@software{metrrik_ai_2026,
title={Metrrik: AI-Native Construction Cost Estimation for Kenya},
author={Kiplangat, Robin},
year={2026},
url={https://huggingface.co/ArapCheruiyot/metrrik-gemma-3-1b},
version={1.0.0}
}
This model is licensed under the Apache License 2.0.
Copyright 2026 Robin Kiplangat
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
๐ฐ๐ช Built for Kenya, by Kenya ๐ฐ๐ช
Transforming construction cost estimation with AI
</div>