Instructions to use Abdulwasey/SaudiLegalAI-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Abdulwasey/SaudiLegalAI-8B with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("Abdulwasey/SaudiLegalAI-8B") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- Pi new
How to use Abdulwasey/SaudiLegalAI-8B with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Abdulwasey/SaudiLegalAI-8B"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Abdulwasey/SaudiLegalAI-8B" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Abdulwasey/SaudiLegalAI-8B with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Abdulwasey/SaudiLegalAI-8B"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Abdulwasey/SaudiLegalAI-8B
Run Hermes
hermes
- MLX LM
How to use Abdulwasey/SaudiLegalAI-8B with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Abdulwasey/SaudiLegalAI-8B"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Abdulwasey/SaudiLegalAI-8B" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Abdulwasey/SaudiLegalAI-8B", "messages": [ {"role": "user", "content": "Hello"} ] }'
SaudiLegalAI-8B
Specialized Legal AI Assistant for Saudi Arabian Law
SaudiLegalAI-8B is a specialized legal artificial intelligence model developed by Abdul Wasey specifically for the Saudi Arabian legal system. Built upon the advanced Qwen3-8B architecture and optimized with Apple MLX framework, this model provides expert-level assistance in Saudi legal matters, combining modern commercial law with traditional Islamic jurisprudence.
🏛️ Model Overview
SaudiLegalAI-8B is designed to serve legal professionals, businesses, and individuals navigating the complex Saudi legal landscape. The model integrates:
- Saudi Commercial Law - Company formation, business regulations, investment guidelines
- Islamic Jurisprudence (Fiqh) - Sharia-compliant legal principles and rulings
- Vision 2030 Reforms - Latest regulatory changes and modernization initiatives
- Bilingual Expertise - Native Arabic legal terminology with English translations
🚀 Quick Start
Installation
pip install mlx mlx-lm
Usage
from mlx_lm import generate, load
# Load SaudiLegalAI-8B
model, tokenizer = load("SaudiLegalAI-8B")
# Ask legal questions in Arabic or English
question = "ما هي متطلبات تأسيس شركة في السعودية؟"
response = generate(model, tokenizer, question, max_tokens=200)
print(response)
⚡ Technical Specifications
- Base Architecture: Qwen3ForCausalLM
- Model Size: 8.0B parameters
- Quantization: 8-bit optimized
- Context Length: 131,072 tokens
- Languages: Arabic (primary), English (secondary)
- Vocabulary Size: 151,936 tokens
- Framework: Apple MLX optimized
- License: Apache 2.0
🎯 Specialized Capabilities
Legal Domains Covered
- Corporate Law - Business formation, partnerships, mergers
- Commercial Law - Contracts, trade regulations, dispute resolution
- Investment Law - Foreign investment rules, SAGIA guidelines
- Labor Law - Employment contracts, worker rights, Saudization
- Real Estate Law - Property ownership, development regulations
- Islamic Banking - Sharia-compliant finance, sukuk, murabaha
Key Features
- ✅ Expert Legal Analysis - Detailed case law interpretation
- ✅ Regulatory Compliance - Up-to-date legal requirements
- ✅ Document Drafting - Legal document templates and review
- ✅ Cross-Reference - Islamic law integration with modern statutes
- ✅ Multilingual Support - Arabic legal terminology with English explanations
🔧 Advanced Configuration
Memory Requirements
- Minimum: 16GB RAM
- Recommended: 32GB RAM for optimal performance
- Apple Silicon: M1/M2/M3 optimized with MLX
Context Utilization
The model supports up to 131K tokens context length, enabling:
- Full legal document analysis
- Multi-case precedent review
- Complex regulatory interpretation
- Comprehensive legal research
⚖️ Legal Disclaimer
Important Notice: SaudiLegalAI-8B is an AI assistant designed to provide general legal information and research support. This model:
- ❌ Does NOT replace professional legal counsel
- ❌ Should NOT be used for final legal decisions
- ❌ Cannot guarantee legal accuracy in all cases
- ✅ Is intended for research and preliminary analysis only
Always consult qualified Saudi legal professionals for official legal advice and court proceedings.
🏗️ Model Development
Developer: Abdul Wasey
Institution: Legal AI Research Initiative
Training Data: Comprehensive Saudi legal corpus including:
- Saudi Commercial Court decisions (10,000+ cases)
- Ministry of Justice regulations
- SAGIA investment guidelines
- Islamic jurisprudence (Fiqh) texts
- Vision 2030 legal framework updates
Training Methodology:
- Advanced LoRA fine-tuning on legal specialization
- Multi-stage training: Foundation → Application → Integration
- Quality validation with legal expert review
- Continuous updates with regulatory changes
📞 Support & Contact
For technical support, model updates, or collaboration opportunities:
- Developer: Abdul Wasey
- Email: a.wasey40@gmail.com
- Research Focus: Saudi Legal AI, Islamic Jurisprudence Technology
- Updates: Regular model updates with legal system changes
SaudiLegalAI-8B - Bridging Traditional Islamic Law with Modern Saudi Legal Practice
Developed with respect for Islamic principles and Saudi legal traditions 🇸🇦
- Downloads last month
- 9
8-bit