Instructions to use MohJaf/Bayan-15B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MohJaf/Bayan-15B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MohJaf/Bayan-15B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MohJaf/Bayan-15B") model = AutoModelForCausalLM.from_pretrained("MohJaf/Bayan-15B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MohJaf/Bayan-15B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MohJaf/Bayan-15B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MohJaf/Bayan-15B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MohJaf/Bayan-15B
- SGLang
How to use MohJaf/Bayan-15B 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 "MohJaf/Bayan-15B" \ --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": "MohJaf/Bayan-15B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "MohJaf/Bayan-15B" \ --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": "MohJaf/Bayan-15B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MohJaf/Bayan-15B with Docker Model Runner:
docker model run hf.co/MohJaf/Bayan-15B
Bayan-15B
A specialized Arabic Large Language Model for legal reasoning, interpretive methodologies, and classical Arabic text analysis.
Model Description
Bayan-15B is a domain-adapted language model built on Qwen2.5-14B, fine-tuned on a comprehensive corpus of classical Arabic legal and interpretive texts. The model excels at understanding complex argumentative structures, legal reasoning patterns, and hermeneutical methodologies in Arabic.
Key Capabilities
- Legal Text Analysis: Understanding and generating classical Arabic legal discourse
- Interpretive Reasoning: Analyzing methodological frameworks and interpretive principles
- Classical Arabic: Deep comprehension of traditional scholarly Arabic writing styles
- Argumentation: Following complex chains of reasoning and evidence-based arguments
Training Data
- Corpus Size: Approximately 190 million tokens
- Sources: Over 900 classical Arabic texts covering legal theory, interpretive methodology, and jurisprudential reasoning
- Language: Classical and Modern Standard Arabic
Technical Specifications
| Parameter | Value |
|---|---|
| Base Model | Qwen/Qwen2.5-14B |
| Parameters | 14.7B |
| Training Method | Continued Pre-Training (CPT) |
| Context Length | 2048 tokens |
| Precision | bfloat16 |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained( "MohJaf/Bayan-15B", torch_dtype="auto", device_map="auto" ) tokenizer = AutoTokenizer.from_pretrained("MohJaf/Bayan-15B")
prompt = "Your Arabic text here" inputs = tokenizer(prompt, return_tensors="pt").to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Use Cases
- Academic research in Arabic legal traditions
- Analysis of classical interpretive methodologies
- Arabic NLP applications requiring domain expertise
- Educational tools for Arabic legal studies
- Compliance and advisory systems for Islamic finance
Limitations
- Specialized in classical Arabic legal discourse
- Not a substitute for qualified legal or religious experts
- Should be used as a research and analysis tool
- May require domain expertise to evaluate outputs
License
This model is released under CC BY-NC-ND 4.0.
Academic and research use is permitted. Commercial use requires separate licensing. Modifications and redistribution are not permitted without prior authorization.
For commercial licensing inquiries, please contact the developer.
Developer
Bayan AI, LLC Building AI solutions for Arabic language understanding and specialized domains.
Citation
@misc {usuli-ai-2025, author = {Bayan AI}, title = {Bayan-15B: Arabic Legal Reasoning Language Model}, year = {2025}, publisher = {Hugging Face}, url = { https://huggingface.co/MohJaf/Bayan-15B } }
Contact
Hugging Face:
@MohJaf
Organization: Bayan AI, LLC
- Downloads last month
- 15