Skip to content
AillianPublic

About

Muneer (منير) is an AI da'i that talks with non-Muslims about Islam in many languages. It answers their questions, walks them step by step through the shahada, helps them choose a Muslim name and shares how-to guides such as prayer. A guardrail checks every reply, and a human da'i takes over when needed.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Muneer (منير)

Muneer is an AI da'i: a fine-tuned language model that talks with non-Muslims about Islam in their own language. This repository is the system around the model: a chat app, a pipeline that has a second model (the guardrail) check each of Muneer's replies before the visitor sees it, the code to serve and deploy the model, and the configuration it was trained with. The weights and the training data are private and not included.

The Chat tab. The conversation opens with the welcome and the AI disclosure. The visitor asks "What is Islam?", and Muneer, labelled "Muneer · AI", answers: Islam means submission to the One God, belief in all the prophets with Muhammad as the final messenger, and the five pillars.

How it fits together

flowchart LR
    visitor["Visitor's browser"] --> app["app/<br/>Gradio web page"]
    app --> pipeline["pipeline/<br/>the steps for every message"]
    pipeline -->|"the conversation"| server["server/<br/>Muneer on vLLM, on a GPU"]
    pipeline -.->|"or, without a GPU"| mock["mock_muneer/<br/>scripted stand-in"]
    pipeline -->|"each of Muneer's replies"| guardrail["Guardrail<br/>an OpenAI model"]
    pipeline -->|"after a handoff"| dai["Simulated da'i<br/>an OpenAI model"]
    pipeline -->|"every turn"| db[("SQLite database<br/>conversations and review queue")]
Loading
Part What it does
app/ Shows the chat, and every step behind each reply. Calls no model itself
pipeline/ For each visitor message: gets Muneer's reply, fills in the organisation's details, has the guardrail label it, then shows it, hands the visitor to a da'i, or closes the conversation. Saves every turn
server/ Serves Muneer through an OpenAI-compatible API, behind an API key
mock_muneer/ The same API with scripted replies, so everything else runs without a GPU
deploy/ The Docker images, and the launcher that runs the model and the app in one container
training/ The Axolotl configuration that fine-tuned the model the server serves

Quick start

Recommended: use the deployed app at https://6sdqeqmw9mjnbs-7860.proxy.runpod.net. It runs the real model, and there is nothing to install.

Warning

The API serves the raw model, without the guardrail, so its replies reach you unchecked. To see Muneer with the guardrail, use the app.

To run it yourself, both ways below need Docker and an OpenAI API key, because the guardrail and the simulated da'i are OpenAI models. From the repository root:

cp .env.example .env

The all-in-one image: the real model

The recommended way to run it yourself: the real model and the app in one container. You need an NVIDIA GPU of 48 GB (24 GB with MUNEER_QUANTIZATION=fp8), driver 580 or newer, and the weights in a private Hugging Face repo (how). Set MUNEER_HF_REPO, HF_TOKEN and OPENAI_API_KEY in .env, then:

docker build -f deploy/all-in-one.Dockerfile -t muneer-all-in-one:v1 .
docker run --rm --gpus all -p 127.0.0.1:7860:7860 --env-file .env -v muneer-workspace:/workspace muneer-all-in-one:v1

Wait for [all-in-one] Muneer is ready., then open http://127.0.0.1:7860. The first start downloads about 30 GB.

No GPU: the mock

The mock is not the real model: it returns scripted replies, so you can try the interface. The guardrail and the simulated da'i are still real. Set OPENAI_API_KEY in .env, then:

docker compose -f docker-compose.yml -f docker-compose.mock.yml up --build

Open http://127.0.0.1:7860 and try "What is Islam?", "Where is God?" (a planted error, handed off to the simulated da'i) or "Please stop messaging me". Set ADMIN_PASSCODE in .env (at least 16 characters) to open the two Admin View tabs.

The deployment guide covers RunPod and a third way, the model on RunPod with the app on a laptop.

Repository map

Path What it holds
app/ The Gradio app and its four tabs
pipeline/ Muneer's client, placeholder filling, the guardrail, the simulated da'i and the database
pipeline/prompts/ The guardrail's and the simulated da'i's instructions
server/ The model server: the vLLM launcher, the API-key check, the sampling defaults, the chat template and Muneer's system prompt
mock_muneer/ The scripted stand-in for the model server
deploy/ The three Dockerfiles, the all-in-one launcher and the deployment guide
training/ The fine-tuning configuration and the run that produced the model. The training data is private and not included
model/ Only a README: the model's weights are private, in a Hugging Face repository shown in a screenshot
docs/adr/ The main design decisions, and why
docs/images/ The screenshots
*/tests/ Each folder's tests, with their own README. No GPU and no OpenAI calls
CONTEXT.md The vocabulary used in the code and the READMEs
.env.example The app's and the pipeline's settings, with defaults and comments. Copy it to .env. The model server's are in server/.env.example
docker-compose.yml The app in Docker; docker-compose.mock.yml adds the mock
docker-compose.test.yml Runs every test in Linux: docker compose -f docker-compose.test.yml run --rm tests
requirements-dev.txt, pytest.ini To run the tests natively: pip install -r requirements-dev.txt, then python -m pytest
LICENSE The rights to the code, the model and the training data

Rights

The code, the model and the training data have different rights; see LICENSE. The model's weights and the training data are private and not in this repository.

About

Muneer (منير) is an AI da'i that talks with non-Muslims about Islam in many languages. It answers their questions, walks them step by step through the shahada, helps them choose a Muslim name and shares how-to guides such as prayer. A guardrail checks every reply, and a human da'i takes over when needed.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages