Instructions to use bnbasel/allam-plus-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use bnbasel/allam-plus-7b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf bnbasel/allam-plus-7b:Q4_K_M # Run inference directly in the terminal: llama cli -hf bnbasel/allam-plus-7b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf bnbasel/allam-plus-7b:Q4_K_M # Run inference directly in the terminal: llama cli -hf bnbasel/allam-plus-7b: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 bnbasel/allam-plus-7b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf bnbasel/allam-plus-7b: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 bnbasel/allam-plus-7b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf bnbasel/allam-plus-7b:Q4_K_M
Use Docker
docker model run hf.co/bnbasel/allam-plus-7b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use bnbasel/allam-plus-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bnbasel/allam-plus-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bnbasel/allam-plus-7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/bnbasel/allam-plus-7b:Q4_K_M
- Ollama
How to use bnbasel/allam-plus-7b with Ollama:
ollama run hf.co/bnbasel/allam-plus-7b:Q4_K_M
- Unsloth Desktop
- Pi
How to use bnbasel/allam-plus-7b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bnbasel/allam-plus-7b:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "bnbasel/allam-plus-7b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use bnbasel/allam-plus-7b with Docker Model Runner:
docker model run hf.co/bnbasel/allam-plus-7b:Q4_K_M
- Lemonade
How to use bnbasel/allam-plus-7b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull bnbasel/allam-plus-7b:Q4_K_M
Run and chat with the model
lemonade run user.allam-plus-7b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use bnbasel/allam-plus-7b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bnbasel/allam-plus-7b:Q4_K_M
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 bnbasel/allam-plus-7b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use bnbasel/allam-plus-7b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bnbasel/allam-plus-7b:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "bnbasel/allam-plus-7b:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
allam-plus-7b
HUMAIN's open Arabic model ALLaM-7B-Instruct, upgraded on one gaming GPU (RTX 5080):
- Reads 4× more: 16K tokens instead of 4K.
- Uses tools in Arabic: books, looks up and checks things, in Modern Standard Arabic and Saudi dialect.
- Plugs into standard apps: this GGUF file gives an OpenAI-style server with standard
tool_calls(llama.cpp, Ollama, LangGraph, the OpenAI SDK). - Lost nothing: general Arabic knowledge and instruction following stay the same.
Built by Basel, a CS/AI student at the University of Melbourne and the founder of Mujawib. Code, data recipes and every result: GitHub.
The numbers as a table
| ALLaM-7B-Instruct as released | allam-plus-7b | |
|---|---|---|
| Needle in 16K tokens of Arabic text | 0% | 100% |
| LC-Eval (HUMAIN), multiple choice on 8–16K-token Arabic books | 18.3% | 66.1% |
| ArabFuncBench (MSA), right tool / every argument right | 65.9% / 19.0% | 96.0% / 47.6% |
| AISA-ArabicFC dev (five dialects), right tool / every argument right | 68.8% / 10.8% | 92.7% / 31.6% |
| Saudi-dialect receptionist test (160 cases) | 36.3% | 85.0% |
| ArabicMMLU (14,455 questions) | 68.6% | 69.2% |
| Arabic IFEval, every instruction followed | 40.8% | 41.3% |
Same prompt format in both columns; greedy decoding.
Use it
| File | Size | For |
|---|---|---|
allam-plus-7b-Q4_K_M.gguf |
4.3 GB | most GPUs; 16K context in 8.6 GB with an 8-bit KV cache |
allam-plus-7b-Q8_0.gguf |
7.4 GB | best quality; use the 8-bit KV cache at 16K on a 16 GB card |
llama-server -m allam-plus-7b-Q4_K_M.gguf -ngl 99 -c 16384 -ctk q8_0 -ctv q8_0 -fa on --jinja --port 8095
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:8095/v1", api_key="local")
tools = [{"type": "function", "function": {
"name": "get_gold_price", "description": "سعر غرام الذهب اليوم بالريال السعودي.",
"parameters": {"type": "object", "properties": {"karat": {"type": "integer"}}, "required": ["karat"]}}}]
r = client.chat.completions.create(model="allam-plus", temperature=0, tools=tools,
messages=[{"role": "user", "content": "كم سعر غرام الذهب عيار ٢١؟"}])
print(r.choices[0].message.tool_calls) # get_gold_price {"karat": 21}
Ollama 0.40 or later: ollama create allam-plus -f Modelfile, then use its chat API with tools.
Transformers + PEFT (the adapter)
The adapter in adapter/ goes on top of the original model with YaRN ×4 set in its config (as in training; the
model was trained and tested in 4-bit NF4, as below):
import torch
from huggingface_hub import hf_hub_download
from peft import PeftModel
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
base = "humain-ai/ALLaM-7B-Instruct-preview"
config = AutoConfig.from_pretrained(base)
config.rope_parameters = {"rope_theta": 1e6, "rope_type": "yarn", "factor": 4.0, "original_max_position_embeddings": 4096}
config.max_position_embeddings = 16384
tok = AutoTokenizer.from_pretrained(base)
tok.chat_template = open(hf_hub_download("bnbasel/allam-plus-7b", "chat_template.jinja"), encoding="utf-8").read()
model = AutoModelForCausalLM.from_pretrained(
base, config=config, device_map="auto", dtype=torch.bfloat16,
quantization_config=BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16))
model = PeftModel.from_pretrained(model, "bnbasel/allam-plus-7b", subfolder="adapter")
prompt = tok.apply_chat_template(messages, tools=tools, add_generation_prompt=True, tokenize=False)
# the reply holds <tool_call>{"name": ..., "arguments": {...}}</tool_call> lines for any tool calls
The 16K setting (YaRN ×4) and the chat template are stored in the GGUF files, so no extra flags are needed.
Write tool names in English and descriptions in Arabic or English; the model sees the tools after a short Arabic guide
and answers with one <tool_call>{"name": ..., "arguments": {...}}</tool_call> line per call, which the server turns
into tool_calls.
The files, tested the way apps use them
Each file was run through llama-server's chat API with nothing but the file itself. Choosing a tool is even better than in training, because the server only lets the model write tool names that exist.
| File | Context | KV cache | GPU memory | Writing speed |
|---|---|---|---|---|
| Q4_K_M | 16K | 8-bit | 8.6 GB | 90 tokens/s |
| Q4_K_M | 4K | 16-bit | 6.2 GB | 123 tokens/s |
| Q8_0 | 16K | 8-bit | 11.5 GB | 69 tokens/s |
RTX 5080, llama.cpp b11457.
Long context
The original model stops working past 4,096 tokens. After the upgrade it finds a fact hidden anywhere in 16K tokens of Arabic text.
How it was built
- Baselines first. Needle-in-a-haystack in Arabic, LC-Eval, ArabicMMLU, Arabic IFEval, ArabFuncBench, AISA and a Saudi-dialect receptionist test, all run on the untouched model before any training.
- Long context. YaRN position scaling ×4, then QLoRA on 16K-token Arabic examples the model wrote itself from Wikipedia (questions about long texts) plus its own short answers as replay, so short-text behaviour stays the same. Training at 16K on 16 GB took chunked loss and activation offloading.
- Tool calling. 2,624 general tool conversations (102 tools in 18 everyday domains; MSA and Saudi users; one call, parallel calls, chained calls, missing details, tool errors, no tool fits) from our own rule-driven generation pipeline built on DeepSeek V4.1 Flash, every conversation checked by rules; plus 1,095 receptionist conversations and replay from step 2. Then a short second pass weighted towards the receptionist conversations. Checkpoints were chosen by rules fixed before training.
- Serving. A chat template that writes exactly the training prompt from a standard OpenAI request (checked on 16,224 prompts), a tokenizer setting so llama.cpp produces the same tokens as training, and the 16K setting inside the GGUF. The release files were re-tested through the chat API, through Ollama and in a LangGraph agent.
Limits
- Chained calls, missing details, arithmetic: on a 90-task LangGraph test with tools it never saw, it passed all 30 ordinary tasks (one call, two calls at once, no tool fits, tool errors, follow-ups) but only 7 of 20 where a second call needs the first one's result, 7 of 20 where a required detail is missing (it often makes one up instead of asking), and 5 of 20 that need arithmetic on tool results. Check required arguments in your app before running a tool that changes something, and do sums in code.
- Arguments: it picks the right tool far more often than it fills every argument exactly right (about half on ArabFuncBench), mostly small differences in how a value is written.
- Most tests are synthetic or translated; the receptionist test was written for the earlier project. Real users write with more variety.
- 16K is the trained length; longer inputs are not supported.
Licence: Apache-2.0, as the base model.
- Downloads last month
- 61
4-bit
8-bit
Model tree for bnbasel/allam-plus-7b
Base model
humain-ai/ALLaM-7B-Instruct-preview



